Does anyone know how to fix this behavior?
Currently, when our installer installs our application, he receives IShellLink , then downloads it with the data necessary for our shortcut (in the Start and Desktop menus), and then uses IPersistFile :: Save to write the shortcut.
The problem is that the path specified for the icon through IShellLink :: SetIconLocation is converted to using % ProgramFiles% ... , which ... for x64, is WRONG.
I noticed that many other 32-bit versions of the software do not work under x64, but I assumed that they themselves use % ProgamFiles% , as a literal element in their .lnk creation code. However, it looks like IShellLink is causing this error to exist. and I have no work (or perhaps the link properties editor in the shell is responsible for the problem and the base link is ok).
A few google searches didn’t find anything ... did anyone else come across this or know an article / example on how to make x64 windows not fool it?
Clarification Example:
hr = m_shell_link->SetIconLocation("C:\\Program Files (x86)\\Acme\\Prog.exe", 0);
A shortcut appears with the correct icon, but when you click "Change Icon" on the shortcut properties page, you will see the message "Windows cannot find the file% ProgramFiles% \ Acme \ Prog.exe." )