Thread: Path
View Single Post
Old 16th November 2011, 11:01   #10
Major Dude
LoRd_MuldeR's Avatar
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Option 1:
Backup the "old" path at install time. Restore it at un-install time. Chnages that have been made since install will be lost!

Option 2:
Read the current PATH at un-install time and use string functions to find "your" path in the current PATH. If found, remove only that part and write the modified PATH back. Harder to do than Option 1, but no changes made by other apps will be lost. However this solution again has the problem that "standard" NSIS can not cope with strings longer than 1024 characters!

Option 3:
Avoid modifying the global PATH environment variable from the very beginning, as has been suggested before in this thread. No problem with un-install and no NSIS string limitations. Probably the cleanest solution that you can go for...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration:
LoRd_MuldeR is offline   Reply With Quote