upgrade query

Apr 2, 2011
1,553
13
55
North Carolina, USA
I use the following code snippet to check for a TCMD update.
Code:
rem COMMENT

        rem Check for TCMD / TCC updates......

        set nDays=%@iniread[%@path[%ComSpec%]updater.ini,General,CheckFrequency]

        rem check for %nDays not existing in registry, for example first run
        rem end ....

        set nToday=%@date[%_date]

        IF NOT DEFINED nLastCheck set nLastCheck=0

        IFF %@eval[%nToday - %nLastCheck] GE %nDays THEN

            :: If more days has passed since last check was done then check for updates

          start /pgm "%@path[%ComSpec%]updater.exe" /checknow

            set /u nLastCheck=%nToday

        ENDIFF

rem ENDCOMMENT

I am not sure if it's possible, but I'd like to have the updated installer EXE go to %userprofile\Downloads\ - just to save time if a reinstall is necessary...
 
I have an alias that returns the date of a file on the web;
Code:
e:\utils>which last-modified
last-modified is an alias : *pshell /s "$http = [System.Net.WebRequest]::Create('%1'); $http.Method = 'HEAD'; $http.GetResponse().LastModified.ToString()"
I can then do;
Code:
e:\utils>last-modified https://jpsoft.com/downloads/v28/tcmd.exe
2021-11-21 3:18:22 PM
...to determine if I have to run
Code:
option /u
...to update my copy of Take Command.

I can also download the file to the folder of my choice;
Code:
e:\utils>copy /b /g https://jpsoft.com/downloads/v28/tcmd.exe r:\tcmd.exe
https://jpsoft.com/downloads/v28/tcmd.exe => R:\tcmd.exe

     1 file copied

Joe
 
May 20, 2008
11,867
121
Syracuse, NY, USA
Do you know where the downloaded file goes? As far as I can tell, it's deleted after the update. What you want to do may be impossible.

Is the download time long?
 
May 20, 2008
11,867
121
Syracuse, NY, USA
Another approach would be this. Make a scheduled task that runs a BTM. The BTM would download the file (or check the file timestamp), as often as you see fit. Compare the file (or timestamp) to the last one. If it's new, send yourself a TOAST and, if you're only looking at the timestamp, download the file.

If that all worked well, you'd never have to run UPDATER.EXE and you wouldn't be aware of any delays.
 

Similar threads