我正在尝试使用WiX v3.7创建一个安装程序项目,用于学习目的,因为VS2012不再包含设置和部署项目。Wix工具集已经集成到VS中,并且我正在创建一个新的WiX单一安装程序设置项目。除了图标扩展中的警告外,安装程序始终可以成功编译,运行正常,并放置桌面快捷方式,但是在Windows 7 Professional x64 Service Pack 1上无法正确放置开始菜单快捷方式。
我在网上搜索并尝试了几乎所有我看到的东西,但迄今为止没有成功。
product.wxs文件如下,“my_guid”字符串已在项目中替换为适当的GUID。显然我缺少一个重点,但无法看到它在哪里。注册表键也未被创建,因此最后一个片段可能由于某种原因未执行。这该如何解决?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="my_guid" Name="WixSingleSetupExample" Language="1055" Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="my_guid">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup"/>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductTextFile">
<File Source="blankText.txt" KeyPath="yes">
<Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" Icon="icon1.txt" IconIndex="0">
<Icon Id="icon1.txt" SourceFile="blankText.txt"/>
</Shortcut>
</File>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="my_guid">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="WixSingleSetup Help"
Description="Setup Example"
Target="blankText.txt"
WorkingDirectory="INSTALLFOLDER"
Icon="icon2.txt"
IconIndex="0">
<Icon Id="icon2.txt" SourceFile="blankText.txt"/>
</Shortcut>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software/Microsoft/WixSingleSetup" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
msiexec /i WixSingleSetupExample.msi /lvoicewarmupx log.txt
,查看日志文件 log.txt 是否能够指出组件未被安装的原因。请注意在翻译过程中不要改变原文意思,并保持简洁易懂。 - BryanJ