How do you uninstall exe based applications in SCE?
Posted: september 10th, 2008 | Author: Björn Axell | Filed under: How-To, SCE | No Comments »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:
- You can’t uninstall it in an easy way
- 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
- Download and install Windows Installer Wrapper Wizard 0.2.0 (WIWW) from VinsVision
- 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)
- Create a directory on your desktop called ”My first wrapper”
- 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)
- Manually install the application on a client
- Open Regedit and brows to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall]. Here you will find your application and the UninstallString value.
- Copy the text to a notepad document, we will need this information in a later step
- 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.
- 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
- Start the WIWW from the Program Manu
- On the Welcome screen, click Next to start
- 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
- 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
- Click Ok to save
- 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
- Click Ok to save
- Click Next to continue
- 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)
- Click Ok to save
- Click Next to continue
- On the Product Appearance and Requirements screen, click Next to accept the default values
- On the Package Meta Data and Language change to:
Product name = XnView
Product version = 1.94.2 - Click Next to continue
- On the The wizard is ready to create your wrapper, click Next followed by Finish to create and save your package
- Right click the new xnView.msi and select ”Edit with Orca” (Note that you must have installed Orca to have this option)
- 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:
- To manually uninstall the application from the client.
- Uninstall the application
- Run c:\Windows\System32\wuauclt.exe /detectnow
- The Yellow icon will now appear and the application will be reinstalled
- Uninstall the application from all computers
- 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