How to set DestDir to a vairable in Inno Setup ?

29 views
Skip to first unread message

Zhencheng Fu

unread,
Apr 23, 2024, 10:08:50 AMApr 23
to innosetup
Hello, I have to get my installation destination directory from Windows register. The result is saved in a vairaible in [Code] section. Then my question is how to use this variable as my DestDir in [Files] section?
For example, I wrote DestDir : {code: MyVariable} without success. Then writing a function like this:
function GetDestDir(): String;
begin
  Result := ExpandConstant(MyVariable);
end;

writing DestDir: {code: GetDestDir} is still unluck.

Any help are appreciated.

Gavin Lambert

unread,
Apr 29, 2024, 9:17:44 PMApr 29
to innosetup
See https://jrsoftware.org/ishelp/index.php?topic=scriptconstants.  The parameter declaration is required.
Reply all
Reply to author
Forward
0 new messages