What are ProductCode & UpgradeCode & GUID? How to detect if certain application/library is already i
- by claws
I've already gone through:
http://stackoverflow.com/questions/211192/check-if-the-application-is-already-installed
http://stackoverflow.com/questions/488717/detecting-if-a-program-is-already-installed-with-nsis
http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs
My questions are little more in depth and little more general.
So, as you understood my problem is that I want to check if "Certain
Applications" are already installed on the user's machine? I'm generating the installer using Advanced Installer.
First few questions:
What is Upgrade Code? Advanced installer has option, Product Version (identify by Upgrade Code)
What is Product Code? Advanced installer Product Version (identify by Product Code)
Component is installed : GUID. What is GUID?
All the above three has values like this:
{49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3} I don't know what these values are but it seems that computer is recognizing software using this kind of strange ID.
My required applications are
MySQL DBMS
MySQL .NET Connector
One fact that I discovered is Upgrade Code & Product Code can be extracted
from its "msi installer".
MySQL Server
Installer = mysql-5.1.43-win32.msi
Upgrade Code = {49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3}
Product Code = {0ECED7D8-FF53-4DC9-958E-C2177F528DE4}
GUID (for component Installed) = ????
Uninstall Path = HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0ECED7D8-FF53-4DC9-958E-C2177F528DE4}
Installer = mysql-5.1.46-win32.msi
Upgrade Code = {49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3}
Product Code = {EA8FDE5A-2B33-4EDD-B7E7-8D179DF731A5}
GUID (for component Installed) = ????
Uninstall Path = HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA8FDE5A-2B33-4EDD-B7E7-8D179DF731A5}
Installer = mysql-essential-5.1.46-win32.msi
Upgrade Code = {49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3}
Product Code = {AD33AF2C-6485-4106-B012-1D9CDC88A454}
GUID (for component Installed) = ????
Uninstall Path = HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AD33AF2C-6485-4106-B012-1D9CDC88A454}
Installer = mysql-essential-5.1.46-win32.msi
Upgrade Code = {49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3}
Product Code = {9A4DA7EF-A7B9-4282-90AD-10976AA24E69}
GUID (for component Installed) = ????
Uninstall Path = HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A4DA7EF-A7B9-4282-90AD-10976AA24E69}
Observation from above data:
UpgradeCode of a software is constant & is irrespective of its version.
ProductCode is version specific & it is used by the MSI internally which is actually reasonable because. MSI allows applications of different versions to be installed side by side.
I don't know how to find GUID.
MySQL ADO .NET Driver
Installer = mysql.data.5.2.5.msi
Upgrade Code = ---
Product Code = {5FD88490-011C-4DF1-B886-F298D955171B}
GUID (for component Installed) = ????
Installer = mysql.data.6.2.2.msi
Upgrade Code = ---
Product Code = {5FD88490-011C-4DF1-B886-F298D955171B}
GUID (for component Installed) = ????
UninstallPath =HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5FD88490-011C-4DF1-B886-F298D955171B}
Installer = mysql.data.6.2.3.msi
Upgrade Code = ---
Product Code = {5FD88490-011C-4DF1-B886-F298D955171B}
GUID (for component Installed) = ????
Observations from above data:
- surprisingly, it couldn't find UpgradeCode from installer of mysql.data.*.msi. I wonder why? This contradicts with my above observation.
- ProductCode for all different versions is same here. This again contradicts my above observations.
-I still don't know how to find GUID.
Now,
What exactly are these ProductCode & UpgradeCode & GUID.
Which denotes what?
Why are above observations contradicting?
I don't care about versions. I don't want to depend on Application Name then how do I check if MySQL driver & MySQL ADO .NET.
Does detection become simple if they are .NET assemblies? How to do then? I don't want to ship the assemblies with my deployed files.