Archive: Yet another Vista related problem


Yet another Vista related problem
So i would like to start by saying that my problem is shortcut deletion related. I know that are lots of topics on this matter and i've read them all. Still i have the following problem

I have an installer for my program . The script that generates the installer uses RequestExecutionLevel admin. All works well with it (creating the shortcut, deleting them on uninstall ...the works).
Now the problematic part:
I am doing a patch for the installed program. This patch will rewrite the executable of the program. This new executable has a new name, different from the old one (cant use the old name, and pls don't ask why a new name... this is not relevant :) ). So ...at this moment i have to redo the Start menu icon to point to the new executable, and the desktop one too . So the way i've done it in the patch script is to delete the old shortcuts and make new one for the new executable.
Works well for the desktop one. Does not work for the start menu one. The script for the patch also uses RequestExecutionLevel admin

In the original installer the SM icon is created like

CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$firmName\${PRODUCT_NAME}.lnk" "$INSTDIR\${EXE_NAME}"

In the patch is deleted like

Delete "$SMPROGRAMS\${PRODUCT_NAME}\$firmName\${PRODUCT_NAME}.lnk"

i have looked in the patch and message boxed the delete string and the path is good.


First question: Are you absolutely sure that PRODUCT_NAME etc are defined exactly the same as in the original installer? You did mention that your exe filename changed...

Edit: In fact, it's bad form to use a variable to delete files whose names are entirely fixed (that is, not variable). Just use

Delete $MSPROGRAMS\full path as it was used in the first installer\full filename as it was used.lnk
Delete $MSPROGRAMS\full path as it was used in another earlier installer\full filename as it was used2.lnk


MSG ..thanks for the reply ... been staring at the script for 2.5 hours (the script won the staring contest :) ) and found the problem. As usually it was just in front of my eyes but i've overlooked it over and over and over again ( one extraspace in PRODUCT_NAME in patch ...pfff). Sometimes just talking with someone helps :).
Thanks. Problem solved.