LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read installer version number programmatically?

I need to read the installer version number (not the exe version number) programmatically.  Is there any way?

 

I have a bundled software which has multiple EXE's under one installer.  Commonly I use the installer version number for reference and want to show it up to the user.  Is there any way to get the installer's version number instead of executable's version number?

 

--Ajay.

--
Ajay MV


0 Kudos
Message 1 of 9
(4,278 Views)

Probably not easily....if you think about your executable, you build it *before* you build your installer - so when you change your installer, nothing changes in the executable and the installer just packages up the components you specify. The executable has no knowledge of its installer (or that it was was even 'installed' rather than just distributed.

 

Here are a couple of options:

- You might be able to read the installer version from the registry to find it in the add/remove programs: http://stackoverflow.com/a/13526002

- Use a pre/post build step to write the version number somewhere and include it in the installer which you can read

- Sync your executable and installer version number (e.g. the Deploy toolkit does this for you but you could do it manually using scripting in a pre-build VI)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 9
(4,251 Views)

Sam_Sharp,

 

Thanks for your response.


@Sam_Sharp wrote:

Probably not easily....if you think about your executable, you build it *before* you build your installer - so when you change your installer, nothing changes in the executable and the installer just packages up the components you specify. The executable has no knowledge of its installer (or that it was was even 'installed' rather than just distributed.

 

Here are a couple of options:

- You might be able to read the installer version from the registry to find it in the add/remove programs: http://stackoverflow.com/a/13526002

- Use a pre/post build step to write the version number somewhere and include it in the installer which you can read

- Sync your executable and installer version number (e.g. the Deploy toolkit does this for you but you could do it manually using scripting in a pre-build VI)


 

I felt the first option of reading from registry is better option than other two.  Reason is that, I want to make use of the auto increment in build specification.  Unfortunately, I don't see my installed software listed under the registry key

 

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

 

I'm thinking about third option of using deploy toolking and using some script in pre-build VI to copy the executable version into installer version.  I'm hearing this deploy toolkit first time.  Can you give me some details?

--

Thanks,

Ajay.

--
Ajay MV


0 Kudos
Message 3 of 9
(4,231 Views)

I had a look on my machine for an application I had installed and it was just in a different location (I think because of 32/63-bit OS differences):

 

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{APP_GUID}_is1

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 9
(4,220 Views)

That cool you found it out Smiley Very Happy.  Alas...!  How would I identify my application's {APP_GUID}?  It seems to be random hex value.  Does it get generated when I build?  Is that a fixed value?

 

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{ADD5B514-87EE-4A12-9B60-1A6F7294D074}

--
Ajay MV


0 Kudos
Message 6 of 9
(4,211 Views)

It's probably the same value that you find in the installer build specification. This is randomly generated when creating the build specification but then remains fixed (e.g. so it can identify an upgrade versus fresh install):

 

2016-01-20_15-59-50.png


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 9
(4,195 Views)

The GUID is fixet for a Build spec for an installer.

When you make a new Build spec for installer, the GUID is generated.

You can find the GUID under Version Information in the Build spec. There you can also generate a new.

 

0 Kudos
Message 8 of 9
(4,191 Views)

Hi Sam_Sharp,

 

I guess there is difficulty in readign the installer version from registry key from GUID.  After I have uninstalled the version 1.0.16 and installed version 1.0.17 I see key as "UpgradeCode".  In the below picture you can see that registry key folder has different GUID which links to the Upgrade Code field of the folder which has the actual GUID shown in LabVIEW Build spec.

 

Read Installer Version from Registry (Upgrade Code) issue.png

 

What I see in LabVIEW Build spec is unver version information is {627F1858-2299-4983-B0DD-C80A3887FD67} but not the key name {9D8CDDE3-3404-4CD0-82E0-B81BD1EC393B}

 

Also, the key name is located in different location of registry as below

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\National Instruments\Common\Installer\Dependencies\{9D8CDDE3-3404-4CD0-82E0-B81BD1EC393B}

--
Ajay MV


0 Kudos
Message 9 of 9
(4,074 Views)