开发者

Installing file to location based on function call

开发者 https://www.devze.com 2023-01-12 04:35 出处:网络
I am building an Inno Setup script and have libraries that need to be installed to locations that are determined at install (i.e. Java_Home/bin). Is there a way to a开发者_运维问答ccomplish this by ch

I am building an Inno Setup script and have libraries that need to be installed to locations that are determined at install (i.e. Java_Home/bin). Is there a way to a开发者_运维问答ccomplish this by changing the DestDir's value for a file or is there a better way?


With a little bit of Googling, it turns out that the answer was right there.

Create a function in the code section, set the DestDir to {code:FUNCTIONNAME}

So in my particular case:

[Files]
Source: "libs\native-lib.dll"; DestDir: {code:GetJavaBin};

[Code]
function GetJavaBin(S: String): String;
begin
    Result :=JavaHome + '\bin';
end;
0

精彩评论

暂无评论...
验证码 换一张
取 消