我正在尝试将我的程序快捷方式添加到开始菜单快捷方式中的现有文件夹中。例如All Programs -> 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>
尝试构建时出现以下错误:
The directory ProgramMenuFolderApp is in the user profile but is not listed in the RemoveFile table
.
但是,我不想在卸载时删除更高级别的文件夹,我只想删除 App 6.3.0 及以下文件夹。
如何将快捷方式添加到开始菜单中的程序子文件夹?