在WIX中,如何在allusers配置文件中创建非广告的快捷方式?到目前为止,我只能通过广告快捷方式实现这一目标.我更喜欢未公布的快捷方式,因为您可以转到快捷方式的属性并使用"查找目标".
在我看过的教程中,使用注册表值作为快捷方式的keypath.问题是他们使用HKCU作为根.使用HKCU时,另一个用户卸载该程序(因为它是为所有用户安装的),注册表项会被遗忘.当我使用HKMU作为根时,我收到ICE57错误,但当另一个用户卸载该程序时,该密钥将被删除.尽管HKMU看起来行为正确(每用户对所有用户),但我似乎被推向使用HKCU.
当我尝试创建非广告的快捷方式时,我会收到各种ICE错误,例如ICE38,ICE43或ICE 57.我见过的大多数文章都建议"忽略冰错误".必须有一种方法来创建未公布的快捷方式,而不会产生ICE错误.
请发布示例代码以获取工作示例.
我正在尝试为每台计算机的应用程序生成安装程序。这是我的组件:
<Component Id="ProductComponent" Directory="InstallFolder" Guid="{MY_GUID}">
<File Id="ProductComponent" Source="$(var.MyApp.TargetPath)">
<Shortcut Id="StartMenuShortcut"
Name="MyApp"
Description="App Description"
Directory="MenuFolder"
WorkingDirectory="InstallFolder"
Icon="icon.ico" />
</File>
<RemoveFolder Id="RemoveMenuFolder" Directory="MenuFolder" On="uninstall" />
<RegistryValue Root="HKLM" Key="Software\Microsoft\MyApp" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
Run Code Online (Sandbox Code Playgroud)
WiX吐出以下内容:
错误ICE43:组件ProductComponent具有未发布的快捷方式。它的KeyPath注册表项应属于HKCU。
I can't understand why it requires a per-user KeyPath for what I intend to be a per-machine component. Would this key not be left behind during uninstall performed by another user? Or its absence result in a duplicate during repair?
似乎如此,将其更改为HKCU后,我仍然收到以下信息:
警告ICE57:组件'ProductComponent'具有按用户和按计算机的数据,并带有HKCU注册表键路径。
因此,我对如何避免在将所有内容都安装到用户配置文件中时避免任何这些错误/警告感到困惑。