Some time ago I created an System Center Configuration Manager (SCCM) application to deploy FileZilla for users. Recently I created an updated application that upgraded FileZilla (using the usual ‘uninstall the old version, then install the new version’ method), which gave me an error when the application was upgraded:
with the reported error being ‘The software change returned error code 0x87D00325 (-2016410843).
In addition, attempting to uninstall the application using the SCCM Software Center on the client machine gave a ‘Removal Failed’ with the same error details:
Digging through the AppEnforce log file on the client, an error was reported when attempting to uninstall the application as part of the change:
Prepared command line: "C:\Program Files (x86)\FileZilla FTP Client\uninstall.exe" /S
Post install behavior is BasedOnExitCode
Waiting for process 1616 to finish. Timeout = 120 minutes.
Process 1616 terminated with exitcode: 0
Looking for exit code 0 in exit codes table...
Matched exit code 0 to a Success entry in exit codes table.
Performing detection of app deployment type FileZilla 3.13.0 x86
App enforcement completed (0 seconds) for App DT "FileZilla 3.13.0 x86"
This indicates that the uninstall process completed, but the application was detected as still being installed immediately afterwards. This is due to the way that uninstallation is performed, with the uninstall process triggered by SCCM spawning another process to actually perform the uninstallation, while the original process terminates. This means that the process that SCCM is waiting on to complete, does so almost immediately, while the actual work to perform the uninstallation is on-going, hence the reason that SCCM then detects the application as still present on the client system.
To get around the issue, we need to wait a period of time after the uninstallation is triggered to allow for completion before allowing SCCM to perform its detection. In order to do this, I’m using the ‘sleep.exe’ program that comes with the Windows 2003 Resource Kit Tools (available at http://www.microsoft.com/en-us/download/details.aspx?id=17657) to achieve this.
The items we’ll need to be copied to an appropriate location for deployment are:
- The FileZilla installer
- The sleep.exe program
- A batch file to perform the uninstallation
- An SCCM application that uses the batch file
The batch file should contain two lines:
"%ProgramFiles%\FileZilla FTP Client\uninstall.exe" /S
This runs the uninstaller as before, then pauses for 20 seconds to allow the system to catch up. 20 seconds is long enough for our client machines, YMMV.
The SCCM application should then be created as normal:
Manually specify the application information:
Provide a name for the application and optionally a publisher, version etc.:
Provide appropriate information for the Application Catalog:
Click ‘Add…’ to add a Deployment Type to the application:
Select ‘Manually specify the deployment type information’:
Provide a deployment type name and optionally administrator comments:
For the content page of the wizard, specify the content location, for the installation program, specify ‘FileZilla_X.XX.X_win32-setup.exe /S’ and for the uninstall program, specify the batch file that was created previously:
For the detection rules, we used the file version of the ‘filezilla.exe’ program file that gets installed, which seemed to work well:
In addition, if required, supersedence information can be added to the application.
The procedure above provided a robust SCCM application that can be installed and uninstalled without issue and can also be upgraded to a later version without issue. It should be noted that this method works for other applications with the same sort of uninstallation routine, e.g. Notepad++.