See the last paragraph in the Icon Table documentation [1]:
---
However, Icon files that are associated with shortcuts must be in the
EXE binary format and must be named such that their extension matches
the extension of the target. The shortcut will not work if this rule is
not followed. For example, if a shortcut is to point to a resource
having the key file Red.bar, then the icon file must also have the
extension .bar. Multiple icons can be stuffed into the same icon file as
long as all of the target files have the same extension.
---
Now it has been my experience that contrary to the above statement, the
file does NOT have to be in EXE format, but the Icon element Id has to
have the same extension as the target file.
So try this:
<File Id="notepad_exe" Compressed="no" Name="notepad.exe" DiskId="1"
Source="C:\src\notepad.exe" Vital="yes" KeyPath="yes">
<Shortcut Id="DesktopShortcut" Directory="DesktopFolder"
Name="TestIcon" Advertise="no" Icon="icon.exe"
WorkingDirectory="APPLICATIONFOLDER" IconIndex="0" />
</File>
<Icon Id="icon.exe" SourceFile="C:\src\icon.ico" />
[1] http://msdn2.microsoft.com/en-us/library/aa369210.aspx
--
Bill Arnette
www.starwitness.com <http://www.starwitness.com/>
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Maslov,
Igor
Sent: Monday, April 02, 2007 8:29 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Setting icons to shortcut,works with exe but not
with ico
Hello,
I'm trying to do quite simple thing - set a shortcut to installed
executable. It works and if my icon is embedded in executable I can see
icon image displayed on the shortcut:
This works fine:
<File Id="notepad_exe" Compressed="no" Name="notepad.exe" DiskId="1"
Source="C:\src\notepad.exe" Vital="yes" KeyPath="yes">
<Shortcut Id="DesktopShortcut" Directory="DesktopFolder"
Name="TestIcon" Advertise="no" Icon="notepad.exe"
WorkingDirectory="APPLICATIONFOLDER" IconIndex="0" />
</File>
<Icon Id="notepad.exe" SourceFile="C:\src\notepad.exe" />
But when I try to use a separate icon file, I see a symbolic image of an
icon, instead of icon image itself (the same symbolic image of an icon
that I see in Windows explorer):
This does not quite work:
<File Id="notepad_exe" Compressed="no" Name="notepad.exe" DiskId="1"
Source="C:\src\notepad.exe" Vital="yes" KeyPath="yes">
<Shortcut Id="DesktopShortcut" Directory="DesktopFolder"
Name="TestIcon" Advertise="no" Icon="icon.ico"
WorkingDirectory="APPLICATIONFOLDER" IconIndex="0" />
</File>
<Icon Id="icon.ico" SourceFile="C:\src\icon'ico" />
If I open my desktop folder, and select "Thumbnails" view I can see my
icon.ico picture on the shortcut, but in all other modes I just see
symbolic image of an icon.
Is there a way to make it working?
And two more questions, that are related:
1. I assumed that IconIndex references to the index of the image inside
.exe, .dll, or .ico files, but when I try to set nonzero IconIndex in
wxs file, the shortcut looses it's icon.
I can see in the editor, that file has multiple images.
2. After shortcut is created by Windows Installer, I tried go to
"Properties/Change Icon" to find out what are the actual icon settings,
but editing of the properties was disabled.
I did not put (at least explicitly) any user account restrictions in
my Wix files, and I use domain account with administrator privileges.
System is Windows XP.
Is it possible to "unlock" for edditing properties of installed
shortcut?
I'd appreciate any help or ideas about above problems.
Igor M
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users