Joined: 04 Jun 2004
Posts: 231
Location: 48°42' n.Br./09°09' ö.L.
Posted:
Wed, 13.Apr.2005, 10:55
NSIS (http://nsis.sourceforge.net/), einem schlanken installationssystem mit guten ansaetzen fehlt ein entscheidendes feature:
die erweiterung der PATH variable um das installationsverzeichnis.
hier mal eine loesung dafuer (sieht uebrigens nur kompliziert aus... )
ReadRegStr $1 HKLM "SYSTEM\ControlSet001\Control\Session Manager\Environment" "Path"
StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ;
StrCpy $1 "$1;" # append ;
Push $1
Push "$INSTDIR;"
Call un.StrStr ; Find `$0;` in $1
Pop $2 ; pos of our dir
StrCmp $2 "" unRemoveFromPath_done
; else, it is in path
# $0 - path to add
# $1 - path var
StrLen $3 "$INSTDIR;"
StrLen $4 $2
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $3 $5$6
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Service provided by flatbyte.com
::
Powered by phpBB
:: FI Theme
:: Imprint ::
All times are GMT + 1 Hour