kcostain
4th November 2002 21:42 UTC
Using the $Desktop Directive with Delete
Hello,
I am using NSIS 1.98. I have been trying to delete Desktop shortcuts in my Uninstall section. The following is my code:
Section Uninstall
SetShellVarContext "Current"
Delete "$DESKTOP\L1.lnk"
Delete "$DESKTOP\L2.lnk"
Delete "$DESKTOP\L1Uninstall.lnk"
DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\L1"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\L1"
Delete "$INSTDIR\*.*"
RMDir "$INSTDIR"
SectionEnd
I am using Windows XP and I have the permission to delete these files. It doesnt matter where the Delete directive is, or if I use the SetShellVarContext, it still fails.
Any Ideas?
Kevin Costain
kichik
5th November 2002 15:37 UTC
Do you get the right directory when you use:
MessageBox MB_OK $DESKTOP?
kcostain
5th November 2002 15:46 UTC
Thanks..
That was it.. I had the wrong directory, once I fixed that - it worked..
Kevin
kichik
5th November 2002 15:53 UTC
I don't understand... Did NSIS get the desktop folder wrong or did you just needed some other folder?
kcostain
5th November 2002 16:40 UTC
If I was to look at it, I was trying to change the Context of the folders assuming that the default context was "All" (I had set this using a SetShellVarContext "All" command in an earlier section), this wasn't working with or without the command:
SetShellVarContext "Current"
The key here is, once I used MessageBox to debug the actual directory, I was able to see that the default was "current" and I needed to set "All" again.
Thanks for the help...
Kevin
kichik
5th November 2002 17:14 UTC
Please note that there is a bug with SetShellVarContext All and Windows 9x in NSIS 1.98. Instead of falling back to current it will give you the temp folder. This bug has been fixed in NSIS 2.
kcostain
6th November 2002 01:05 UTC
Thanks for the info, how can I get a copy of NSIS 2? I looked at the http://www.nullsoft.com/free/nsis/ page and 1.98 is still there.... ?
hotice
6th November 2002 01:11 UTC
Originally posted by kcostain
Thanks for the info, how can I get a copy of NSIS 2? I looked at the http://www.nullsoft.com/free/nsis/ page and 1.98 is still there.... ?
pls visit nsis.sf.net
kcostain
6th November 2002 01:14 UTC
I've been there... only a pre-release is available.. I guess I could use that but I'm not sure if that will create more problems then its worth...
virtlink
6th November 2002 10:58 UTC
Originally posted by kcostain
Thanks for the info, how can I get a copy of NSIS 2? I looked at the http://www.nullsoft.com/free/nsis/ page and 1.98 is still there.... ?
Originally posted by hotice
pls visit nsis.sf.net
Originally posted by kcostain
I've been there... only a pre-release is available.. I guess I could use that but I'm not sure if that will create more problems then its worth...
The pre-release version of NSIS 2 works fine. I haven't encountered any bugs yet (except in the documentation). And, any bugs that are found will be fixed immideatly. Download
http://nsis.sourceforge.net/nightly/nsis.zipfor the latest version (NSIS 2.0b). It is updated twice a day!