cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tasdvl9
Level 2

Appending to Windows PATH variable

Hello,

I've searched for an answer to this inquiry but came up empty.

Any links explaining how to append a directory path to a Windows 7 PATH environment variable
using a Basic MSI project?

Thank You.
Labels (1)
0 Kudos
(1) Reply
SGSlavendea
Level 4

PS: (Check for path (in this case, C:\xampp\php) and add it to the system PATH, all users, system-wide)
Store in Binary table, Deferred Execution in System Context..

$PATH = [Environment]::GetEnvironmentVariable("PATH")
$xampp_path = "C:\xampp\php"
if( $PATH -notlike "*"+$xampp_path+"*" ){
[Environment]::SetEnvironmentVariable("PATH", "$PATH;$xampp_path", "Machine")
}
0 Kudos