本文介绍了在Inno Setup中使用RegQueryStringValue检索环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用RegQueryStringValue在安装过程中检索环境变量,
I am trying to retrieve an environment variable during installation using RegQueryStringValue,
我正在使用以下代码
[Setup] DefaultGroupName="{code:GetPath}" [Code] function GetPath(Value: String): String; var OrigPath: string; begin if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'GCC', OrigPath) then Result := OrigPath; end;但是安装程序在安装过程中给我一个错误,
But the installer gives me an error during installation,
有人可以告诉我为什么或可以代替我做什么吗?
Can someone tell me why or what I can use instead?
推荐答案对于此问题,您尝试使用DefaultGroupName而不是DefaultDirName来导致错误.
In the case of this question, you're trying to use DefaultGroupName instead of DefaultDirName which is causing the errors.
更多推荐
在Inno Setup中使用RegQueryStringValue检索环境变量
发布评论