如何在WIX中的PackageGroup中引用快捷目录?
我有一个TestProduct.wxs文件,其中包含以下代码:如何在WIX中的PackageGroup中引用快捷目录?,wix,Wix,我有一个TestProduct.wxs文件,其中包含以下代码: <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"&g
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<util:RegistrySearch
Id="ExistsSearch"
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{...}"
Win64="no"
Result="exists"
Variable="IsInstalled" />
<Variable Name="IssTemplateFile" Type="string" Value="[MediaRootDirectory]\ADMIN.iss" bal:Overridable="no" Persisted="yes" />
<Variable Name="IssFile" Type="string" Value="" bal:Overridable="no" Persisted="yes" />
<Feature Id="ProductFeature" Title="WebPageShortcutInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<SetProperty Id="URL" Value="http://www.google.com" Sequence="execute" Before="CreateShortcuts" />
<PackageGroup Id="PackageGroup">
<ExePackage
Id="AdministratorPackage"
SourceFile="..."
DetectCondition="IsInstalled = 1"
DisplayName="Administrator"
InstallCondition="InstallationType ~= InstallationTypeServer OR InstallationType ~= InstallationTypeClient"
Compressed="yes"
Cache="no"
PerMachine="yes"
Permanent="no"
Vital="yes"
InstallCommand="...">
<ExitCode Value="3010" Behavior="forceReboot" />
<ExitCode Value="1641" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
</Fragment>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WebPageShortcutInstaller" />
</Directory>
<Directory Id="DesktopFolder">
<Directory Id="DesktopShortcutID" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="cmpWebPageShortcut" Guid="{}">
<Shortcut Directory="DesktopFolder" Id="shortcutWebPage" Name="WEb Page" Description="WebPage" Target="[URL]" Icon="IconDesktop">
<Icon Id="IconDesktop" SourceFile="favicon.ico" />
</Shortcut>
<RemoveFolder Id="removeStartMenuFolder" Directory="DesktopShortcutID" On="uninstall" />
<RegistryValue Root="HKCU" Key="..." Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
我还有另一个Bundle.wxs,我有一个这样的链:
<Chain>
<!-- Server -->
<PackageGroupRef Id="PackageGroup" />
<RollbackBoundary />
...
</Chain>
...
我想在Bundle.wxs中调用PackageGroup,同时在destkop上创建图标。
当我尝试安装PackageGroup时,WIX安装程序工作正常。我的主要问题是在桌面上创建图标。我不知道为什么没有创建。来自功能ID的组件GroupRef不工作
我把这段代码换成另一个形状,我用Product.wxs创建了一个MSI,一切正常
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="WebPageShortcutInstaller" Language="1033" Version="1.0.0.0" Manufacturer="Waters" UpgradeCode="...">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="WebPageShortcutInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<SetProperty Id="URL" Value="http://www.google.com" Sequence="execute" Before="CreateShortcuts" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WebPageShortcutInstaller" />
</Directory>
<Directory Id="DesktopFolder">
<Directory Id="DesktopShortcutID" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="cmpWebPageShortcut" Guid="...">
<Shortcut Directory="DesktopFolder" Id="shortcutWebPage" Name="Web Page" Description="WebPage" Target="[URL]" Icon="IconDesktop">
<Icon Id="IconDesktop" SourceFile="favicon.ico" />
</Shortcut>
<RemoveFolder Id="removeStartMenuFolder" Directory="DesktopShortcutID" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\..." Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
注意:必须使用PackageGroup,因为我需要将id调用到。我只想为第一个选项创建一个正确的形状。
Bundle
不支持快捷方式或组件。他们需要进入一个产品
谢谢,@Bob Arnson,我应该创建一个新的msi或.exe,然后集成到包中吗?