我是 WiX 工具集的新手。我必须创建一个具有 2 个要求的安装程序:
- 将程序安装到默认路径。这很有效。
我想知道的实际情况。 2. 用户可以选择路径。可能有人会帮助如何在用户定义的路径上进行设置或程序安装。
这是我用于默认路径的代码。
<Directory Id="TARGETDIR" Name="SourceDir" />
<Directory Id="DesktopFolder" Name="Desktop"/>
<Directory Id="ProgramFilesFolder" />
<Directory Id="INSTALLDIR" Name="Test" />
<Directory Id="dirTest" Name="dirTest">
<Directory Id="ID" Name="Project Name" />
<Directory Id="A_ID" Name="NAME" />
<Directory Id="Queries" Name="Queries" />
<Directory Id="v1311" Name="1.3.1.1"/>
最佳答案
在文档中很容易找到
WixUI_InstallDir does not allow the user to choose what features to install, but it adds a dialog to let the user choose a directory where the product will be installed.
This dialog set is defined in the file WixUI_InstallDir.wxs in the WixUIExtension in the WiX source code.
Using WixUI_InstallDir
To use WixUI_InstallDir, you must set a property named WIXUI_INSTALLDIR with a value of the ID of the directory you want the user to be able to specify the location of. The directory ID must be all uppercase characters because it must be passed from the UI to the execute sequence to take effect.
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="TESTFILEPRODUCTDIR" Name="Test File">
...
</Directory>
</Directory>
</Directory>
...
<Property Id="WIXUI_INSTALLDIR" Value="TESTFILEPRODUCTDIR" />
<UIRef Id="WixUI_InstallDir" />
关于c# - 安装文件或程序在安装时安装在用户定义的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63735860/