Uninstalling Adobe CS4 apps

I’ve previously posted about my issues with the Adobe CS4 Deployment Toolkit. I’ve since been able to (mostly) wrestle it into submission, and can install several of the CS4 Suites and several of the CS4 standalone apps. I can apply updates to the apps and suites, including updating Acrobat Pro all the way to 9.3.1 – all in an automated fashion, without user intervention.

But uninstalls are another matter.

Adobe’s tools and documentation have you create the XML file for uninstall at the same time you are creating the XML file for the install. If you install a CS4 product and then immediately remove it, it generally works as you’d expect. But if you update CS4 products in your install, a later removal will probably fail with the dreaded “Exit Code 7 – Unable to complete the silent workflow”.

If you poke through the log files in /Library/Logs/Adobe/Installers, you might be able to get some clues why.

The first problem I saw when trying to remove an updated Photoshop CS4 was it claimed it could not uninstall because it thought the Adobe Updater was not installed, even though it was.

To me it seems idiotic that an uninstaller would throw a fatal error when it’s asked to uninstall something and finds it’s not installed, but in this case, it’s probably for the best, as I would have just been puzzled that the uninstaller claimed that it completed successfully, but had left the Updater behind.

I decided it wasn’t vital that an uninstall remove the Adobe Updater from /Applications/Utilities, so I ignored this warning from Adobe:

When you uninstall your software silently, the install.xml file and uninstall.xml you use MUST match each other or the process will fail.

http://kb2.adobe.com/cps/403/kb403994.html

I ignored the warning and edited the AdobeUberUninstaller.xml, removing the reference to Adobe Update Manager. This got uninstalls of Photoshop, Illustrator and After Effects working again, with the downside that the Adobe Updater was left behind. Not that big a deal.

The CS Suites still gave me issues on uninstall, though, complaining that Adobe Acrobat Pro was not installed, when it absolutely was. I noticed that if I installed one of the suites, but didn’t update Acrobat Pro at all, the uninstall would complete successfully.

More frustrating was that the Uninstaller(s) that Adobe puts on the machine in /Applications/Utilities/Adobe Installers/ worked just fine – they’d uninstall the products even when the AdobeUberUninstaller failed.

I wanted to figure out why the AdobeUberUninstaller thought that Acrobat Pro was not installed.

In the install media that AdobeUberUninstaller.xml references, in payloads/AdobeAcrobat9Core-mul, is a file named AdobeAcrobat9Core-mul.proxy.xml. Toward the end of that file is an embedded script named “IsInstalledScript”:


<IsInstalledScript>
<![CDATA[
var result = "0";
var appsForPDF = eval('(' + GetApplicationsForFileExtension("pdf") + ')');
var appList = appsForPDF["applications"];
if (appList)
{
      for (var i = 0; i < appList.length; ++i)
      {
            var anAppPath = appList[i];
            var appInfoDict = eval('(' + GetApplicationInfo(anAppPath) + ')');
            if (appInfoDict)
            {
                  if ((appInfoDict["CFBundleIdentifier"] == "com.adobe.Acrobat.Pro")
                        && (appInfoDict["CFBundleVersion"] == "9.0.0"))
                  {
                        result = "1";
                        break;
                  }
                  if ((appInfoDict["CFBundleIdentifier"] == "com.adobe.Acrobat.Pro")
                        && (appInfoDict["CFBundleVersion"] == "9.1.0"))
                  {
                        result = "1";
                        break;
                  }
            }
      }
}
result;
]]>
</IsInstalledScript>

Looking at this script, it’s obvious what the problem is. The script is checking for an application with the identifier “com.adobe.Acrobat.Pro”, and only for versions “9.0.0” and “9.1.0”. After we’re fully updated, Acrobat Pro’s version is “9.3.1”, and so the test fails.

If I edit the script to test for version “9.3.1”, AdobeUberUninstaller now successfully removes the CS4 Suite.


if ((appInfoDict["CFBundleIdentifier"] == "com.adobe.Acrobat.Pro")
             && (appInfoDict["CFBundleVersion"] == "9.3.1"))
{
        result = "1";
        break;
}

I suspect now that instead of removing the reference to the Adobe Update Manager in the AdobeUberUninstall.xml files, I could have possibly edited a payload xml file to get this working. Something to investigate for the future.

This points out yet another major flaw in Adobe’s enterprise deployment toolkit – it can’t adapt to changes post-install. Yes, you can follow my example and edit XML files to fix things, but this is a never-ending chore, as more and more items are updated, you’ll potentially have to make more and more edits over time. And there’s no guarantee that you’ll be able to fix every uninstall problem with this approach.

Sadly, 99% of a good solution is in place – as the Adobe tools are updated, the install/uninstall info on the local disk is updated, and the locally-installed Uninstaller app has the information needed to successfully uninstall.

I say sadly because there seems to be no way to run the locally-installed uninstaller app silently. The uninstaller apps in /Applications/Utilities/Adobe Installers/ are actually aliases to items in /Library/Application Support/Adobe/Installers. Inside this folder are subfolder for each Adobe installation, and inside those are Uninstall and Setup applications, which each end up setting up certain things and then calling /Library/Application Support/Adobe/Installers/R2/Setup.app.

Looking at each of these layers using various tools, it’s apparent that /Library/Application Support/Adobe/Installers/R2/Setup.app (which is the tool that ultimately does the uninstall) is similar or identical to the Setup.app that AdobeUberUninstaller calls, so it seems like it could be possible to to call it with the correct command-line flags to do an uninstall. But so far I have failed miserably.

Ideally, one could do something along the lines of:
/Library/Application Support/Adobe/Installers/cb9dd3338cc1be31e597d7747535dd0/Uninstall.app/Contents/MacOS/Uninstall --mode=silent --uninstall=all

This would call the Uninstaller for Adobe Photoshop CS4 in silent mode and tell it to uninstall everything that’s installed that’s part of the Adobe Photoshop CS4 install, just as if you had launched the app manually and checked the box to uninstall all.

This would have a much better chance of doing a successful uninstall than relying on uninstall info from the Adobe CS4 Enterprise Deployment Toolkit, since it would be using up-to-date information for that exact machine, instead of potentially out-of-date information from the original install.

Uninstalling Adobe CS4 apps