Possible Duplicate:
How do I modify the PATH environment variable when running an Inno Setup Installer?
Currently I use this line in order to add another value to PATH variable during the install:
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('{app}');
My questions are:
1) How to avoid adding that variable if already exists? If a user re-install the software, so the {app} path is concatenated again and again I checked and if I use that way with 'C:\foo'
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('C:\foo');
It works as expected. So how to use a variable instead of a constant string?
2) How to safely remove the {app} value during uninstall?
THANK YOU