Mark
Mark

Reputation: 2261

How to detect if SCCM 2012 is installed?

I am writing a Wix C++ Custom Action to detect if SCCM 2012 is installed. I am doing this by reading the product GUID from the registry: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\

But this didn't work as on the system where SCCM 2012 was installed there was no such information in the registry.

Can anyone please point me in the correct direction to achieve this?

I would like to install my software only when SCCM 2012 is installed.

Upvotes: 1

Views: 577

Answers (2)

Bob Arnson
Bob Arnson

Reputation: 21896

You shouldn't rely on undocumented internals for detecting software -- they can change without warning. (For example, the product code GUID changes during upgrades so unless the SCCM team has said they won't change it, it's likely to change for SCCM 2012 RTM and even 2012 updates.)

Instead, see if the team has documented a way of detecting it. Most teams document a registry value for detecting things like which version is installed. If they don't, you're still probably better off looking at the registry, since values there are less likely to go away.

Upvotes: 2

Yan Sklyarenko
Yan Sklyarenko

Reputation: 32270

You should take advantage of the Condition element for this. If you place it under Product or Fragment, it will work as a launch condition. Learn more about launch conditions here.

This condition you'll author will check a property. The property should be set if the software you're looking for in installed, and not set otherwise (that's the simplest case). In order to achieve this, author the RegistrySearch element, which will define the property in case the proper registry path is found. The RegistrySearch element should be a child of Property element.

As you can see - no custom actions here, and that's great! :)

Upvotes: 2

Related Questions