TLama

Untitled

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