Getting environment variable using Inno setup

2019-09-20 16:23发布

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,

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

I have the following code:

[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!

Does someone know why?

Maybe i can do this differently,

Can someone explain to me hoe this function works:

function GetEnv(const EnvVar: String): String;

标签: inno-setup
1条回答
对你真心纯属浪费
2楼-- · 2019-09-20 16:39

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

Retrieve environment variable using RegQueryStringValue in Inno Setup

查看更多
登录 后发表回答