Skip to content

Commit

Permalink
installer: do report problems when (de-)registering the autoupdater
Browse files Browse the repository at this point in the history
Previously, we told the user to look in a file in the temporary
directory. This temporary directory is gone as soon as the installer is
done, though.

Much better to report the errors, and log them at the same time if a log
file was specified.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Oct 26, 2017
1 parent c5f98e0 commit 0b6c267
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ begin
LogPath:=ExpandConstant('{tmp}\remove-autoupdate.log');
ErrPath:=ExpandConstant('{tmp}\remove-autoupdate.err');
if not Exec(ExpandConstant('{sys}\cmd.exe'),ExpandConstant('/C schtasks /Create /F /SC DAILY /TN "Git for Windows Updater" /TR "'+#39+'{app}\git-bash.exe'+#39+' --hide --no-needs-console --command=cmd\git.exe update --gui" >"'+LogPath+'" 2>"'+ErrPath+'"'),'',SW_HIDE,ewWaitUntilTerminated,Res) or (Res<>0) then
LogError(ExpandConstant('Line {#__LINE__}: Unable to schedule the Git for Windows updater (see "'+LogPath+'" and "'+ErrPath+'").'));
LogError(ExpandConstant('Line {#__LINE__}: Unable to schedule the Git for Windows updater (output: '+ReadFileAsString(LogPath)+', errors: '+ReadFileAsString(ErrPath)+').'));
end;
procedure UninstallAutoUpdater;
Expand All @@ -1775,7 +1775,7 @@ begin
LogPath:=ExpandConstant('{tmp}\remove-autoupdate.log');
ErrPath:=ExpandConstant('{tmp}\remove-autoupdate.err');
if not Exec(ExpandConstant('{sys}\cmd.exe'),ExpandConstant('/C schtasks /Delete /F /TN "Git for Windows Updater" >"'+LogPath+'" 2>"'+ErrPath+'"'),'',SW_HIDE,ewWaitUntilTerminated,Res) or (Res<>0) then
LogError(ExpandConstant('Line {#__LINE__}: Unable to remove the Git for Windows updater (see "'+LogPath+'" and "'+ErrPath+'").'));
LogError(ExpandConstant('Line {#__LINE__}: Unable to remove the Git for Windows updater (output: '+ReadFileAsString(LogPath)+', errors: '+ReadFileAsString(ErrPath)+').'));
end;
procedure CurStepChanged(CurStep:TSetupStep);
Expand Down

0 comments on commit 0b6c267

Please sign in to comment.