我在我的安装项目中使用 WIX 3.5。如果我在安装过程中更改安装目录,安装程序会坚持使用默认目录。
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder" Name="AppData">
<Directory Id="InstallationDir" Name="MyApp" />
</Directory>
</Directory>
...
<DirectoryRef Id="InstallationDir">
... component + files ...
</DirectoryRef>
...
<UI>
<Property Id="WIXUI_INSTALLDIR" Value="InstallationDir" />
<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
</UI>
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="InstallationDir" />
<InstallExecuteSequence>
<Custom Action="SetARPINSTALLLOCATION" After="InstallValidate" />
</InstallExecuteSequence>
我尝试了升级(我总是更改产品代码)和卸载/安装。同样的问题!
如果我运行 msiexec/L*v log.txt/i Setup.msi
,日志会告诉我 InstallationDir
属性确实已更改。
问:我的软件怎么可能安装到默认目录?
最佳答案
您必须使用全大写名称才能自定义目录。大写是 MSI 将目录(和属性)声明为 PUBLIC 并因此可自定义的方式。
关于WIX安装目录不可自定义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12302329/