gpt4 book ai didi

wix - 如何将已安装的程序添加到 Wix Toolset 中的“所有程序”文件夹列表

转载 作者:行者123 更新时间:2023-12-04 21:43:25 26 4
gpt4 key购买 nike

我需要 XML 方面的帮助,将已安装的应用程序添加到 All Programs folder在开始菜单中,如上图所示。我已经编写了添加到桌面的 xml,但似乎找不到开始菜单的 xml。

This is the xml I used to add to desktop but I also want one for the All Programs Folder

<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut"
Guid="{SOME-GUID}">

<Shortcut Id="StartMenuShortcut"
Name="!(bind.property.ProductName)"
Target="[#MyApp]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"
Icon="Icon.ico" />

<RemoveFolder Id="CleanUpShortCut"
Directory="DesktopFolder"
On="uninstall" />

<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>

Start Menu

最佳答案

例如,您可以通过添加以下通用目录标签来实现:

<Directory Id="TARGETDIR" Name="SourceDir">                                         <!--Mandatory base <directory> declaration.-->                                    
<!--Specify the Program Menu Folder directory and Desktop folder for shortcuts-->
<Directory Id="ProgramMenuFolder" Name="All Programs folder"> <!--%ProgramData%\Microsoft\Windows\Start Menu\Programs\-->
<Directory Id ="YourCompanyFolder1" Name="Your Company"> <!--%ProgramData%\Microsoft\Windows\Start Menu\Programs\Your Company\-->
<Directory Id ="YourCompanySubFolder1" Name="Sub Folder1"> <!--%ProgramData%\Microsoft\Windows\Start Menu\Programs\Your Company\Sub Folder1\-->
<Directory Id="YourAppFolder1" Name="YourAppFolder1"/> <!--%ProgramData%\Microsoft\Windows\Start Menu\Programs\Your Company\Sub Folder1\YourAppFolder1\-->
</Directory>
</Directory>
</Directory>
</Directory>

然后,您可以使用“YourAppFolder1”作为应用程序快捷方式的目录引用。执行此操作的示例代码如下:

    <!--StartMenu Shortcut for YourApp-->
<DirectoryRef Id="YourAppFolder1">

<Component Id="ApplicationStartMenuShortcut" Guid="USEYOUROWNGUID">
<Shortcut Id="YourAppStartMenuShortcut"
Name="YourApp"
Description="YourApp description"
Target="[INSTALLFOLDER]\YourApp.exe"
WorkingDirectory="YourApp">
<Icon Id="Icon" SourceFile="..\YourApp\Images\YourApp.ico"></Icon>
</Shortcut>

<RemoveFolder Id="RemoveYourCompanyFolder1" Directory="YourCompanyFolder1" On="uninstall" />
<RemoveFolder Id="RemoveCompanySubFolder1" Directory="YourCompanySubFolder1" On="uninstall" />
<RemoveFolder Id="RemoveYourAppFolder1" Directory="YourAppFolder1" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\YourApp" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>

关于wix - 如何将已安装的程序添加到 Wix Toolset 中的“所有程序”文件夹列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43204140/

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