LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application Auto Updater

Solved!
Go to solution

First of all you need to REVERSE UpgradeCode as described here.

 

e.g. for {D0F23C3F-CA74-460F-9ADB-49CBD57F9688}

1. Reverse first 8 characters F3C32F0D
2. Reverse next 4 characters 47AC
3. Reverse next 4 characters F064
4. Reverse next 2 characters A9
5. Reverse next 2 characters BD
6. Reverse next 2 characters 94
7. Reverse next 2 characters BC
8. Reverse next 2 characters 5D
9. Reverse next 2 characters F7
10. Reverse next 2 characters 69
11. Reverse next 2 characters 88

thus {D0F23C3F-CA74-460F-9ADB-49CBD57F9688}
becomes F3C32F0D47ACF064A9BD94BC5DF76988

 

Then you need to find REVERSED version under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\

uc01.png

The NAME of the first key in this section is the REVERSED version of the Product ID of your current installation. It's like a "symlink".

When you rebuild the installer and reinstall your software, the ProductID will change and this link will be updated.

Of course, this is true as long as you don't change the UpgradeCode in the NI installer options.

uc02.png

You then need to convert the REVERSED version of the ProductID back to the "normal" and navigate to HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ where you can find the current version of the installed software.

 

I am using LabVIEW 20.0f1 32bit

Message 11 of 15
(1,152 Views)
Solution
Accepted by Furbs

Unfortunately, I cannot open the 2021 version.

Try the attached code.

Tested on LV2020 32bit and Win10 x64.

Is your LabVIEW 2021 32-bit or 64-bit?

Message 12 of 15
(1,138 Views)

This worked like a champ! Thank you so much, I would have never figured this out without you spelling out the reverse ID trick. 

 

I've exported the full library to v20 for you. Let me know if you run into any issues. Just drop the Run.VI into your program and it'll prompt the user for an update if it should and then close labview and update. 

0 Kudos
Message 13 of 15
(1,123 Views)

Small suggestions for your code.


1. Actually you don't need to specify the UpgradeCode manually. You can automatically determine it from updateInfo.xml and pass it to GetCurrent-REG-Version.vi.

 

2. You don't have to iterate through all products in the Distribution to find the UpgradeCode and Version in GetServer-XML-Version.vi

Just take the last element of the Nodes array. As described in this article: "The last product listed is always your installer with the product version and the upgrade code."

 

More simplified version in attachment.

 

PS: You can publish your library in the Example Programs section. I think it can be useful for the Community.

Message 14 of 15
(1,101 Views)

I saw that it should always be the last one but then it came down to "Do I trust them to keep that rule?" and "Does it hurt to loop?". Seemed like a more sure fire solution to just look for it, but then you have to hard code the Update Code. Now that you've brought that up, I agree, I should just rely on the last one so you don't have to feed the program anything but the server location of the update. 

0 Kudos
Message 15 of 15
(1,090 Views)