Page 2 of 2
Re: prevent %TEMP% replacement
Posted: Mon Sep 02, 2013 10:04 am
by FrancescoT
Dear Jeroen,
... please excuse me, but seems that I forgot to test your package.
Let me see.
Regards
Re: prevent %TEMP% replacement
Posted: Tue Sep 03, 2013 3:06 am
by FrancescoT
Dear Jeroen,
I have just tested your project ... but it doen't contain any %TEMP% definition with the uninstall shortcut.
Anyway, I have added two additional shortcuts to your original project as follow;
1# ShortCut1 - uses %TEMP%.
2# ShortCut2 - uses a custom variable ENV_SYSTEM_TMP that holds the value of the "TMP" System Environment variable from; "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment".
These are my results!

- shortcuts.png (27.48 KiB) Viewed 6669 times
You find attached a copy of your edited project.
Regards
Re: prevent %TEMP% replacement
Posted: Wed Sep 04, 2013 1:30 am
by oti
Dear Francesco,
You're correct when you enter %TEMP% into the "shortcut to File" in IA (see IA_shortcut_1.png), but when you put the same value in the "Startup In Folder" the value gets replaced (see shortcut1.png).
Best regards,
Jeroen
Re: prevent %TEMP% replacement
Posted: Wed Sep 04, 2013 7:57 am
by FrancescoT
Dear Jerome,
... at this point I am not sure to follow you anymore.
Undisputed that putting the same value in the "Startup In Folder" this gets replaced ... if I am not wrong, your target is to have this pointing to the SYSTEM TMP variable, why don't you use "%SystemRoot%\TEMP" instead?
Regards
Re: prevent %TEMP% replacement
Posted: Thu Sep 05, 2013 12:28 am
by oti
My target is to prevent %TEMP% being replaced in the "Start in Folder" section.
Using %SystemRoot%\TEMP is not an option for us.
Jeroen
Re: prevent %TEMP% replacement
Posted: Thu Sep 05, 2013 8:25 am
by FrancescoT
Dear Jeroen,
Unfortunately, the MSI engine replaces that value and using the MSI engine, it is not possible to change this behavior ( ...just tested).
However, if you use the InstallAware Native Engine this seems to not occur ( ...just tested even in this case).
Hope this helps you.
Regards.
Re: prevent %TEMP% replacement
Posted: Mon Sep 09, 2013 2:01 am
by oti
So there is no way to prevent the replacement as described in:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx ?
if not, is there an option to do a post file modify (modify the shortcut), or does this mess up the uninstall?
Re: prevent %TEMP% replacement
Posted: Mon Sep 09, 2013 8:32 am
by FrancescoT
Dear Jeroen,
As I told you previously, it seems not possible via Windows Installer Engine.
if not, is there an option to do a post file modify (modify the shortcut), or does this mess up the uninstall?
You should use the Shell Links API ... I never tried, but I believe that it is possible to modify an existing shortcut using those API.
http://msdn.microsoft.com/en-us/library/aa969393.aspx
Regards