Permalink
Browse files

Use ExecAsOriginalUser to launch myprog.exe instead of Exec.

  • Loading branch information...
1 parent 6ebe106 commit 415dd1d1b502938c31624ded722efbd22c9d31db @martijnlaan martijnlaan committed Jan 12, 2013
Showing with 1 addition and 1 deletion.
  1. +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();

0 comments on commit 415dd1d

Please sign in to comment.