flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

When checking for updates installer tries to update latest version

Mon Jul 29, 2019 7:58 pm

I have the latest version running of my app. I have a menu option that check for updates by using the build in updater. My code looks like this:

Code: Select all

            try
            {
                string updaterPath = Directory.GetCurrentDirectory() + @"\updater.exe";
                Log.Information("Updater path set to: {0}", updaterPath);
                Process.Start(updaterPath, " /checknow");
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                Log.Error(ex.StackTrace);
            }
What happens is the updater downloads and executes rather than seeing that the current running version matches the latest version on the site. The updater pops up with the modify/repair/remove because it detects after it runs that the versions match. The behavior I am expecting is updater.exe checks the installer.txt file on the site and determines that I already have the latest version installed. Once it determines that it then gives a message that I am already running the latest version.

My installer.txt looks like this:

Code: Select all

;aiu;

[ThermalVision]
Name = Thermal Vision
ProductVersion = 1.1.7149.19169
URL = http://EngNAS/ThermalVision/ThermalVision.exe
Size = 28559237
MD5 = 224623e5044c6d5bcc9f7db54fb061a2
ServerFileName = ThermalVision.exe
RegistryKey = HKUD\Software\Sharpline Converting, Inc.\Thermal Vision\Version
Version = 1.1.7149.17876
Enhancement = Added improved updating capability.
Do I have a setting wrong?

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: When checking for updates installer tries to update latest version

Wed Jul 31, 2019 9:41 am

Hi,

This most likely happens if the detection criteria set in the "Update Installed Detection" tab of the "Updates Configuration" project is not set correct.

In your "installer.txt" file I see that the "ProductVersion" attribute has a different value than the "Version" one. Also, you changed only the fourth field of the Product Version which is not recommended because Windows Installer ignores that field.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

Re: When checking for updates installer tries to update latest version

Wed Jul 31, 2019 2:15 pm

Yep. I did not have the correct expected version set. Thanks for that.

Regarding the fourth field of product version. I am trying to use auto increment for version numbers rather than manage them manually. I have this is my assemblyVersion.cs:

Code: Select all

[assembly: AssemblyVersion("1.1.*")]
It looks like the third field increments on a daily basis, the fourth is some kind of calculation based off the time of day. If I have a bug and then fix the bug same day then the versions will be:

Pre bug: 1.1.7528.12345
Post bug: 1.1.7528.14567

So windows installer wont recognize that?
Is there a way to autoincrement versions and be able to have two versions from the same day recognized?

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: When checking for updates installer tries to update latest version

Thu Aug 01, 2019 9:06 am

Hi,

I'm glad you found the detection problem.

In order to upgrade your product when only the fourth version was changed, you need to implement the solution described in the "How do I remove the old version when using the fourth field of the Product Version" FAQ.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”