How do you uninstall exe based applications in SCE?

As we all know, you can install both exe and msi based application with SCE. Unfortunately, there is two limitation when you need to add an exe file (if you ask me). If you add an exe based application:

  1. You can’t uninstall it in an easy way
  2. If you (or the user that use the computer) manually uninstall an exe based application that has been deployed with SCE from the local client, it will never be reinstalled by SCE. If you compare this with an msi based application, it would be reinstalled at the next detection interval

So – how can we get around these problems? In this post I will explain how you can use a “Setup wrapper” to fix both of these problems. Note! The tools I use in this example are free to use and can be downloaded from web.

Before you start to deploy a solution based on this post – be sure to test it. All applications are unique and needs to be tested. The post is just an example of how you can do it. 

Preparations steps

  1. Download and install Windows Installer Wrapper Wizard 0.2.0 (WIWW) from VinsVision
  2. Download and install Orca (a msi database edit from Microsoft. Note that this download is not from Microsoft since they only provide a bundled with Microsoft® Windows Server 2003 SP1 Platform SDK)
  3. Create a directory on your desktop called “My first wrapper”
  4. Download or copy your exe based application, save it to “My first wrapper” folder . In my example I use XnView ( a free software to view and convert graphic files) Note! The setup engine need to be able to support silent/unattended install/uninstall

“Investigating” the application (find shortcuts and registry keys)

  1. Manually install the application on a client
  2. Open Regedit and brows to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall]. Here you will find your application and the UninstallString value.
    image
  3. Copy the text to a notepad document, we will need this information in a later step
  4. Open Program menu and have a look if the application have added a uninstall shortcut. In my example you will find one and it is located under “C:\Documents and Settings\All Users\Start Menu\Programs\XnView”. Copy the shortcut path to the notepad document, we will need this information in a later step.
    image
  5. In the “My first wrapper” folder, create a bat file and add the following:

REM The below line will hide the uninstallation information for the original setup shown i Add/Remove Programs. Since we will build our own setup, we don’t want to have multiple registration in Add/Remove Programs)
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XnView_is1 /v SystemComponent /t REG_Dword /d 1
REM The below line will remove the shortcut the applicatiuon added. Since we don’t want our users to use this we have to remove it
del %allusersprofile%\Start Menu\Programs\XnView\XnView uninstall.lnk

Build the MSI wrapper

  1. Start the WIWW from the Program Manu
  2. On the Welcome screen, click Next to start
  3. On the Windows Installer file screen, click Brows and brows to your “My first wrapper” folder. Add a name to your file. In my example I use xnView.msi. Click Next to continue
  4. On the Install command screen, click Add
    Select to Use SourceDir
    Click Brows and select your exe setup file. In my example I use XnView-win.exe
    As parameters add /silent
    image
  5. Click Ok to save
  6. Click Add a new command to run
    Select to Use SourceDir
    Click Brows and select your bat file you created earlier. In my example I use fix.bat
    image
  7. Click Ok to save
  8. Click Next to continue
  9. On the Uninstall command screen, click Add
    Select a Windows Installer Installer Folder property = Select [ProgramFilesFolder]
    Brows or type the program to run = Brows to Program Files\XnView\unins000.exe
    (this information was found during the investigation steps above)
    Specify an program parameter = /Silent (this information was found during the investigation steps above)
    image
  10. Click Ok to save
  11. Click Next to continue
  12. On the Product Appearance and Requirements screen, click Next to accept the default values
  13. On the Package Meta Data and Language change to:
    Product name = XnView
    Product version = 1.94.2
  14. Click Next to continue
  15. On the The wizard is ready to create your wrapper, click Next followed by Finish to create and save your package
  16. Right click the new xnView.msi and select “Edit with Orca” (Note that you must have installed Orca to have this option)
  17. On the left side, select the Property table. Change the below (Note! This is an important step since this information will be the information you will get in the inventory reports in SCE)
    ARPHELPLINK = http://www.xnview.com
    Manufacturer = XnView
    ARPCOMMENTS = This will install XnView
    ARPURLINFOABOUT = http://www.xnview.com
    ProductVersion = 1.94.2

Add Package in SCE and test

You are now ready to add this package to SCE. In the Add Software wizard you need to make sure to select “Include all files and sub folders in this location” since you need to add all 3 files to get this package to run. Be sure to only deploy it to a small test group before you deploy it to all your computers. After you successfully deployed the application, test:

  1. To manually uninstall the application from the client.
    1. Uninstall the application
    2. Run c:\Windows\System32\wuauclt.exe /detectnow
    3. The Yellow icon will now appear and the application will be reinstalled
  2. Uninstall the application from all computers
    1. In the SCE console, select to uninstall it to a group of computers that has it installed

This post have shown you an easy way to  handle uninstallation of exe based applications in SCE and still use the standard installation engine provided by the software vendor (instead of doing a msi repackaging of the hole application). On top of that, the application will reinstalled if someone manually uninstall it on the client computer which will help you to have all computers complaint with the right software. 

 

Hope this can
be valuable for you. If you have any comments, feel free to post them

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>