gpt4 book ai didi

windows - 使用 Wix 安装程序将快捷方式添加到开始菜单程序中的子文件夹

转载 作者:可可西里 更新时间:2023-11-01 12:43:28 24 4
gpt4 key购买 nike

我正在尝试将我的程序快捷方式添加到开始菜单快捷方式中的现有文件夹。例如 所有程序 -> AppNameFolder -> AppNameVersionFolder -> AppShortcut

为了实现这一点,我添加了额外的行:

          <Directory Id="ProgramMenuFolderApp" Name="App">
<Directory Id="ProgramMenuDir" Name="APP 6.3.0">

我的 .wxs 文件中的以下代码:

    <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="Program Files">
<Directory Id="CompanyName" Name="CompanyName">
<Directory Id="App" Name="App">
<Directory Id="INSTALLDIR" Name="App 6.3.0">
<Component Id="MainExecutable" Guid="23FFE6FD-2BEA-4946-9875-8DBEEA5AAF55">
<File Id="AppEXE" Name="App.exe" Source="App.exe" KeyPath="yes">
<Shortcut Id="startmenu" Directory="ProgramMenuDir" Name="App 6.3.0" WorkingDirectory='INSTALLDIR' Icon="App.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopApp" Directory="DesktopFolder" Name="App 6.3.0" WorkingDirectory='INSTALLDIR' Icon="App.exe" IconIndex="0" Advertise="yes" />
</File>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuFolderApp" Name="App">
<Directory Id="ProgramMenuDir" Name="App6.3.0">
<Component Id="ProgramMenuDir" Guid="BF266F76-192A-493E-B5C7-C54660E61D7D">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\CompanyName\App6.3.0" Type="string" Value="" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>

当我尝试构建时出现以下错误:

ProgramMenuFolderApp 目录在用户配置文件中,但未在 RemoveFile 表中列出

但是我卸载的时候并不想删除上级文件夹,我只想删除App 6.3.0及以下文件夹。

如何将快捷方式添加到开始菜单中的程序子文件夹?

最佳答案

如果该消息来自 ICE64,则它是一个警告。应理解 ICE 警告,如果可接受则忽略。 http://msdn.microsoft.com/en-us/library/aa369011(VS.85).aspx有这样的话:

ICE64 checks that new directories in the user profile are removed correctly in roaming scenarios.

Failure to fix a warning or error reported by ICE64 generally leads to problems in completely cleaning the computer during an uninstallation. When a roaming user who has installed the application logs on to a computer for the first time, all of the profile is copied down onto the computer. On advertisement (which takes place after the roaming profile download), the Installer verifies that the directory is already there and therefore does not delete it on uninstallation. This leaves the directory on the user's computer permanently.

目前还不清楚您为什么要在“开始”菜单中保留一个空的“App”目录。似乎解决 ICE 问题是最简单的。为此,只需将另一个 RemoveFolder 元素添加到您的 ProgramMenuDir 组件。

关于windows - 使用 Wix 安装程序将快捷方式添加到开始菜单程序中的子文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2004225/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com