即使选择了不同的目录,Windows Installer 也会安装到 Defaultlocation
我希望这个问题还没有得到解答,但我觉得我已经阅读了整个互联网上的所有相关文章...
我需要将安装程序的 DefaultLocation 属性默认为 C:\ 或 D:\ (理想情况下会有这里是逻辑,但我已经知道这是不可能的,因为自定义操作是在安装文件后执行的)。
我看到的问题是,如果我使用 [TARGETDIR] 或 [ROOTDRIVE] 的属性(通常默认为 C:\ 或 D:\),那么如果用户选择不同的安装位置,安装程序将忽略他们选择的位置。
例如,在我的机器上 [ROOTDRIVE] 解析为 C:。如果我告诉安装程序到 D:\,它无论如何都会安装到 C:\。 [TARGETDIR] 和 [ROOTDRIVE] 属性都会发生这种情况。
有谁见过这个或知道为什么会发生这种情况?
谢谢, 史蒂夫
I hope this hasn't already been answered, but I feel like I have read every related article on the entire internet...
I need to have the DefaultLocation property of the Installer default to C:\ or D:\ (ideally there would be logic here but I have already learned that can't be done because Custom Actions are executed after the files are installed).
The issues I am seeing is that if I use the property for [TARGETDIR] or [ROOTDRIVE] which generally defaults to C:\ or D:\, that if a user selects a different install location, the installer ignores the location they selected.
For example on my machine [ROOTDRIVE] resolves to C:. If I tell the installer to D:\, it installs to C:\ anyway. This happens with both the [TARGETDIR] and the [ROOTDRIVE] property.
Has anyone seen this or know why this is happening?
Thanks,
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不想设置
TARGETDIR
,因为它默认为具有最大可用空间的驱动器,通常您会使用INSTALLDIR
或APPLICATIONFOLDER 之类的内容
并让用户自定义该属性。下面的 WiX 示例默认为C:\Program Files\ACME Xyz\My Program
,但如果用户将APPLICATIONFOLDER
的位置更改为D:\blahblahblah< /code> 然后文件将被安装在那里。
编辑:: 在这种情况下,只需使用立即自定义操作即可。例如
You don't want to be setting
TARGETDIR
as this defaults to the drive with the largest amount of free space, generally you'd use something likeINSTALLDIR
orAPPLICATIONFOLDER
and have the user customize that property instead. The WiX sample below defaults toC:\Program Files\ACME Xyz\My Program
but if the user changes the location ofAPPLICATIONFOLDER
to sayD:\blahblahblah
then the files will be installed there.EDIT:: In that case, just use an immediate custom action. e.g.
我刚刚弄清楚为什么 Visual Studio 安装程序会发生这种情况,更重要的是如何纠正它。
有一个名为“PackageAs”的属性,可以在 Visual Studio 中对安装文件中使用的每个文件进行访问。默认情况下,此属性设置为“vsdpaDefault”,根据我发现的一点信息,该属性会导致文件被压缩,从而更改文件以及随后的 LastModifiedDate。
可以通过将要维护 LastModifiedDate 的文件更改为 PackageAs“vsdpaLoose”来解决此问题。这会导致文件不被压缩并保持其属性。
希望其他人也会遇到同样的问题并发现这很有用。
I just figured out WHY this was happening with the Visual Studio installer and more importantly how to rectify it.
There is a property called "PackageAs", which can be accessed within Visual Studio on each file that is used in the setup file. By default this property is set to "vsdpaDefault" which based on the little bit of information I was able to uncover causes the file to be compressed, which in turn changes the file and subsequently the LastModifiedDate.
This can be resolved by changing the file you wish to maintain the LastModifiedDate on to PackageAs "vsdpaLoose". This causes the file to NOT be compressed and maintain its properties.
Hopefully someone else will have the same issue and find this useful.