Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   system Environment Variable delete when uninstall (http://forums.winamp.com/showthread.php?t=254549)

freebendy 1st September 2006 02:58

system Environment Variable delete when uninstall
 
in the script i use this:
ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$0;$INSTDIR\bin"

to registry the system Environment Variable.So i also want to delete it when uninstaller is running.
but use the "DeleteRegValue
" will delete all the system Environment Variables,
what i want is only to delete the value "$INSTDIR\bin".
how to do it?

kichik 1st September 2006 08:55

Use:

http://nsis.sourceforge.net/Path_Manipulation

freebendy 1st September 2006 08:57

Thank U first!

BSOD2600 4th September 2006 05:41

I'm using a much simpler method to add/remove path stuff. Here I'm adding (then removing in the uninstaller portion) PHP from the system path:

code:

;Update the system path
ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
${WordFind} "$R1" "$INSTDIR\php" "E+1{" $R0
StrCpy $R1 "$R1;$INSTDIR\php"
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1"

;Remove system path
ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
${un.WordReplace} "$R1" ";$INSTDIR\php" "" "+" $R1
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R1"



All times are GMT. The time now is 04:08.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.