Bob
Bob

Reputation: 177

Get FileName of setup.exe File

how do i get the Exe-Name of the setup file itself?

I want to get the exe filename itself written to a variable in the inno setup script.

Inno Setup version 5.5.3

Upvotes: 6

Views: 2718

Answers (1)

RobeN
RobeN

Reputation: 5456

You can extract your setup exe name from constant {srcexe} and write is as custom Variable String.

Example:

ExtractFileName(ExpandConstant('{srcexe}'))

In Code:

   [Code]
    function InitializeSetup: Boolean;
    var
    SetupName : String;
    begin
      SetupName := ExtractFileName(ExpandConstant('{srcexe}')); 
        MsgBox(SetupName, mbInformation, MB_OK);
        Result := False;
    end;

{srcexe}

The full pathname of the Setup program file, e.g. "C:\SETUP.EXE".

More info about Inno Setup's Constants

Upvotes: 8

Related Questions