freebendy
1st September 2006 03:58 UTC
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?
freebendy
1st September 2006 09:57 UTC
Thank U first!
BSOD2600
4th September 2006 06:41 UTC
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:
;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"