I've installed IronRuby and the screenshot shows the registry items I can find for its installation. I've tried using both GUIDs in this MSIcode:
Get Installed State for B266272609822BF43BB0D92938453997 into Variable I
MessageBox: IronRuby installed?, $I$
In both cases I get back the value FALSE. Has anybody tried to discover an installed product using its GUID? The reason I want to do it is to avoid installing some Ruby script files on the target machine unless IronRuby is installed.
How to determine if a product is intalled.
How to determine if a product is intalled.
- Attachments
-
- Screenshot.jpg (214.42 KiB) Viewed 3259 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
Re: How to determine if a product is intalled.
Aha! I think I cracked it. Firstly, if you don't know the product code then it looks like the Installer section in the registry is the place to go to. However, the product GUID is mangled for some reason. I've confirmed this on XP and Win7. Here's my example. Using IronRuby as the product code I'm after, the GUID in the registry in my earlier screenshot is:
9664C0C413048C34EB6A5378914D84AC
Do this: Reverse the first eight bytes. Reverse the next four bytes. Then reverse the next four bytes. Finally, swap the bytes in each of the remaining eight pairs of two bytes. So, unmangling:
9664C0C4 1304 8C34 EB 6A 53 78 91 4D 84 AC
produces:
4C0C4669 4031 43C8 BE A6 35 87 19 D4 48 CA
Then convert the unmangled GUID into a conventional delimited GUID: {4C0C4669-4031-43C8-BEA6-358719D448CA}. Put this reassembled GUID as the parameter into:
Get Installed State for {4C0C4669-4031-43C8-BEA6-358719D448CA} into Variable I
and it then returns true! I've tried this on a couple of other products I've got installed and it seems to hold true universally. If that's 100% correct then you can determine if something is installed using the plugin rather than drilling into the registry. From what I understand, there are differences in the names of registry items on 64-bit OS'? I'll let someone else comment on that as I don't have access to 64-bit at this moment.
Does anyone know why the product GUIDs are mangled the way they are?
9664C0C413048C34EB6A5378914D84AC
Do this: Reverse the first eight bytes. Reverse the next four bytes. Then reverse the next four bytes. Finally, swap the bytes in each of the remaining eight pairs of two bytes. So, unmangling:
9664C0C4 1304 8C34 EB 6A 53 78 91 4D 84 AC
produces:
4C0C4669 4031 43C8 BE A6 35 87 19 D4 48 CA
Then convert the unmangled GUID into a conventional delimited GUID: {4C0C4669-4031-43C8-BEA6-358719D448CA}. Put this reassembled GUID as the parameter into:
Get Installed State for {4C0C4669-4031-43C8-BEA6-358719D448CA} into Variable I
and it then returns true! I've tried this on a couple of other products I've got installed and it seems to hold true universally. If that's 100% correct then you can determine if something is installed using the plugin rather than drilling into the registry. From what I understand, there are differences in the names of registry items on 64-bit OS'? I'll let someone else comment on that as I don't have access to 64-bit at this moment.
Does anyone know why the product GUIDs are mangled the way they are?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
Re: How to determine if a product is intalled.
If anyone's interested, the attached 7z file contains the source code of a VS 2008 project I cobbled together that converts to and from mangled and regular GUIDs.
- Attachments
-
- DecodeInstallerGUID.7z
- VS 2008 source code.
- (2.56 KiB) Downloaded 297 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP

