Updatecheck: Find a batchfile-solution to replace the running exe with a downloaded build.

TODO: find some sleep command for the batch file, as we sometimes get "access denied" while trying to overwrite the just terminated exe. Seems like taskkill doesn't close all handles itself.
This commit is contained in:
Ansgar Becker
2008-02-23 00:54:02 +00:00
parent 700ac08264
commit 9f23a9b313
7 changed files with 204 additions and 17 deletions

View File

@ -85,6 +85,7 @@ type
function TColorToHex( Color : TColor ): string;
function GetVTCaptions( VT: TVirtualStringTree; OnlySelected: Boolean = False; Column: Integer = 0 ): TStringList;
function Pos2(const Needle, HayStack: string; const StartPos: Integer) : Integer;
function GetTempDir: String;
procedure ExtractUpdater;
procedure UpdateItWith(const _file: String);
@ -2138,6 +2139,15 @@ begin
end;
function GetTempDir: String;
var
TempPath: array[0..MAX_PATH] of Char;
begin
GetTempPath(MAX_PATH, @TempPath);
Result := StrPas(TempPath);
end;
{**
Extract the updater from resource.