Client Management Suite

 View Only

Create Software Uninstall Command for Any Software - Altiris CMS 7 

Jul 08, 2010 06:49 PM

This might seem a bit newbie for some of you guys, but for most CMS Admins Uninstall is a must, and not all softwares have MSI Installers so...

I discovered this method to uninstall almost any Software, that are listed under Windows "Add/Remove Programs", using the program {MSIGUID}, next I´m gonna explain the details on how to discover the software {MSIGUI} and then create an Uninstall command for the Software Package.

{MSIGUID} is an unique identifier for each software installed, and its unique in all clients

Now lets begin:

Step One: Install the desired software into a test client machine, in this particular case we will use Adobe Reader 9.1, after the software is installed, open regedit and navigate to the following Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, then you will have to locate your software, based on the right column, the field DisplayName shows the label as seen in "Add/Remove Programs", in our case the folder is selected below, note the DisplayName "Acrobat Reader 9.1".

uninstall_string.png


Notice the UninstallString field, there you can extract the correct product {MSIGUID} which we will use in the Software Uninstall Command, double click it to edit, like the window below, and copy the string.

Step Two: Create the Uninstall command in the Software Package previously created in the Notification Server, open the Console, then go to Manage > Software.

ns_step1.png


Now expand Software Catalog, and select Deliverable Software then select your Software Package, in our case Adobe Reader 9 (EN) then click the pencil icon to edit the package.

ns_step2.png


Now we´re going to edit the Package and add the Uninstall command using the {MSIGUID} we discovered before, select the Tab Package then click the button Add command to add a specific command into this Software Package.

ns_step3.png


Now for the Uninstall command we need to configure the Command Type to be Uninstall and the desired command line, in which we will insert our previous gathered {MSIGUID}, since we need the Uninstall command to be silent to the end user, we will need to add specific switches to the msiexec.exe to not display any user interface and also not to reboot the system, for that we will use the following switches:

MsiExec.exe /qn /x {AC76BA86-7AD7-1033-7B44-A91000000001} REBOOT=REALLYSUPRESS

Switches used:

/qn - Specify that no UI will be displayed in the client.
/x {MSIGUID} - Command switch /x to uninstall specific software defined by the {MSIGUID}.
REBOOT=REALLYSUPRESS - Force the client system not to reboot after uninstall.

Notice the Success code used is necessary otherwise the Software Task will shown as failure, since there's no success code informed, in this case the code is 3010, which I found after testing the package with the uninstall command and noticed that the software was indeed removed from the client, but still reported failure since Altiris assumes the success code is 0, and that change with different softwares.

ns_step4.png


Now let´s save our package and it´s ready for deliver :)

ns_step5.png

 Added a .XML file to create the report that show the UninstallString for the software after a full inventory of the computer(s).



Big thanks goes to Spanky_McSpank for the SQL query!! :)

Statistics
0 Favorited
5 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
xml file
Extract UninstallString from Software Inventory.xml   8 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Oct 05, 2015 11:02 AM

You can do this using task script, for Java 7 I have every uninstall command for 32 and 64 bit version added to one script as too time consuming to a package for each version. I make the script run silently and uninstall silently also.

@ECHO OFF msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217067FF} /quiet
@ECHO OFF msiexec /x {26A24AE4-039D-4CA4-87B4-2F06417060FF} /quiet
@ECHO OFF msiexec /x {26A24AE4-039D-4CA4-87B4-2F06417067FF} /quiet
@ECHO OFF msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217060FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217055FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217051FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217045FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217040FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217025FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417017FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217017FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217016FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217015FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217014FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217013FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217012FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217011FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217010FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217009FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217008FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217007FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217006FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217005FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217004FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217003FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217002FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83217001FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417055FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417051FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417045FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417040FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417025FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217017FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417017FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417016FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417015FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417014FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417013FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417012FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417011FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417010FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417009FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417008FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417007FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417006FF} /quiet
@ECHO OFF msiexec.exe /X {26A24AE4-039D-4CA4-87B4-2F86417005FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417004FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417003FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417002FF} /quiet
@ECHO OFF msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F86417001FF} /quiet

Feb 12, 2013 12:02 AM

Hi,

Gr8 article Dlopes.

good luck for next..

Aug 24, 2011 01:51 PM

Great Tutorial and Report!!!

Jul 22, 2010 04:41 PM

Thats a great report, tested it out today and worked like a charm, thanks!

Im gonna add the XML code for the report to add it to Altiris, with credits to you of course.

Jul 22, 2010 12:34 PM


Here is the source sql to create a report in NS that will show you all the install strings for discovered software.

select DISTINCT
DisplayName,
DisplayVersion as 'Verion',
UninstallPath as 'Uninstall String'
from dbo.inv_addremoveprogram
where uninstallpath like 'msiexec%' order by displayname

Jul 22, 2010 11:58 AM

Great Article.  The Uninstall String reg entry is also caputured by the Altiris Inventory Solution, so if you are running Client Management Suite, this information is  easily accessible.

Jul 09, 2010 12:45 PM


Hey andykn101,

In that article i was using NS 7.1 SP2 MR1, and that code is actually the success code for that uninstall, since it requires a reboot that it´s not performed, therefore it´s not a return=0 (success), but the uninstall works perfectly.

Att,
Daniel

Jul 09, 2010 11:45 AM

In NS 6.0 if you specified a Success code (like 3010) you had to then specify '0' as well otherwise it would assume that 3010 was the only success code. Is this the case in NS7?

Related Entries and Links

No Related Resource entered.