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 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
|-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 1The '-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 2If 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.
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:
Note that the "S" must be upper case.
The wuwinstaller.exe redistributable takes care of shared file counting. In other words, each time wuwinstaller.exe is run it creates/increments a shared file counter in the Windows registry. Each time wuwuninst.exe is run the shared counter is decremented. When it reaches zero the shared files are removed. The registry key which contains the counter is:
HKEY_LOCAL_MACHINE\SOFTWARE\Software Update Wizard\InstallCount
We recommend that you use wuwinstaller.exe to deploy the Software Update Wizard because it removes your responsibility for installing and starting the service and ensuring that uninstalling your application does not interfere with other applications which depend on the Software Update Wizard for automatic updates. It adds only 275Kb of overhead to your installer.
If you decide to 'roll your own' installer then you will have to address all of the issues outlined above - i.e.:
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.
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.
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..
If you want to install the Software Update Wizard service to run in a different
security context to the default then you can use wuwinstaller.exe the following
command line arguments:
wuwinstaller -NoInstall 1
... or for a silent installer:
wuwinstaller /S -NoInstall 1
This causes the files to be installed to the hard disc, but the service application will not be registered as a windows service. You can then use the WebUpdateSvc4.exe command line options to install and start the service, as described here.
Please bear in mind that he default local security policy on most Windows platforms
prevents users from registering and starting a service application. Therefore
this policy must be adjusted for the user in who's security context the Software
Update Wizard is to be run from, by adding the user to the policy, as shown in this
If you do not update this setting then Windows will report a 'logon failure' when you try to start the service application.
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:
Install the WebUpdateSvc4.exe into the System32 folder.