Is it possible to use an environment variable in a shortcut? What I mean the actual "%VARIABLE%" name. I have tried #%%ENVVAR% but I get an ICE03 error.
What I want is a shortcut target to look like this: %ENVVAR%\app.exe (NO harcoded paths!)
This is for applications that point to Microsoft Office\Office10. When we upgrade Office the new path will be Microsoft Office\Office11.
yes it is possible. But you should use internal MSI Properties rather than external system ones. ie. instead of using %userprofile%(system) use [USERPROFILE]internalMSI.
Also, for the office scenario, just get the property from the Registry (HKLM\Software\Microsoft\Office . . .) via a vbs custom action, and pipe that property over to you shortcut.
In Target column of Shortcut table, the format should be as follows.
"[OFFICELOC]word.exe"
Where OFFICELOC property contains %ENVVAR%\. I believe it would behave the way you intended. The backslash is included in the property to conform with MSI directory value convention. The double quotes are needed, since the environment variable, ENVVAR, pointing to location of Office folder is most likely to contain whitespace.