diff --git a/installer/install.iss b/installer/install.iss index 969fee6101..977738b2e8 100644 --- a/installer/install.iss +++ b/installer/install.iss @@ -1759,11 +1759,42 @@ end; procedure InstallAutoUpdater; var Res:Longint; - LogPath,ErrPath:String; + LogPath,ErrPath,AppPath,XMLPath,Start:String; begin + Start:=GetDateTimeString('yyyy-mm-dd','-',':')+'T'+GetDateTimeString('hh:nn:ss','-',':'); + XMLPath:=ExpandConstant('{tmp}\auto-updater.xml'); + AppPath:=ExpandConstant('{app}'); + SaveStringToFile(XMLPath, + ''+ + ''+ + ' '+ + ' IgnoreNew'+ + ' true'+ + ' true'+ + ' '+ + ' false'+ + ' false'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+Start+''+ + ' PT4H'+ + ' '+ + ' 1'+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' "'+AppPath+'\git-bash.exe"'+ + ' --hide --no-needs-console --command=cmd\git.exe update --gui'+ + ' '+ + ' '+ + '',False); 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 + if not Exec(ExpandConstant('{sys}\cmd.exe'),ExpandConstant('/C schtasks /Create /F /TN "Git for Windows Updater" /XML "'+XMLPath+'" >"'+LogPath+'" 2>"'+ErrPath+'"'),'',SW_HIDE,ewWaitUntilTerminated,Res) or (Res<>0) then LogError(ExpandConstant('Line {#__LINE__}: Unable to schedule the Git for Windows updater (output: '+ReadFileAsString(LogPath)+', errors: '+ReadFileAsString(ErrPath)+').')); end;