1
我需要允许用户更改安装位置。我试过这个解决方案questionWiX-如何允许用户更改引导程序上的安装位置
我需要将我的wix msi文件添加到我的引导程序项目中。 下面是我的微星项目代码,
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" src="[TARGETDIR]">
<Directory Id="INSTALLFOLDER" Name="SetupProject1">
<Component Id="ProductComponent" Guid="2ACAD378-270B-4B50-AAED-A234A6BB8276">
<File Name="$(var.WindowsFormsApplication2.TargetFileName)" Source="$(var.WindowsFormsApplication2.TargetPath)" />
</Component>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
</ComponentGroup>
</Fragment>
以下是引导程序代码,
<Variable Name="varInstallLocation" bal:Overridable="yes" />
<Chain>
<MsiPackage
Id="MyService"
Name="MyService"
SourceFile="..\SetupProject1\bin\Release\SetupProject1.msi"
DisplayInternalUI="yes"
EnableFeatureSelection="yes"
Compressed="yes"
Vital="yes" >
<MsiProperty Name="TARGETDIR" Value="[varInstallLocation]"/>
</MsiPackage>
</Chain>
</Bundle>
我无法设置默认安装位置。我正在使用RtfLicense模板,并设置了变量(在Bundle内部但在外部链中),但初始安装文件夹为空。 – bubi 2017-09-17 16:21:07