![]() |
#1 |
Junior Member
Join Date: May 2022
Posts: 8
|
Set Path in environment Variables
Hi folks,
New to NSIS. I have been able to ceate an installer that copies a bunch of files into a detination forlder and creates the uninstaller. The usual stuff. But what I need to do is to append a path name to the PATH environment and I'm have no joy. Can anyone help me here? Many thanks. Cran0g |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
|
https://nsis.sourceforge.io/EnVar_plug-in
Path is a limited shared resource, avoid bloating it if at all possible. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: May 2022
Posts: 8
|
Adding to the Path
Hi, Thanks for the reply. I had actually added this plugin to my NSIS installation and run the sample program. All works just fine, so I know that the installation is good. However, I cannot see, from the examples in that file how to append a new path to the existing environment variable "Path".
It must be possible, because a key feature of installers is to set the path to the newly installed path and then advise the user to reboot. How is this done in NSIS. Is it even possible? |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
|
EnVar::AddValue "PATH" "$InstDir\foo\bar"
Pop $0 IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: May 2022
Posts: 8
|
Adding to the Path
Hi Anders,
That did it. Many thanks! |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|