Page 1 of 1
Guidance on doing one's own updates checking
Posted: Tue Nov 19, 2013 12:15 pm
by JohnO
We want to implement a check-for-updates at the start of our application, since this is not one of the default modes of IA. The easiest way would be to issue the same command as the Update shortcut. Unfortunately, this throws up the UAC prompt that asks if Windows can be updated, which is not what the user really wants to see when starting up an app.
Question: is there a way to delay the UAC prompt until it has been established that there is an update available, and the user has said OK to install it?
That seems to me to be the correct point for the UAC prompt anyway.
Regards, John
Re: Guidance on doing one's own updates checking
Posted: Wed Nov 20, 2013 11:10 am
by FrancescoT
Dear John,
it is not possible to change the UAC functionality, with the exception of those few settings available with the most recent Win OSes.
In your case, the UAC prompt is triggered by execution of the Setup package with the Update shortcut and very probably, because the setup package itself requires to be elevated in order to run (this depends on the project settings you specified with the "Requested Elevation level" under the "Summary, UAC, and ISO" page in IA IDE).
Unfortunately you must keep this UAC elevation setting with your package, otherwise it will be not able to complete the update process.
Probably it could be possible to skip the UAC prompt, with releasing two different packages to handle your update process.
The first should verify if an update is available (... built using the lowest UAC setting) and then, the same package should execute a second package that effectively run the update requested ( ... of course this last one must be elevated).
It is a bit tricky and honestly, I never tried a similar approach ... but theoretically it might work.
Hope this helps you.
Regards
Re: Guidance on doing one's own updates checking
Posted: Wed Nov 20, 2013 11:24 am
by JohnO
Dear Francesco
I feared this might be the case. It makes sense that it is the launching of setup.exe itself that triggers the UAC prompt.
I have been investigating how the 'updates' script works (or doesn't! - see my other entry today). I have been inserting lots of MessageBoxes into the script to track progress and see values.
What I can't figure out, is how to run as if the Update shortcut had been clicked, in debug mode. From other forum comments I think it is possible. If so, what is the secret?
Regards, John
Re: Guidance on doing one's own updates checking
Posted: Fri Nov 22, 2013 2:03 pm
by FrancescoT
Dear John,
you can simulate the Update shortcut click, with forcing the COMMANDLINE pre-defined variable evaluation.
This is coded as follow within the "update" script ( ... line 14 - if the script has not been modified)
Code: Select all
Set Variable COMMANDLINE to $CMDLINE$
if Variable COMMANDLINE not Contains /update
Set Variable UPDATE_SCHEDULE to FALSE
if Variable MAINTENANCE Equals FALSE
Set Variable UPDATE_SCHEDULE to TRUE
end
...
...
In this way you should be able to debug the script.
Regards
Re: Guidance on doing one's own updates checking
Posted: Mon Nov 25, 2013 3:12 pm
by JohnO
Dear Francesco
The code extract that you show matches what is at the start of my 'updates' script. What I can't work out is what I have to change to simulate clicking the Update shortcut.
Regards, John