gpt4 book ai didi

添加/删除程序中的 Wix 图标

转载 作者:行者123 更新时间:2023-12-03 20:17:22 24 4
gpt4 key购买 nike

我正在使用 Wix 创建我的安装程序。
据官方documentation ,如果我想更改添加/删除程序中的图标,我需要添加以下内容:

<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

但它不起作用,图标没有改变,我也收到以下警告:

C:\Users\rsheink\home\repos\tenlira\10Lira\TestWiXProject\Product.wxs(137,0): warning LGHT1076: ICE36: Icon Bloat. Icon icon.ico is not used in the Class, Shortcut, or ProgID table and also not used for ARPPRODUCTICON property.



请问我错过了什么?

谢谢。雷法尔。

编辑:
遵循@harper 的优秀建议,这里是 MCVE :
<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension">

<Product Id="*" Codepage="1252" Language="1033" Manufacturer="Intel Corporation"
Name="TenLira" UpgradeCode="PUT-GUID-HERE" Version="31.00.0000">

<Package Comments="Contact: Your local administrator" Description="TenLira" InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
Keywords="Installer,MSI,Database" Languages="1033" Manufacturer="Intel Corporation" Platform="x64" />

<Media Id="1" Cabinet="my_application.cab" EmbedCab="yes" />

<MajorUpgrade AllowDowngrades="no"
AllowSameVersionUpgrades="no"
Disallow="no"
IgnoreRemoveFailure="no"
MigrateFeatures="yes"
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed" />

<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONROOTDIRECTORY" />
<UIRef Id="WixUI_InstallDir" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="PROGRAMFILESSUBDIR" Name="Intel Corporation">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="TenLira">
<Directory Id="kmgl" Name="kmgl">
<Directory Id="kmgl_win10" Name="kmgl_win10" />
</Directory>
<Directory Id="tools" Name="tools" />
</Directory>
</Directory>
</Directory>
</Directory>

<DirectoryRef Id="tools">

<Component Id="devcon.exe" Guid="*">
<File Id="devcon.exe" Source="..\tools\devcon\amd64\devcon.exe" KeyPath="yes" />
</Component>

</DirectoryRef>

<Feature Id="MainApplication" Title="TenLira" Level="1">
<ComponentRef Id="devcon.exe" />
</Feature>

<!--It should set the icon in Add/Remove programs, but it does not works and I don't know why.-->
<Icon Id="icon.ico" SourceFile="..\TenLira icons\coins\coins.ico" />
<Property Id="ARPPRODUCTION" Value="icon.ico" />

</Product>

</Wix>

最佳答案

请求 :请评论以下任何一项是否适合您 - 以及您是否做了其他事情(以及)以使事情正常进行。

Quick List First:

  • Is ARPPRODUCTICON spelled correctly?
  • Does the File.ico file have a hidden file extension? Example: icon.ico.bmp - 1.
    • Show file extensions in Windows Explorer
    • Open a cmd.exe in the folder and do a dir to check?
  • Icon file problems:
    • Is that a proper *.ico file? Try to save a normal *.bmp and rename the extension to *.ico. That should work for a rudimentary test icon.
    • Find a proper template *.ico file for testing (there should be plentyin your Visual Studio installation folder).


更新 :
请尝试改变这一点:
<Property Id="ARPPRODUCTION" Value="icon.ico" />
进入这个:
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
我将在下面留下原始答案,因为 setup.exe 问题可能与其他人有关。
还有一件事 : 我被告知对话框设置 <UIRef Id="WixUI_Mondo" />是可用 WiX 模板中更好的一个。不过,除了那个建议之外,我没有确凿的事实。我没用过 <UIRef Id="WixUI_InstallDir" /> - 只要它可以为您节省一些时间。

旧答案 :
这可能只是一个 大写/小写问题 .如 icon.ico而不是 Icon.ico .
正确的:
<Icon Id="Icon.ico" SourceFile="MySourceFiles\Icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="Icon.ico" />
错误的:
<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="Icon.ico" />
在我的测试过程中,我收到了警告,但无论哪种方式,该图标都可以在“添加/删除程序”中工作。 您是否正在制作 setup.exe 包 ?
当您制作 setup.exe bootstrap 包 ,你必须设置 IconSourceFile Bundle Element 的属性.
保管链接: How to customize icon for Wix custom bootstrapper .

关于添加/删除程序中的 Wix 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48689641/

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