Icon for shortcut
Could you tell me, what is wrong with my code please?
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xse="http://schemas.microsoft.com/wix/2005/XmlSchemaExtension" xmlns:html="http://www.w3.org/1999/xhtml">
<Product Id="c1ee1e1f-4e2a-41c6-a716-eb6f79477012" Name="AdministKOB" Language="1033" Version="1.0.0.0" Manufacturer="Project UP" UpgradeCode="909b9926-711d-4a97-887b-df0bafc6ea66">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Icon Id="ikonka" SourceFile="Files\AdministKOB.exe"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="DesktopFolder"/>
<Directory Id="ProgramMenuFolder">
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Administ_KOB">
<Component Id="ProductComponent" Guid="6bd37582-5219-4ae4-a56e-cd1ecd375efa">
<File Id="AdministKOB" Name="AdministKOB.exe" Source="Files\AdministKOB.exe" KeyPath="yes">
<Shortcut Advertise="yes"
Id="DesktopShortcut"
Directory="DesktopFolder"
Name="AdministKOB"
WorkingDirectory="INSTALLD开发者_运维知识库IR"
Description="Elektroniczna ksiazka budynku"
Icon ="ikonka">
</Shortcut>
</File>
<!--<File Id="ikonka" Name="C.ico" DiskId="1" Source="City.ico" Vital="yes" />-->
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="AdministKOB" Level="1">
<ComponentRef Id="ProductComponent" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
</Product>
</Wix>
I get this error and warnings:
The extension of Icon 'ikonka' for Shortcut 'DesktopShortcut' is not "exe" or "ico". The Icon will not be displayed correctly.*
Why? I give ICO file.
The extension of Icon 'ikonka' for Shortcut 'DesktopShortcut' does not match the extension of the Key File for component 'ProductComponent'.
Have you any idea?
You appear to be missing an Icon
element.. e.g.
<Icon Id="City.ico" SourceFile="City.ico" />
<Component ...>
<File ...>
<Shortcut Advertise="yes"
Id="DesktopShortcut"
Directory="DesktopFolder"
Name="AdministKOB"
WorkingDirectory="INSTALLDIR"
Description="Elektroniczna książka budynku"
Icon ="City.ico" />
</File>
</Component>
You must have an extension on your Icon id of ".exe" or ".ico".
Icon Id="ikonka*.ico*" SourceFile="Files\AdministKOB.exe"/
It is easy:
<Shortcut Directory="DesktopFolder" Id="DesktopShortcut" Name="YourApp" Description="DescriptionOfYourApp" Target="http://localhost/" Icon="YourAppIcon">
<Icon Id="YourAppIcon" SourceFile="$(var.BinDir)\favicon.ico" />
</Shortcut>
I put tag on the top of my listing :) I use icon from exe file. Wix requires the same extension for file icon file and my file (shortcut on desktop)
Thanks for you attension :)
In addition, the shortcut's icon property can take a direct path to an exe or ico file, however, there cannot be any spaces in the filename or it will error:
The Shortcut/@Icon attribute's value, '"C:\Users\yadayadayada\Data Migration.exe', is not a
legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores
(_), or periods (.). Every identifier must begin with either a letter or an underscore.
SetupProject C:\Users\yadayadayada\SetupProject\Product.wxs 53
Following worked for me. Milage may vary.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Icon Id="dbwizard.ico" SourceFile="dbwizard.ico" />
<ComponentGroup Id="DBWizardComponentGroup" Directory="INSTALLFOLDER">
<Component Id="FakeDBWizard_exe" Guid="{2008318F-8628-411E-B1B9-BC92989BCD19}">
<File Id="FakeDBWizard_exe"
Name="FakeDBWizard_exe"
Source="database\FakeDBWizard.exe"
KeyPath="yes">
<Shortcut Id="DBWizardShortcut"
Directory="Otter32ShortcutDir"
Name="Otter Database Wizards"
Description="Database Wizards for ABCSystem32"
WorkingDirectory="INSTALLFOLDER"
Advertise="yes"
Icon="dbwizard.ico" />
精彩评论