Deploying the Software Update Wizard

As discussed in the Software Update Wizard architecture page, you can deploy the Software Update Wizard as a Windows Service, or as a standard Windows executable.

Both implementations have the same functionality, with the exception that when the Software Update Wizard runs as a Service it runs in the SYSTEM security context, and therefore has rights equivalent to Administrator rights to update any files on the host computer, even files which the logged on user does not have rights to change.  For 'modern' operating systems like from XP, Vista, Windows 7 and forwards, the service implementation should be the preferred option as it allows you to securely deploy the full range of Software Update Wizard features for a negligible memory overhead and virtually zero cpu utilization (except during the actual update process itself).

The easiest deployment option - use our supplied redistributable installer, wuwinstaller.exe

Installing using wuwinstaller.exe:

The easiest way to deploy the Software Update Wizard is with the supplied wuwinstaller.exe, which is located in the 'SoftwareUpdateWizard' folder under 'Program Files on your computer.

You can launch this installer from within your own application installer.  You can force it to run silently (i.e. with no user interface) by passing the text "/S" as a command line argument, as in:

wuwinstaller.exe /S

Note that the "S" must be upper case.

There are three additional command line options you can use:

-NoInstall 1 Tells the installer not to install the service application into the services database in Windows using the SYSTEM identity default.  This option is described in more detail below.
-HideUninstall 1 Tells the installer not to add uninstall information to the Windows 'Add/Remove Programs' control panel applet.  Note that the uninstaller executable will still be installed, and must be called by your uninstaller as described here.
-Terminate 1 This option is provided to allow you to choose between two alternatives when running wuwinstaller.exe from a Software Update Wizard script ExecAfter or ExecBefore and addresses the issues stemming from the updater updating itself.

Alternative 1

The '-Terminate 1' command line option causes the installer to immediately terminate the existing instance of the Software Update Wizard service, WebUpdateSvc4.exe, allowing it to be updated and restarted.  The Software Update Wizard is always reliably updated immediately.

Please note, however, that any update sections within the current update script that follow the section containing the wuwinstaller.exe launch will not be processed within that update check.  Next time an update check is made the section containing the wuwinstaller.exe launch will be ignored (because the Software Update Wizard is up to date) and the following sections within the update script will be processed as normal.

Alternative 2

If the '-Terminate 1' command line option is omitted, the installer uses the Software Update Wizard service's command line parameter, "-e', to stop the Software Update Wizard service. 

However, if the Software Update Wizard service does not shut down quickly enough, it cannot be immediately updated and restarted. 

In this eventuality the installer sets up a 'replace on reboot' registry entry.  The existing update script will continue to be parsed and processed by the existing (i.e. previous) Software Update Wizard version.   At the next reboot the Software Update Wizard service will be replaced with the updated version installed by wuwinstaller.exe.

If you use wuwinstaller.exe to deploy the Software Update Wizard then the only other installation responsibility you have is to install the Software Update Wizard licence file, WebUpdateSvc4.lic, into the same folder as your application.  The developer installer will have installed WebUpdateSvc4.lic into the 'SoftwareUpdateWizard' folder within your 'Program Files'.


Uninstalling using wuwinstaller.exe

To uninstall the core components on a client machine your uninstaller should call 'wuwuninst.exe', which the installer installed into the user's 'System32' folder.

As with wuwinstaller.exe, appending "/S" to the command line causes wuwinstaller.exe to work with no user interface, as in:

wuwuninst.exe /S

Note that the "S" must be upper case.


Tips for InstallShield users

Set up a Custom Action to "launch executable", from Binary Table, point to the wuwinstaller.exe, use /S if a silent install of the Software Update Wizard is required. It can be put at the end of Install Exec sequence. Set its condition to 'Not Installed'.

For the uninstall, set up a Custom Action to "launch executable", from Directory, point to [Windows System]\wuwuninst.exe, use /S if desired, put at the end of the Install Exec sequence after the previous custom action. Set its condition to 'REMOVE="ALL"'.

Putting both these actions at the end of the Install Exec sequence works fine.

When you use InstallShield to build a single executable (setup.exe) for the install, it must be run As Administrator on Vista forwards, in order for the custom actions to work; otherwise you will get an Error 1721 - it cannot launch the executable. If you build a One-Click install, where it gives you a .cab file and creates an install.html with an Install button for you, it seems you don't have to run it as Admin on Vista forwards in order for the custom actions to work.

Licence file location

Important: The Software Update Wizard licence file, WebUpdateSvc4.lic must be installed into the same folder as your application runs from, otherwise the Software Update Wizard will not find it.

However, some deployments involve running the Software Update Wizard on a networked (LAN-based) client computer where the application files to update are located on a server.  The client machine launches the application using a shortcut pointing to the networked location of the application executable.  Installing the licence file in the application folder on the server will not work in a default Software Update Wizard installation because the service runs in the SYSTEM security context and SYSTEM does not (by default) have access to network drives.  To allow the Software Update Wizard to work in this situation you  should, instead, install the licence file into the same folder as WebUpdateSvc4.exe is running from on the local machine - i.e. the Windows system folder (usually C:\Windows\System ).  Important: This solution will only pass the licence file check if the running application is located on a network drive.  To update applications located on the local machine the licence file must be located in the application folder.


Service Control

See also: Software Update Wizard Service Reference for information on start-up parameters for the Windows Service implementation of the Software Update Wizard.  However, If you use wuwinstaller.exe you do not need to know this information unless you want to install the service application in a different security context to SYSTEM.

Running the Service under an alternate security context..

Adding Software Update Wizard to Your Own Installer?

We strongly recommend simply calling wuwinstaller.exe from within your own installer. As explained above, adding the command line argument "/S" will ensure the installation is silent and automatic.

Your uninstaller then calls the Software Update Wizard uninstallation program which wuwinstaller.exe will have installed into the user's System32 folder, 'wuwuninst.exe'.

Nearly every installer maker available allows you to launch additional processes such as wuwinstaller.exe as part of your installation. Whilst we are happy to provide the information below, we do recommend using our wuwinstaller.exe, because we have worked through the inevitable complexity associated with installing/uninstalling a potentially shared set of files, starting and stopping a Windows service etc..

However, if you are determined to incorporate the Software Update Wizard components individually into your own installer, this is what you will need to do: