Path
How do you make an NSIS installer ad the installation directory to the Windows PATH environment variable?
12 posts
(Note that the new PATH may become effective only after a reboot)ReadRegStr $0 HKCU "Environment" "Path" #read current PATH into $0
StrCpy $0 "C:\SomePath;$0" #prepend your path to the current PATH value
WriteRegStr HKCU "Environment" "Path" '$0' #write back the new PATH
You should at least ask the user whether he wants your tool to be added to his PATH.Originally Posted by sethradio View PostI will only use this if I am writing a command line tool. This allows users of a program to not have to type the full path to the executable.
@echo off
echo Setting up environment for Super Duper Tool...
set "PATH=C:\Path To Your Tool;%PATH%"
You don't have to.Originally Posted by sethradio View PostI know I shouldn't use nsis string functions to edit the pah variable at this point. But for the sake of it, how could you use string function to find the install path?