diff --git a/main.pas b/main.pas index 1c048f3..7062834 100644 --- a/main.pas +++ b/main.pas @@ -7587,13 +7587,13 @@ resourcestring const UPDATE_BATCH_FILE = 'hfs.update.bat'; UPDATE_BATCH = 'START %0:s /WAIT "%1:s" -q'+CRLF - +'ping 127.0.0.1 -n 3 -w 1000> nul'+CRLF - +'DEL "%3:s'+PREVIOUS_VERSION+'"'+CRLF - +'%2:sMOVE "%1:s" "%3:s'+PREVIOUS_VERSION+'"'+CRLF - +'DEL "%1:s"'+CRLF - +'MOVE "%4:s" "%1:s"'+CRLF + +'ping 127.0.0.1 -n 3 -w 1000> nul'+CRLF // wait + +'DEL "%3:s'+PREVIOUS_VERSION+'"'+CRLF // previous backup + +'%2:sMOVE "%1:s" "%3:s'+PREVIOUS_VERSION+'"'+CRLF // new backup + +'DEL "%1:s"'+CRLF // too zealous? + +'MOVE "%4:s" "%1:s"'+CRLF // new becomes current +'START %0:s "%1:s"'+CRLF - +'DEL %%0'+CRLF; + +'DEL %%0'+CRLF; // remove self var size: integer; fn: string; diff --git a/todo.txt b/todo.txt index 4ca1060..292290d 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ +- update doesn't work without 'only 1 instance' (it's the -q) + replace shellExtDlg.gif with transparent png (english system) + expiring links * dismiss regexp lib http://docwiki.embarcadero.com/Libraries/Rio/en/System.RegularExpressions.TRegEx diff --git a/utillib.pas b/utillib.pas index 69d855e..c7e0a88 100644 --- a/utillib.pas +++ b/utillib.pas @@ -1212,14 +1212,8 @@ end; // exec but does not wait for the process to end function execNew(cmd:string):boolean; -var - si: TStartupInfo; - pi: TProcessInformation; begin -fillchar(si, sizeOf(si), 0); -fillchar(pi, sizeOf(pi), 0); -si.cb:=sizeOf(si); -result:=createProcess(NIL,pchar(cmd),NIL,NIL,FALSE,0,NIL,NIL,si,pi) +result:=32 < ShellExecute(0, nil, 'cmd.exe', pchar('/C '+cmd), nil, SW_SHOW); end; // execNew function addArray(var dst:TstringDynArray; src:array of string; where:integer=-1; srcOfs:integer=0; srcLn:integer=-1):integer;