Using global string script variable in Run or other section in Inno Setup

user3027198

I need a global string variable in Inno Setup, that is going to be initialized in [Code] section and used in [Run] section.

Is this possible?

Martin Prikryl

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup: How to pass variable from [Code] to [Run] (or other section)

From Dev

Inno Setup: Install other installer and run it before continuing my install

From Dev

rpm & rpmbuild - using global environment variable in the %files section

From Dev

Using INI file to fill setup section values on inno setup

From Dev

Environment variable not recognized [not available] for [Run] programs in Inno Setup

From Dev

Inno Setup Code section create hidden file

From Dev

How to split a string in Inno Setup

From Dev

How to set a global environment variable from Inno Setup installer?

From Dev

Inno Setup [Code] section variable to [Registry]

From Dev

Inno Setup: How to run a code procedure in Run section or before Run section?

From Dev

Inno setup error handeling (ignore) in RUN Section commands

From Dev

Unable to Find String in a file and populate it using Inno Setup?

From Dev

How to run shell script which is stored in a String variable using Java?

From Dev

Inno Setup: How to manipulate progress bar on Run section?

From Dev

How to set registry key (environment variable) with value from [Code] section of Inno Setup?

From Dev

Convert Boolean to String with Inno Setup

From Dev

Inno Setup Section [Run] with condition

From Dev

Inno Setup: Execute a Pascal function in [Run] section

From Dev

Execute different command in Inno Setup Run section based on Windows version

From Dev

Inno Setup Check function for Dirs section

From Dev

Execute different BLOCK of commands in Inno Setup Run section based on Windows version

From Dev

Inno Setup: How to pass variable from [Code] to [Run] (or other section)

From Dev

Getting environment variable using Inno setup

From Dev

Using global instance of a class by another global variable in other file

From Dev

Inno Setup Run code according to setup type

From Dev

Using global string script variable in Run or other section in Inno Setup

From Dev

Create desktop link Icon after the Run section of Inno Setup

From Dev

Using a standard Inno Setup message in the Run entry description

From Dev

Bash run script from script using variable

Related Related

  1. 1

    Inno Setup: How to pass variable from [Code] to [Run] (or other section)

  2. 2

    Inno Setup: Install other installer and run it before continuing my install

  3. 3

    rpm & rpmbuild - using global environment variable in the %files section

  4. 4

    Using INI file to fill setup section values on inno setup

  5. 5

    Environment variable not recognized [not available] for [Run] programs in Inno Setup

  6. 6

    Inno Setup Code section create hidden file

  7. 7

    How to split a string in Inno Setup

  8. 8

    How to set a global environment variable from Inno Setup installer?

  9. 9

    Inno Setup [Code] section variable to [Registry]

  10. 10

    Inno Setup: How to run a code procedure in Run section or before Run section?

  11. 11

    Inno setup error handeling (ignore) in RUN Section commands

  12. 12

    Unable to Find String in a file and populate it using Inno Setup?

  13. 13

    How to run shell script which is stored in a String variable using Java?

  14. 14

    Inno Setup: How to manipulate progress bar on Run section?

  15. 15

    How to set registry key (environment variable) with value from [Code] section of Inno Setup?

  16. 16

    Convert Boolean to String with Inno Setup

  17. 17

    Inno Setup Section [Run] with condition

  18. 18

    Inno Setup: Execute a Pascal function in [Run] section

  19. 19

    Execute different command in Inno Setup Run section based on Windows version

  20. 20

    Inno Setup Check function for Dirs section

  21. 21

    Execute different BLOCK of commands in Inno Setup Run section based on Windows version

  22. 22

    Inno Setup: How to pass variable from [Code] to [Run] (or other section)

  23. 23

    Getting environment variable using Inno setup

  24. 24

    Using global instance of a class by another global variable in other file

  25. 25

    Inno Setup Run code according to setup type

  26. 26

    Using global string script variable in Run or other section in Inno Setup

  27. 27

    Create desktop link Icon after the Run section of Inno Setup

  28. 28

    Using a standard Inno Setup message in the Run entry description

  29. 29

    Bash run script from script using variable

HotTag

Archive