/build/static/layout/Breadcrumb_cap_w.png

Uninstall ESRI ArcGIS stuff

Okay, we're supposed to deploy ArcGIS 9.2

But ESRI apparently doesn't believe in the "new" version automatically removing the "old" stuff.

So I have to figure out how to manually remove the old 9.1 stuff

I have their article ID 28709

It works, but the problem is that I don't know what stuff is on various people's machines. So if I write a batch file or something to run through and try to remove all possible programs, it generates an error for each "thing" that's not on the machine (and the user has to click OK for each error).

Is there any nice to way to write something in InstallShield or DOS batch file like:

If registry key BLAH exists, then do msiexec /x BLAH

(in other words, I can look for the GUID and if it's there, remove it).

I CAN do this with ZENworks, but it would require that I make an app object for EACH GUID and I'd rather not have to make 11 different apps just to remove the possible 11 different 9.1 versions of stuff there.

0 Comments   [ + ] Show comments

Answers (5)

Posted by: AngelD 17 years ago
Red Belt
0
If these are in the form of MSI installations you could populate the Upgrade table. Have a look in MSI.CHM or search the "Package Development" forum for postings regarding this.
Posted by: kjhurni 17 years ago
Orange Belt
0
Cool, thanks. Yes, they were in MSI (as I can use MSI To remove them).

I'll check that out, thanks!
Posted by: kjhurni 17 years ago
Orange Belt
0
Well, I couldn't search for MSI.CHM (the search changes it to MSI,CHM) and there were only 4 messages in the Package Development with that "search" and none of them pertained to removing things.
Posted by: Robo Scripter 17 years ago
Orange Senior Belt
0
The following script script removed Version 8.3 and installed 9.1 with a Transform.
It should work to do the same for removing 9.1 and installing 9.2 just verify the ProductCode and enter in the correct msi and transform names.

'Start Code***************************************************************
'==========================================================================
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.1
' NAME: ESRI_ARCGIS_INSTALL.VBS
' AUTHOR: Robert W. Haynie
' DATE : 11/30/2006
' COMMENT:
'
'==========================================================================
Option Explicit
On Error Resume Next

Const msiInstallStateNotUsed = -7
Const msiInstallStateBadConfig = -6
Const msiInstallStateIncomplete = -5
Const msiInstallStateSourceAbsent = -4
Const msiInstallStateInvalidArg = -2
Const msiInstallStateUnknown = -1
Const msiInstallStateBroken = 0
Const msiInstallStateAdvertised = 1
Const msiInstallStateRemoved = 1
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3
Const msiInstallStateSource = 4
Const msiInstallStateDefault = 5
' Product code for Software that must be removed prior to installing new software...
Dim strOldProductCode : strOldProductCode = "{A149DEA2-1D5B-11D5-9F76-00C04F6BC7A1}"
' Full name of Install MSI
Dim strNewProduct : strNewProduct = "ArcGIS.msi"
' Full Name of Transform for Install MSI...
Dim strNewProcuctTransform : strNewProcuctTransform = "ArcGIS.mst"
' Return Code variable...
Dim strReturn : strReturn = 0
' Old Product Search variable...
Dim bolInstalled : bolInstalled = False

' Connect to Windows Installer object
Dim installer : Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError("1")
' List all Installed Products
Dim arrProducts : set arrProducts = installer.Products : CheckError("2")
' Old product Search Item variable...
Dim objProduct
' Search for Old Installed product returns true if installed...
For Each objProduct In arrProducts
If objProduct = strOldProductCode Then
bolInstalled = True
End If
Next
' close installer object...
Set installer = Nothing

' remove old software product....
If bolInstalled Then
strReturn = RemoveOldProduct(strOldProductCode)
If strReturn <> 0 Then
call InstallerFail ()
Else
' Install new product post Removal of Old Product...
strReturn = InstallProduct()
if strReturn <> 0 Then InstallerFail ()
End If

Else
' Install new product Old Product not present...
strReturn = InstallProduct()
if strReturn <> 0 Then InstallerFail ()

End If

WScript.Quit(0)

' End Script............
'********************************************************************************
' Function & Sub Section below this point.......
'********************************************************************************

Sub CheckError(strPoint)
Dim objShell : Set objShell = CreateObject("WSCript.Shell")

Dim message, errRec
If Err = 0 Then Exit Sub
message = "Error Point = " & strPoint & vbcrlf & Err.Source & vbcrlf & Hex(Err) & ": " & Err.Description
If Not installer Is Nothing Then
Set errRec = installer.LastErrorRecord
If Not errRec Is Nothing Then message = message & vbNewLine & errRec.FormatText
End If
objShell.LogEvent 1, message
Wscript.Quit err.number
End Sub
' Remove Product named via strOldProductCode.....
Function RemoveOldProduct(strOldProductCode)
' Create Windows Scripting Host Shell Object...
Dim objShell : Set objShell = CreateObject("WScript.Shell")
RemoveOldProduct = objShell.Run("msiexec.exe /x" & Chr(32) & strOldProductCode & chr(32) & "REBOOT=" & chr(34) & "ReallySuppress" & chr(34) & chr(32) & "/qb!-", 1, True)
End Function

Function InstallProduct()
Dim objShell : Set objShell = CreateObject("WSCript.Shell")
Dim strInstall : strInstall = "msiexec.exe /i" & Chr(32) & Chr(34) & strNewProduct & Chr(34) & Chr(32) & "TRANSFORMS=" & Chr(34) & strNewProcuctTransform & Chr(34) & Chr(32) & "/qb!-"
InstallProduct = objShell.Run(strInstall, 1, True)
End Function

Sub InstallerFail ()
Dim objShell : Set objShell = CreateObject("WSCript.Shell")
objShell.LogEvent 1, "Installation has failed with an error code of: " & strReturn
WScript.Quit(strReturn)
End Sub

'End Code****************************************************************

[8|]
Posted by: kjhurni 17 years ago
Orange Belt
0
Thanks.

I did try doing the "upgrade" properties in the MSI file as per the discussion in the Package Development (titled Uninstall Custom Action).

Unfortunately it appears that ESRI checks for the product first before the upgrade property can be used.

I can't really use a script to drive the entire thing as we need to deploy with a software automation tool and track the progress (which means we can only monitor if we run the MSI directly).
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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