Wrong version of app after Updater restarts my app - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Daren
Posts: 6
Joined: Wed Mar 07, 2012 4:10 pm

Wrong version of app after Updater restarts my app

I am using the auto updater and have integrated it into my app. It appears to work but after the app restarts and I check the version of my app it shows the previous version. If I shut down and restart my app I then get the correct version. So here's the steps I take:

1. Open visual studio, increment the version of my app (I've hard coded the version so it would be in the dll)...
2. Build app with new version number...
3. Open Advanced Installer and increment the Product Version...
4. Build new MSI with advanced Installer...
5. Open my Updates Configuration project in Advanced Installer and create a new Updates Configuration file...
6. Move new Updates Configuration and MSI to proper places...
7. Start app, at which time I get notified there is a new update...
8. Take new update, which closes my app, installs new version, and then restarts the app

After all these steps, when the app starts and I go to look at the version it's not the updated version. But if I restart the app the new version shows. I'm not sure if I'm doing something wrong but it's like the Updater is starting some in-memory version of my app and requires a restart of the app to get right version. This would not be a good experience for our users and I would appreciate any help I could get, thanks.

Daren
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Wrong version of app after Updater restarts my app

Hi Daren,
and create a new Updates Configuration file...
Please note that a single updates configuration file should be used for all updates. It is incorrect to have individual files for each update you release.

Regarding the version problem. The updater does not keep cached anything about your application. It just launches it from the specified path. So you need to make sure the files from the previous version are completely removed, especially if you are using different install paths, and that the process launched by the updater if using the new executable, for that you could user Process Explorer tool from Microsoft, its free.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daren
Posts: 6
Joined: Wed Mar 07, 2012 4:10 pm

Re: Wrong version of app after Updater restarts my app

Thanks for the reply,

I am actually using only one Updates Configuration file and project, just re-compiling it each time we have a new update.

I actually figured out the issue. The issue was that in the code I was using the Process.WaitForExit on the Updater (so that my code wouldn't proceed until the Updater process had closed) and so the Updater would not close down my app. I'm not sure if it was because of the WaitForExit or the fact that this code ran before my app actually started (we wanted to display the update dialog before the app started). But the way I fixed it was to create a separate exe that runs the Updater and starts my app when the the update portion is done and everything works how it should.

Daren

Return to “Common Problems”