I need a global string variable in Inno Setup, that is going to be initialized in [Code] section and used in [Run] section.
[Code]
[Run]
Is this possible?
You are probably looking for a scripted constant:
[Run] Filename: "{app}MyProg.exe"; Parameters: "{code:GetGlobalVariable}" [Code] var GlobalVariable: string; function GetGlobalVariable(Param: string): String; begin Result := GlobalVariable; end; function InitializeSetup(): Boolean; begin GlobalVariable := '/parameter'; Result := True; end;
For a more real-life example, see Use a part of a registry key/value in the Inno Setup script.
1.4m articles
1.4m replys
5 comments
57.0k users