gpt4 book ai didi

c# - 安装文件或程序在安装时安装在用户定义的路径

转载 作者:行者123 更新时间:2023-12-05 04:58:57 25 4
gpt4 key购买 nike

我是 WiX 工具集的新手。我必须创建一个具有 2 个要求的安装程序:

  1. 将程序安装到默认路径。这很有效。

我想知道的实际情况。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 Dialog Set

WixUI_InstallDir does not allow the user to choose what features toinstall, but it adds a dialog to let the user choose a directory wherethe product will be installed.

This dialog set is defined in the file WixUI_InstallDir.wxs in theWixUIExtension in the WiX source code.

Using WixUI_InstallDir

To use WixUI_InstallDir, you must set a property namedWIXUI_INSTALLDIR with a value of the ID of the directory you want theuser to be able to specify the location of. The directory ID must beall uppercase characters because it must be passed from the UI to theexecute 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com