获取setup.exe文件的FileName

Bob*_*Bob 4 inno-setup

我如何获得安装文件本身的Exe-Name?

我想将exe文件名本身写入inno安装脚本中的变量.

Inno Setup版本5.5.3

Rob*_*beN 6

您可以从常量中提取设置exe名称,{srcexe}并将write作为自定义变量字符串.

例:

ExtractFileName(ExpandConstant('{srcexe}'))
Run Code Online (Sandbox Code Playgroud)

在代码中:

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

{} srcexe

The full pathname of the Setup program file, e.g. "C:\SETUP.EXE".
Run Code Online (Sandbox Code Playgroud)

有关更多信息Inno Setup's Constants