我用InnoSetup设置环境变量在注册表中:
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "MY_PROGRAM_HOME_DIR"; ValueData: "{app}"
但系统无法看到这个变量,直到我打电话SendMessage
。
[Code]
procedure DeinitializeSetup();
begin
// HWND_BROADCAST = $FFFF
// WM_SETTINGCHANGE = $001A
SendMessage($FFFF, $001A, 0, Longint(PChar('Environment')));
end;
InnoSetup说:
...列60:类型不匹配
如何正确地强制转换PChar
为Longint
在InnoSetup脚本?