WoodyOne4U
4th May 2011 21:31 UTC
Uninstall Delete $SMPrograms failing
Ok... I've seen many threads on here that almost touch on this subject, or almost give an answer, but I'm still at a loss. I am creating Start Menus just fine as follows:
CreateDirectory "$SMPROGRAMS\Folder"
CreateShortCut "$SMPROGRAMS\Folder\File.lnk" "$INSTDIR\File.exe"
However, when I run the Uninstaller, it does everything just fine EXCEPT deleting these shortcuts and the Directory. Here is my script:
Delete "$SMPROGRAMS\Folder\*.*"
RMDir /r "$SMPROGRAMS\Folder"
I've also tried:
Delete "$SMPROGRAMS\ESP Vision\File.lnk"
RMDir /r "$SMPROGRAMS\ESP Vision"
I don't think it is a privilege thing, since I am the only user on this computer, and I have administrative priviliges. Oh, this is Win 7 32-bit, in case that matters.
I've used almost identical scripting on another file that worked fine... albeit was on Win XP. Any ideas to help?
Afrow UK
4th May 2011 21:48 UTC
Searched Google for "shortcut delete nsis" :):
http://nsis.sourceforge.net/Shortcut..._Windows_Vista
Stu
WoodyOne4U
4th May 2011 22:04 UTC
Thanks... I didn't think about it being a Vista + Win 7 thing... When I googled, I only looked for Win 7.
EricTBoneJackson
6th May 2011 00:45 UTC
Same issue here
I ran into this yesterday myself. I tried both the solutions on that wiki page.
The first one (RequestExecutionLevel user) worked great on my machine (Windows 7 Professional 64-bit). It failed miserably on my coworker's machine (also Win7 Pro 64). It installed only the shortcuts. No files, no registry keys, nothing but the shortcuts.
What's worse is that it fails silently. That seems totally unforgivable for an installer package. Is there some flag I can set to prevent that? I'd rather the installer abort with flashing lights and sirens than look as if it installed our application when it didn't.
The second option (RequestExecutionLevel admin) works on both our machines, but I don't know what's supposed to go in "TODO" section. I check that the user has admin rights. What if he doesn't? Do I just abort?
MSG
6th May 2011 05:53 UTC
Originally posted by EricTBoneJackson
I check that the user has admin rights. What if he doesn't? Do I just abort?
Yes, you can throw a MessageBox and then call Quit.
As for it not working on your coworker's PC, you probably didn't have access rights to create the files and regkeys. At userlevel, you cannot write to $PROGRAMFILES or HKLM. You need to write to $LOCALAPPDATA and HKCU.