How to create a package for full and upgrade installations

This post will show how to create an installation package in SCCM and automatically decide if the device requires a full or an upgrade installation.

I recently had to deploy a program called Monitor Pro from EHS Data and found out that the program saves custom settings for each user, which are lost if the application is uninstalled or a full installation is performed on the machine which already has a previous version of the program.

The solution was to configure the SCCM package to check if the machine already had the program installed.

For that I used the SCCM’s Global Conditions feature.

Global Conditions

1. Right-click on Global Conditions and click on Create Global Condition

2. Type in a name for the condition, then select Windows for Device Type, Setting for Condition Type, Script for Setting Type and String for Data Type and click on Edit Script

3. Inside the editor, copy and paste the code below

$MPInstalled = get-wmiobject Win32_Product -Filter "Vendor LIKE '%Monitor Pro%' or Vendor LIKE '%EHS Data%'"
if($MPInstalled -ne $null) {
} else {
Click on OK

If we run that code using PowerShell ISE, we can see the following result while using a device with Monitor Pro installed.

Running the full code will show the following result

Note that this time the code result was the string “Upgrade”.

So basically the script will show the string “Upgrade” if any installation is found on the device and “Full” if no installation is found.

4. Edit the installation package and create two types of installation, one containing the upgrade installation files and the other with the full installation files

5. Edit the Upgrade type and click on the Requirements tab. Click on the Add button and select the options shown below.

Click OK when completed.
The custom requirement will be listed.

6. Proceed to do the same for the Full installation type

Deploy your application package for testing.

Leave a comment

Your email address will not be published. Required fields are marked *