在Inno Setup中使用RegQueryStringValue检索环境变量

编程入门 行业动态 更新时间:2024-10-27 13:26:50
本文介绍了在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检索环境变量

本文发布于:2023-11-13 09:33:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584016.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境变量   Inno   Setup   RegQueryStringValue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!