【发布时间】:2014-10-16 12:47:30
【问题描述】:
我正在使用 Wix 为 wpf 应用程序创建 MSI 安装程序。我正在创建 2 个项目,一个是 Wix 设置项目,另一个是引导程序。在 Setup 项目中有一个名为 product.wxs 的文件,在 Bootstrapper 项目中有一个名为 Bundle.wxs 的文件。我正在 product.wxs 文件中创建快捷方式,如下面的代码所示。我在 Bootstrapper 中有设置项目的参考。我可以在开始菜单中看到这个快捷方式。当我运行此快捷方式时,它会从以前安装它的 c:\ 中删除应用程序。但它仍然显示控制面板中的条目(添加或删除程序)。这种情况发生在我使用由 Bootstrapper 项目创建的 Exe 时。但是当我使用由设置项目创建的安装程序,它运行良好。控制面板中的条目也被删除。我无法弄清楚引导程序项目发生了什么。 这是我在安装项目中的 Product.wxs 代码:
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuSubfolder" Name="Vizitech Solutions">
<Component Id="ApplicationShortcuts" Guid="*">
<Shortcut Id="ApplicationShortcut1" Name="Consenus Sweeper"
Description="Consensus"
Target="[INSTALLFOLDER]ConsenusSweeper.exe"
WorkingDirectory="INSTALLFOLDER">
<Icon Id="MyAppShortCutIcon" SourceFile="Consensus_128.ico"/>
</Shortcut>
<Shortcut Id="UninstallProductStartMenu"
Name="Uninstall Consensus Sweeper"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls Consensus Sweeper"
>
<Icon Id="MyAppUninstallShortCutIcon" SourceFile="Consensus_128.ico"/>
</Shortcut>
<RegistryValue Root="HKCU" Key="Software\Vizitech\ConsensusSweeper"
Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/>
<RemoveFolder Id="INSTALLFOLDER" On="uninstall"/>
</Component>
</Directory>
</Directory>
以下是来自 Bootstrapper 项目的 Bundle.wxs 的代码:
<Bundle Name="Consensus Sweeper" Version="1.0.0.2"
UpgradeCode="PUT-GUID-HERE"
IconSourceFile="$(var.SolutionDir)Libs\Resources\Consensus_128.ico">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication LicenseFile="License.rtf"
LogoFile="FTB.bmp" LogoSideFile="FTB.bmp" />
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<MsiPackage Id="MyApplication" SourceFile="$(var.ConsensusSweeper.TargetPath)"
Visible="no">
<MsiProperty Name="ALLUSERS" Value="1"></MsiProperty>
</MsiPackage>
</Chain>
</Bundle>
【问题讨论】:
标签: xml wix windows-installer shortcut