Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function InitializeSetup: Boolean;
- var
- Params: string;
- begin
- // prepare Params variable for reusing
- Params := '/SAVEINF=opt.txt';
- // allow this setup to run if the expected parameter is specified; or, if it is not, allow to run it
- // when ShellExecute fails; it works like this - first evaluates the CmdLineParamExists function and
- // if that returns True, the second part of the statement (ShellExecute) won't run (evaluate); when
- // the parameter is not found, the CmdLineParamExists returns False and statement evaluation goes on,
- // ShellExecute attempts to run the setup and to the Result returns True (allow this instance to run)
- // when the function fails for some reason (the returned value <= 32); in other words, you will allow
- // this setup instance to run if executing of the new setup instance fails
- Result := CmdLineParamExists(Params) or (ShellExecute(0, '', ExpandConstant('{srcexe}'), Params, '', SW_SHOW) <= 32);
- end;
Advertisement
Add Comment
Please, Sign In to add comment