Răsfoiți Sursa

Use ExecAsOriginalUser to launch myprog.exe instead of Exec.

Martijn Laan 12 ani în urmă
părinte
comite
415dd1d1b5
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      Examples/CodeExample1.iss

+ 1 - 1
Examples/CodeExample1.iss

@@ -70,7 +70,7 @@ begin
       begin
         if MsgBox('NextButtonClick:' #13#13 'Using the script, files can be extracted before the installation starts. For example we could extract ''MyProg.exe'' now and run it.' #13#13 'Do you want to do this?', mbConfirmation, MB_YESNO) = idYes then begin
           ExtractTemporaryFile('myprog.exe');
-          if not Exec(ExpandConstant('{tmp}\myprog.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then
+          if not ExecAsOriginalUser(ExpandConstant('{tmp}\myprog.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then
             MsgBox('NextButtonClick:' #13#13 'The file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK);
         end;
         BringToFrontAndRestore();