![]() |
#1 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
append env varable only if it is not present
I need to append an env variable in Path along with a semi-colon. currently, I use
${EnvVarUpdate} $0 "PATH" "A" "HKLM" '$2'. $2 has path value. it works. however, I need to add; after path value. when I do this, it keeps adding every time when running the installer. I need to add it only if it is not present. there is no overwrite option in the EnvVarUpdate library. other than using conditions, is there any methd. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,450
|
The EnVar plug-in maybe?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
i am using plugin itself
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,450
|
EnvVarUpdate is not the same as the plug-in
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
will check on this...Thank you
|
![]() |
![]() |
![]() |
#6 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
If I remember correctly, EnVar strips the final semicolon off the end of the full string before it writes it. I don't know if older Windows cares if there is a semicolon on the end or not, but it works on windows 10 without a semicolon on the end.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|