Skip to content

Commit 2bd1e76

Browse files
committed
Fix registry value type of environmental variable (PATH)
1 parent 6d26abc commit 2bd1e76

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Return code: 7
305305

306306
| Ver | Date | Changes |
307307
| --- | --- | --- |
308-
| 2.0 | 20200623 | - Add setup.exe for an installation option alongside existing portable mode, adding to Run prompt and PATH environmental variable to enable the 'ChMac' command anywhere for ease of use<br>- Fix (remove) EnableLUA debug message that is displayed during UAC elevation<br>- Wrap exclamation marks around ChMacDir variable to handle parentheses<br>- Fix a bug where ChMac (Command Prompt) does not totally exit at the end<br>- Improve UAC elevation mechanism so that it supports Run prompt |
308+
| 2.0 | 20200627 | - Add setup.exe for an installation option alongside existing portable mode, adding to Run prompt and PATH environmental variable to enable the 'ChMac' command anywhere for ease of use<br>- Fix (remove) EnableLUA debug message that is displayed during UAC elevation<br>- Wrap exclamation marks around ChMacDir variable to handle parentheses<br>- Fix a bug where ChMac (Command Prompt) does not totally exit at the end<br>- Improve UAC elevation mechanism so that it supports Run prompt |
309309
| 1.3 | 20200614 | - Elevate as administrator as needed when User Account Control (UAC) is enabled in the system |
310310
| 1.2 | 20190629 | - Improve compatibility on Windows 10 by changing binaries of GNU Linux utilities<br>- Handle cases when the system PATH variable contains parenthesis |
311311
| 1.1 | 20120916 | Interim release |

Setup/Setup.ahk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ IfNotExist, %targetDir%\wandersick\ChMac\ChMac.bat
9797
; EnvGet, envVarPath, Path
9898
RegRead, envVarPath, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Path
9999
envVarPathNew = %envVarPath%;%targetDir%\wandersick\ChMac\
100-
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Path, %envVarPathNew%
100+
RegWrite, REG_EXPAND_SZ, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Path, %envVarPathNew%
101101
Sleep, 1000
102102
; Broadcast WM_SETTINGCHANGE message for the updated PATH to take effect
103103
EnvUpdate
@@ -237,7 +237,7 @@ IfNotExist, %targetDir%\wandersick\ChMac\ChMac.bat
237237
envVarPathNewTemp2 := StrReplace(envVarPathNewTemp1, targetDirToRemove2)
238238
envVarPathNewTemp3 := StrReplace(envVarPathNewTemp2, targetDirToRemove3)
239239
envVarPathNew := StrReplace(envVarPathNewTemp3, targetDirToRemove4)
240-
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Path, %envVarPathNew%
240+
RegWrite, REG_EXPAND_SZ, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Path, %envVarPathNew%
241241
Sleep, 1000
242242
; Broadcast WM_SETTINGCHANGE message for the updated PATH to take effect
243243
EnvUpdate

0 commit comments

Comments
 (0)