Remove previous version of package in Software Installedin case of upgrade.
search cancel

Remove previous version of package in Software Installedin case of upgrade.

book

Article ID: 405047

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

How to remove previous installed version from Software Installed Packages when a new version is installed ?

Example :
There are 2 SD packages for 2 versions of 7zip : 23.0.1 and 25.0.0

If 7zip 23.0.1 is sent to a machine and later 7Zip 25.0.0, both packages appear in Installed Packages folder of the machine :

 

In Add/Remove Program on the machine only version 25.00 appears.

Environment

Client Automation - All Versions

Resolution

A solution is to execute command sd_acmd.exe AddUninstallRecord to remove previous version during installation of new version 

Example :
For package 7Zip 25.0.0, create a .bat file containing :

@echo off
START /WAIT 7z2500-x64.exe /S
SET RC=%ERRORLEVEL%
IF %RC% EQU 0 sd_acmd.exe AddUninstallRecord "7zip" "23.0.1" "inst" "" current current "" ""
EXIT /B %RC%

This script installs silently 7Zip 25.0.0 and executes the command :

sd_acmd.exe AddUninstallRecord "7zip" "23.0.1" "inst" "" current current "" ""

to remove the previous version from SD Installation folder in case it was installed

See the documentation for more information about sd_acmd.exe  AddUninstallRecord : AddUninstallRecord