tomg
Posts: 7
Joined: Wed Feb 10, 2010 8:29 pm

How to stop running process during updater update

Hello,

I've got the updater working for our application, but have one issue left (hopefully).
When updates are found, the updater finds the current running process and
prompts to terminate the process. 'Yes' needs to be selected for the new
installation to work.

Unfortunately, this leads to a disturbing message:
XXXX MFC Application has stopped working
Windows can check for a solution to the problem.
-> Check online for a solution and close the program
-> Close the program

Then an installer message appears that states:
"The setup was unable to automatically close all requested
applications. Please ensure that the applications holding files in
use are closed before continuing with the installation"

Then one that states:
"The setup must update files or services that cannot be
updated while the system is running. If you choose to
continue, a reboot will be required to complete the
setup."

Since the application that is running is the one that launched the updater,
is there anyway to determine that updates are available ... and ... if so ...
exit the running process gracefully, so it does not have to be killed by the
updater?

If so, this would, I think, fix the 'stopped working' message above.

Thanks
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to stop running process during updater update

Hello,

You can use the /justcheck option to check for updates, then get the return code. If updates exist, launch the updater again to install the updates and then exit.
For more information, please consult our page on command line for the Advanced Updater.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
tomg
Posts: 7
Joined: Wed Feb 10, 2010 8:29 pm

Re: How to stop running process during updater update

/justcheck always returns 0 ... both programmatically and from the command line.
I can run /checknow ... and /checknow sees the updates.
Is there anyway to add a flag similar to -nofreqcheck to it?
I suspect that the frequency of checking might be the issue.
I've tried to set my clock ahead, delete the cached .aiu file etc. ... couldn't get it to return
anything but zero.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to stop running process during updater update

Hello,

As specified on the page from my previous post, a 0 return code means updates found.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
tomg
Posts: 7
Joined: Wed Feb 10, 2010 8:29 pm

Re: How to stop running process during updater update

Yes. Thanks. I was incorrectly checking my return code. It does work as you say.

I can now tell when there are updates available.

However, I have an additional question.

In the case where the user clicks 'Cancel' instead of 'Next' to download the new updates,
Is there anyway of knowing what the user selects?

What is happening now is that the application that called the updater is exiting when the
return code is '0' ... but if the user decides not to download the updates (i.e. clicks 'Cancel'), the process
has exited and the application won't start again until a reboot occurs.

Is there a possible solution that would allow me to know when a user has chosen click 'Next'
and therefore has chosen to download the updates and that it is safe to exit?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to stop running process during updater update

Hello,

You can again run the updater to see if updates are still available. If they are not then you can safely assume the user clicked next and installed the updates.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
lijun
Posts: 2
Joined: Wed Sep 15, 2010 7:52 pm

Re: How to stop running process during updater update

Hi,

I have the similar problem.
The /checknow works and pops up the download page tell user the update is available.
The difference is: the /justcheck paramter allways return nothing(not return 0 or anything eles) nomater in command line or in my program.

something wrong? or the .ini file configuration is incorrect?

thanks for your help.

Li
lijun
Posts: 2
Joined: Wed Sep 15, 2010 7:52 pm

Re: How to stop running process during updater update

One more comment is: when I call /justcheck or /checknow in command line, it do downloads the .aiu file to C:\Users\Administrator\AppData\Roaming\.......\xxx.aiu.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: How to stop running process during updater update

Hello,
The difference is: the /justcheck paramter allways return nothing(not return 0 or anything eles) nomater in command line or in my program.
How are you checking for the return code?

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”