Have you tried calling WebUpdate1AppRestart(Sender: TObject; var Allow: Boolean); with Allow:= True? That's the event which replaces the exe file with the exe_NEW file in the temp folder.
Isn't that just the event that fires BEFORE the app restart is triggered? From my understanding of the documentation, all I should need to call is DoUpdate() or DoThreadedUpdate(). I am a little vague on why I would use one or the other, but neither work for me ;)
You're probably right. But I use the Wizard for my updates and don't know a lot about the internal workings of TWebUpdate.
Still not getting this.
INF FILE:
[update]
localversion=D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe
newversion=2.0.1.1
[files]
count=1
[file1]
url=C:\newapp\UpdateTest.new
[application]
appupdate=1
appname=UpdateTest.new
appcomps=UpdateTest.new
silentrestart=1
LOG FILE:
01-04-2021 02:54:46 : [968] Start update : Non threaded update --------------------------- (Status:0) (Error:0)
01-04-2021 02:54:46 : [966] OS version : Unknown (Status:0) (Error:0)
01-04-2021 02:54:46 : [967] IE version : (not found) (Status:0) (Error:0)
01-04-2021 02:54:46 : [969] Compiler : D10.1 Berlin (Status:0) (Error:0)
01-04-2021 02:54:46 : [970] Installed IDEs : (Status:0) (Error:0)
01-04-2021 02:54:46 : [963] Start WebUpdate process with version : 2.6.0.2 (Status:0) (Error:0)
01-04-2021 02:54:46 : [915] Download : C:\newapp\UpdateTest.inf (Status:3) (Error:0)
01-04-2021 02:54:46 : [926] Update control file found (Status:3) (Error:0)
01-04-2021 02:54:46 : [933] Version based update found (Status:3) (Error:0)
01-04-2021 02:54:46 : [979] Check versions (Status:3) (Error:0)
01-04-2021 02:54:46 : [944] Version check : Version compare of D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe:1.0.1.1 with 2.0.1.1:2.0.1.1 (Status:3) (Error:0)
01-04-2021 02:54:46 : [929] New version found : 2.0.1.1 (Status:5) (Error:0)
01-04-2021 02:54:46 : [943] Found file update instruction (Status:3) (Error:0)
01-04-2021 02:54:46 : [971] Processing file : C:\newapp\UpdateTest.new[,nv=,nd=,ns=0,nc=-1] (Status:0) (Error:0)
01-04-2021 02:54:46 : [979] Check versions (Status:3) (Error:0)
01-04-2021 02:54:46 : [915] Download : C:\newapp\UpdateTest.new (Status:3) (Error:0)
01-04-2021 02:54:46 : [962] Found application component : UpdateTest.new (Status:0) (Error:0)
01-04-2021 02:54:46 : [948] Finished processing update control file (Status:3) (Error:0)
01-04-2021 02:54:46 : [959] Restart app in directory : D:\Dropbox\Projects\UpdateTest\Win32\Release (Status:0) (Error:0)
01-04-2021 02:54:46 : [958] Spawn 17080 L D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.new " " "C:\Users\natel\AppData\Local\Temp\" UpdateTest.new (Status:0) (Error:0)
As stated in the documentation
"If no compression is wanted, the application filenames can be extended with _NEW suffix. After
download and application shutdown, the files will be renamed without their _NEW suffix, replacing
the existing older files."
So, I suppose here that UpdateTest.new is here this renamed EXE but in that case, its suffix should be exe._NEW
Ah that makes sense! Perhaps you could amend the documentation to say that the _NEW suffix is hard coded. I will try this and get back to you.
Many thanks!!
Nathan T. Wild
Senior Developer / Customer Support
Howell Data Systems Inc.
Office 905-761-1712 ext. 2503
Proudly serving great customers for 28 years!
Thanks you for your assistance so far. Still missing some key ingredient here?? As before, my app is presenting the UAC message and being closed properly, but the EXE is not being replaced or restarted.
INF File:
[update]
localversion=D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe
newversion=2.0.1.1
[files]
count=1
[file1]
url=C:\newapp\UpdateTest.exe_NEW
[application]
appupdate=1
appname=UpdateTest.exe_NEW
appcomps=UpdateTest.exe_NEW
silentrestart=1
Resulting Log file:
02-04-2021 14:30:33 : [968] Start update : Non threaded update --------------------------- (Status:0) (Error:0)
02-04-2021 14:30:33 : [966] OS version : Unknown (Status:0) (Error:0)
02-04-2021 14:30:33 : [967] IE version : (not found) (Status:0) (Error:0)
02-04-2021 14:30:33 : [969] Compiler : D10.1 Berlin (Status:0) (Error:0)
02-04-2021 14:30:33 : [970] Installed IDEs : (Status:0) (Error:0)
02-04-2021 14:30:33 : [963] Start WebUpdate process with version : 2.6.0.2 (Status:0) (Error:0)
02-04-2021 14:30:33 : [915] Download : C:\newapp\UpdateTest.inf (Status:3) (Error:0)
02-04-2021 14:30:33 : [926] Update control file found (Status:3) (Error:0)
02-04-2021 14:30:33 : [933] Version based update found (Status:3) (Error:0)
02-04-2021 14:30:33 : [979] Check versions (Status:3) (Error:0)
02-04-2021 14:30:33 : [944] Version check : Version compare of D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe:1.0.1.1 with 2.0.1.1:2.0.1.1 (Status:3) (Error:0)
02-04-2021 14:30:33 : [929] New version found : 2.0.1.1 (Status:5) (Error:0)
02-04-2021 14:30:33 : [943] Found file update instruction (Status:3) (Error:0)
02-04-2021 14:30:33 : [971] Processing file : C:\newapp\UpdateTest.exe_NEW[,nv=,nd=,ns=0,nc=-1] (Status:0) (Error:0)
02-04-2021 14:30:33 : [979] Check versions (Status:3) (Error:0)
02-04-2021 14:30:33 : [915] Download : C:\newapp\UpdateTest.exe_NEW (Status:3) (Error:0)
02-04-2021 14:30:33 : [962] Found application component : UpdateTest.exe_NEW (Status:0) (Error:0)
02-04-2021 14:30:33 : [948] Finished processing update control file (Status:3) (Error:0)
02-04-2021 14:30:33 : [959] Restart app in directory : D:\Dropbox\Projects\UpdateTest\Win32\Release (Status:0) (Error:0)
02-04-2021 14:30:33 : [958] Spawn 15828 L D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe_NEW " " "C:\Users\natel\AppData\Local\Temp\" UpdateTest.exe_NEW (Status:0) (Error:0)
Shouldn't appname in your [Application] section be:
appname=UpdateTest.exe
as UpdateTest.exe_NEW doesn't exist in your app's folder?
Correct
Thank you both. This appears to be what was causing my problem. For reference, in case anyone else stumbled on this thread in the future and has a similar problem here is the working INF file:
[update]
localversion=D:\Dropbox\Projects\UpdateTest\Win32\Release\UpdateTest.exe
newversion=2.0.1.1
[files]
count=1
[file1]
url=C:\newapp\UpdateTest.exe_NEW
[application]
appupdate=1
appname=UpdateTest.exe
appcomps=UpdateTest.exe_NEW
silentrestart=1