Search code examples
inno-setuppascalscript

Hardcode startup switches into INNO Setup script and retrieve them in [code] in InnoIDE


When I compile and then run my Inno script, I want to parse hard coded command line switches. So, instead of running my script as c:\myInstall.exe /myswitch I want to run it via IDE and have this switch included at the start here

enter image description here

With this code, I want to retrieve this switch in ParamStr(x)

function MyParams(param: String): string;
begin
  
  MsgBox(ParamStr(3), mbError, MB_OK);
  Result := MyParameter;
end;
  {Parameter Detection--end}

function InitializeSetup(): Boolean;
begin
  MyParams('XXX');
end; 

Solution

  • I found a tool, which does this for you - you can set DEBUG variables if you use Inno Script Studio

    enter image description here