您可以从常量中提取设置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
Run Code Online (Sandbox Code Playgroud)The full pathname of the Setup program file, e.g. "C:\SETUP.EXE".
有关更多信息Inno Setup's Constants