Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

upgrade query

Apr
1,794
15
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
 
Thank you @Joe Caverly but I like the way I do it. Just trying to figure out how to copy the updated TCMD.EXE installer to the downloads folder...
 
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?
 
@rconn what happens to the updated installer EXE after the update is installed? Is it deleted? Or is it in %TMP% or %TEMP%?
 
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

Back
Top