1

I have been trying to query Window (XP and Vista) to see if any version of one of our software packages is installed with the UpgradeCode (In this case the UpgradeCode is the only static GUID from version to version). I have tried to do this with WMI and the WindowInstaller.Installer object but have not been successful. I have to write this query from C#. Thanks for any assistance or direction you can provide.

1 Answer 1

1

You need to use the MsiEnumRelatedProducts function from MSI.DLL. This link describes how to use it:

http://msdn.microsoft.com/en-us/library/aa370103(VS.85).aspx

It is an unmanaged DLL so you will need to DLLImport it. I am using it in VB.net to check the code.

The key is more than one installed package can have the same upgrade code. If the first call to this returns a package code then you can skip checking again and act accordingly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.