Vista: Desktop icon is not removed
Hello world,
I am doing the first Vista tests with an NSIS installer that works perfectly on 2000 and XP. I noticed that on Vista, the uninstaller does remove the start menu shortcuts, but not the desktop icon. (I only use 'all users' shortcuts.)
Searching the NSIS pages, I found two essential hints:
* Use "RequestExecutionLevel admin"
* Use "SetShellVarContext all" at both install and uninstall
I did both, but still the desktop icon is not removed on Vista. Shortened code sample:
...
RequestExecutionLevel admin
...
Section
...
SetShellVarContext all
SetOutPath "$SMPROGRAMS\MyApp"
CreateShortcut "MyApp.lnk" "$INSTDIR\MyApp.exe"
SetOutPath $DESKTOP
CreateShortcut "MyApp.lnk" "$INSTDIR\MyApp.exe"
SectionEnd
...
Section Uninstall
...
SetShellVarContext all
RmDir /r /REBOOTOK "$SMPROGRAMS\MyApp"
Delete "$DESKTOP\MyApp.lnk" # <-- Does not work on Vista
SectionEnd
What the heck am I doing wrong?