使用Inno设置获取环境变量 [英] Getting environment variable using Inno setup

查看:171
本文介绍了使用Inno设置获取环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件的更新版本,需要提供给用户,

I have an update version of a file that I need to provide to the user,

我让用户可以选择在任何需要的地方安装原始软件,

I have given the user the choice to install the original software wherever they want,

所以现在要进行更新,我需要PATH系统变量来知道他们在何处安装了软件,

So now to do the update I need the PATH system variable to know where they installed the software,

我有以下代码:

[Setup]
#define path GetEnv('TEMPFILE')
DefaultGroupName={#path}

[Files]
Source: "E:\folder \license.exe"; DestDir: "{app}\temp\installation_files\"; Flags: ignoreversion

但是代码在安装过程中给了我一个错误!

But the code gives me an error during installation!

有人知道为什么吗?

也许我可以做不同的事情,

Maybe i can do this differently,

有人可以向我解释此功能的作用吗?

Can someone explain to me hoe this function works:

function GetEnv(const EnvVar: String): String;

推荐答案

对我有用的解决方案可以在以下链接中找到:

The solution that worked for me can be found in the following link:

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

这篇关于使用Inno设置获取环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆