mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Only replace updater tool in temp directory if it has become outdated. Avoids annoyance for users which have whitelisted this .exe in their antivirus or whatever software.
This commit is contained in:
@ -252,7 +252,11 @@ begin
|
||||
Stream.WriteBuffer(ResPointer[0], SizeOfResource(HInstance, ResInfoblockHandle));
|
||||
Stream.Position := 0;
|
||||
UpdaterFilename := GetTempDir + AppName+'_updater.exe';
|
||||
Stream.SaveToFile(UpdaterFilename);
|
||||
if FileExists(UpdaterFilename) and (Stream.Size = _GetFileSize(UpdaterFilename)) then
|
||||
// Do not replace old updater if it's still valid. Avoids annoyance for cases in which
|
||||
// user has whitelisted this .exe in his antivirus or whatever software.
|
||||
else
|
||||
Stream.SaveToFile(UpdaterFilename);
|
||||
// Calling the script will now post a WM_CLOSE this running exe...
|
||||
ShellExec(UpdaterFilename, '', '"'+ParamStr(0)+'" "'+Download.Filename+'"');
|
||||
finally
|
||||
|
Reference in New Issue
Block a user