/build/static/layout/Breadcrumb_cap_w.png

Can I use MSI codes to push an application upgrade in SCCM only to systems that have previous versions of it and not to systems that do not have the application?

I need to push a software update to thousands of computers that have various previous versions but do not want it to install on systems that have never had the software installed.  I'm fairly sure I can do this with MSI codes, but I'm less than positive on how to accomplish it.  I know I can use the MSI codes to determine the existence of a particular version of the software.  I just don't know how to make sure it only deploys when it finds one of several MSI codes and not to install otherwise.

0 Comments   [ + ] Show comments

Answers (4)

Answer Summary:
Posted by: anonymous_9363 5 years ago
Red Belt
1

Top Answer

Easy. Create a query-based collection, where the query interrogates the product's ProductCode in HKLM\Software\Microsoft\Windows\CurrentVersion and set your deployment to target that collection.


Comments:
  • I ended up using the MSI Product Codes (GUIDS) for old versions in the collection and the MSI code for the new version for the detection to see if the upgrade was already done. Then I did a requirement check for the executable file. - ptireland 5 years ago
Posted by: SMal.tmcc 5 years ago
Red Belt
0
You can use in a batch
if exist <insert file name here> <action>

Look for the existance of the exe and as action gosub to remove and install

to remove any version of a package you can use WMIC

As an example - this will remove all java - The %% acts like a wild card, you can use before and/or after the search wording also

wmic product where "name like 'Java%%'" call uninstall /nointeractive
wmic product where "name like 'Java%%' and not name like 'Java 8 Update 65%%'" call uninstall /nointeractive
wmic product where "name like 'Java%%' and not name like '%%Java 8%%'" call uninstall /nointeractive

Comments:
  • I wanted to handle it with a script too, but my boss wants me to do it with the built-in SCCM logic for the application deployment. I had initially checked for the registry key and whether the file exists, but he said sometimes when you uninstall, the registry key remains, and MSI codes are more reliable. - ptireland 5 years ago
Posted by: nagendrasingh 5 years ago
Black Belt
0

You can do it multiple ways like

  1. The script testing for older versions
  2. A product like patchmypc what sends out updates via SCCM
  3. or just SCCM's query based collections.

Cheaper/cleaner version would be to make a query based collection and then target a deployment to it.


Say the older software is Java 7 then you can use something like below

======================================

http://www.74k.org/java-7-update-collection-query-for-pcs-not-on-the-current-version


Java 7 Collection Query

This query simply creates a collection of computers that have Java Version numbers lower than Java Version 7 Update 25.

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS   on   SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId   where   SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like “%Java 7 Update%”   and   SMS_G_System_ADD_REMOVE_PROGRAMS.Version < “7.0.250”

Posted by: nagendrasingh 5 years ago
Black Belt
0

You can use the query on bottom to make a collection based on a product code


https://social.technet.microsoft.com/Forums/Lync/en-US/a44e6014-5536-40a7-95dd-c718f30a6346/querycollection-on-software-code-product-code?forum=configmgrgeneral
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ