开发者

WiX -- Set Component Directory at Install Time?

开发者 https://www.devze.com 2023-02-11 14:51 出处:网络
The following doesn\'t compile, but how can I get the equivalent functionality of [MYDIR]? <Component Id=\"MyComponent\" Guid=\"MY_GUID\" KeyPath=\"yes\" Directory=\"[MYDIR]\">

The following doesn't compile, but how can I get the equivalent functionality of [MYDIR]?

<Component Id="MyComponent" Guid="MY_GUID" KeyPath="yes" Directory="[MYDIR]">
    <File Source="MyFile.dll" Name="MyFile.dll"/>
</Component>

(I'm trying to put the file MyFile.dll into a directory whose path is determined when the installer is ac开发者_开发知识库tually run.)


The Directory attribute must correspond to a <Directory> tag somewhere in your installer. You can set that directory to the value of a property that gets set at runtime. A good example of this is using the WixUI_InstallDir to ask the user where they want to install an application.

Here is an example of usage: https://wixtoolset.org//documentation/manual/v3/wixui/dialog_reference/wixui_installdir.html

0

精彩评论

暂无评论...
验证码 换一张
取 消