Archive: latest version of path extensions?


latest version of path extensions?
i need to add a couple items to the path of 2k/xp systems with an app (no installations will be performed on anything else), and remove them when it's uninstalled

i've seen multiple copies of the path.zip that somebody whipped up around, but i'd like to ensure i have the latest/greatest/best-documented/simplest version ;) thanks.


As far as I know, there's only one thread with path.zip attached, so download that. Check:
http://forums.winamp.com/showthread....threadid=67208

-Hendri.


This is the code I use in my installer.
I think it is the same as the latest I have posted in the thread Smile2Me gave you, but here it is just to make sure.

[edit by Smile2Me]
For some strange reason, the old attachment doesn't get deleted when updated by a new one. I deleted it and posted a new message and the end of this thread.

-Hendri.
[/edit]


tks ;)


the one you gave is 5786 bytes, and only has the .nsi file

the one in the thread is 4245 bytes, and has the refreshenv exe (with source) as well

which one do i use, and do i use it by including it all in my existing nsi?


The one I gave here has the latest functions. Just integrate them into your .nsi. The funcions use the refreshenv.exe so it also required. You can ignore the .nsi files in the prior threads. This is the latest.

To make this thread a complete source of all that is needed for this functions I have attached the refreshenv with source.


Section: "Uninstall"
Function: "un.StrStr"
Push: $0
Exch(st(1),0)
Pop: $0
Push: $1
Exch(st(2),0)
Pop: $1
Exch(st(1),0)
Push: $2
Push: $3
Push: $4
Push: $5
StrCpy $2 "-1" () ()
StrLen $3 "$0"
StrLen $4 "$1"
IntOp: $4=$4-$3
IntOp: $2=$2+1
IntCmp $2:$4 equal=0, < 0, > StrStrReturn_notFound
StrCpy $5 "$1" ($3) ($2)
StrCmp "$5" "$0" equal=StrStr_done, nonequal=StrStr_loop
StrCpy $2 "-1" () ()
Pop: $5
Pop: $4
Pop: $3
Exch($2,0)
Exch(st(2),0)
Pop: $0
Pop: $1
FunctionEnd
Function: "un.IsNT"
Push: $0
ReadRegStr $0 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion
StrCmp "$0" "" equal=0, nonequal=IsNT_yes
Pop: $0
Push: 0
Return
Pop: $0
Push: 1
FunctionEnd
Function: "un.RemoveFromPath"
Exch($0,0)
Push: $1
Push: $2
Push: $3
Push: $4
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in script "H:\install\pilot.nsi" on line 258 -- aborting creation process


tried it outside of the uninstall section as well - it would appear that it's angry about the function starting with "un." and the calling of a function that doesn't start with "un."


Honold,

functions called from the uninstall section should start with "un." See http://www.nullsoft.com/free/nsis/makensis.htm#CBFuncs

Check your code carefully. If you want to re-use functions in installer and uninstaller sections, use macros.

Good luck,
-Hendri.


Whoopsy... :D

Sorry about this. I use an installer as my uninstaller so I don't use un. prefixes. A fixed version will replace the old one hopefully by the end of the day.


can you just simply explain what i need to do? is it just a matter of renaming the un.functions?


Yes, where ever you see Call something in the uninstall section replace it with un.something. I am sorry about the delay in the uploading of the corrected version. It will be availble soon, I hope.


At the request of KiCHiK, the new path.zip has been uploaded. It solves the problem described in the posts above.

Have fun,
-Hendri.