program install directory and version - 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!

jtss
Posts: 15
Joined: Wed Nov 05, 2008 3:23 am

program install directory and version

how does another app check if my app is installed and what version is installed (and then be able to launch my app's exe)

I thought I could have them check HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{guid} but that isn't written consistently (I tried a Win7 and a Vista machine), plus when it was written it had the ProductCode guid (which changes per version) instead of the fixed UpgradeCode guid

More reliable seems to be HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\myapp.exe (default value)
which I write during setup.
so I added another Version value to write [ProductVersion]

now my partner's app can check that latter key for both the path and version (and implicitly, by its existence, if my app is even installed)

is that the best way to do it?
Where the heck is the info stored such that my app appears in the Windows Uninstall Programs list (and it does appear there)

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

Re: program install directory and version

Hi,
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{guid}
This is the correct location. Please note that this location can also be found under "Wow6432Node" on 64 bit machines.
All packages registered with Windows Installer have an entry in this location.

The following article from MSDN can give you more details.


Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jtss
Posts: 15
Joined: Wed Nov 05, 2008 3:23 am

Re: program install directory and version

right, i forgot about the Wow6432Node on x64 machine...
thanks, that explains why I didn't see it on one machine.

however, the guid being used in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{guid}
is the ProductCode (I change it with each version to allow upgrades), not the UpgradeCode (fixed)

which means that one would have to know the ProductCode for each version of my app, which doesn't make sense.
where is the UpgradeCode stored/used, and can't they key off of that?
Clearly windows installer is using it to find the previous installed version, but I don't see that guid in the registry!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: program install directory and version

Hello,
where is the UpgradeCode stored/used, and can't they key off of that?
Usually the upgrades codes can be found in this registry location:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes
Here is an example how to convert an upgrade code to the format used in the registry:

Code: Select all

{2E95A47D-0BC3-455B-925B-9CDA230AF218}
  • reverse first 8 chars D74A59E2
  • reverse next 4 chars 3CB0
  • reverse next 4 chars B554
  • reverse next 2 chars 29
  • reverse next 2 chars B5
  • reverse next 2 chars C9
  • reverse next 2 chars AD
  • reverse next 2 chars 32
  • reverse next 2 chars A0
  • reverse next 2 chars 2F
  • reverse next 2 chars 81
So in order to find the

Code: Select all

{2E95A47D-0BC3-455B-925B-9CDA230AF218}
upgrade code in the registry you must search for

Code: Select all

D74A59E23CB0B55429B5C9AD32A02F81
The recommended way when designing your package would be to install the information you need as custom registry entries. This way, any other packages that need the information can easily acquire it.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”