The Software Update Wizard and the supplied installers are all 32 bit applications throughout.
The developer install will install the developer components to the folder "C:\Program Files (x86)\SoftwareUpdateWizard".
The wuwinstaller.exe redistributable installer is a 32 bit application and therefore will install the Software Update Wizard components into the 32 bit virtualised folders under Windows 64 bit operating systems. If your application is also compiled for 32 bit targets then wuwinstaller.exe will work correctly for you under Windows 64 bit without requiring any adjustments whatever.
However, the installation folder locations will be different, compared to a 32 bit environment.
The Software Update Wizard service (WebUpdateSvc4.exe), the UI component (WuWUI.exe) and the wuw4.dll dynamic link library will install to the folder "C:\Windows\SysWOW64".
The Software Update Wizard log file will also be created and updated in "C:\Windows\SysWOW64".
The WebUpdateSvc4.ini file will be created and updated in "C:\Windows" as normal.
The Software Update Wizard registry entries will be created under the node "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WUW".
The default behaviour of a .Net application is to run as a 32 bit application under 32 bit Windows platforms and as a 64 bit application under Windows 64 bit platforms. This means that a .Net application, built with the IDE default settings, will successfully reference wuw4.dll on 32 bit platforms but will raise an exception under 64 bit platforms. This is because a 64 bit application cannot load a 32 bit Windows dll - a Windows limitation.
However, there are two alternative solutions which will allow your .Net application to call the Software Update Wizard on all platforms:
A 32 bit application will function under Windows 64 exactly as if it is running on a Windows 32 bit operating system. It runs inside the dedicated Windows on Windows' (WOW64) subsystem which is part of all 64-bit Windows operating systems.
There are therefore system folders which it may not be able to see - i.e. the non-virtualised folders used by the 64 bit operating system. However, a 32 bit application should generally not need to be able to see these folders. To all intents and purposes, therefore, your 32 bit application can use the Software Update Wizard under Windows 64 bit without any adjustment to either your code, the way the Software Update Wizard is deployed, or the way your application calls the Software Update Wizard.
An application compiled for 64 bit Windows cannot load wuw4.dll because it is a 32 bit DLL. However, your application can launch the supplied wuwstub.exe (32 bit) utility as a process instead of calling wuw4.dll directly. Wuwstub.exe receives the URL of your update script in its command line and then uses the WebUpdate() function from wuw4.dll to instigate the update check.
In C#, you would therefore use:
You should install Wuwstub.exe into the same folder as your (64 bit) application, so that the Software Update Wizard can locate your application folder:
Because the Software Update Wizard is 32 bit throughout, all folder constants are expanded using the Windows on Windows' (WOW64) subsystem. Therefore the folder names as seen by the Software Update Wizard and your 64 bit application will be different.
For example, say you use the <SYSDIR> constant in conjunction with the TargetFolder keyword in order to update a DLL in the System folder. To a 32 bit application running in Windows 64 bit, such as the Software Update Wizard, the folder constant <SYSDIR> expands to "C:\Windows\System32" in WOW64, but in fact the real (physical) folder (as seen by a 64 bit application) in which the file will be placed is actually "C:\Windows\SysWOW64".
The following table shows how the various Software Update Wizard folder constants expand on a 64 bit operating system. "<SYSDIR>" is the only problematic item, where it is not possible to break out of the WOW64 virtualisation.
|Constant||32 bit expansion||Physical location on 64 bit Windows|
|<WINDIR>||C:\Windows||Same as 32 bit|
Tip: The Software Update Wizard is a 32 bit application and therefore will always redirect 'c:\Windows\System32' to 'c:\Windows\SysWOW64'.
If you want the Software Update Wizard to access the real (64 bit)
System32 folder you should use:
|<PROGRAMFILES>||C:\Program Files (x86)||C:\Program Files (x86)|
|<CLIENTFOLDER>||The correct client folder, even if it resides in C:\Program Files.||The correct client folder, even if it resides in C:\Program Files.|
||C:\ProgramData||Same as 32 bit|
||C:\Users\Public\Documents||Same as 32 bit|
|<LOCALAPPDATA>||C:\Users\<username>\AppData\Local||Same as 32 bit|
The ellipsis causes Windows to go up a folder level and then to folder 'AnotherApp', which is at the same folder level as your application resides, underneath Program Files.
Note that the example assumes that Wuwstub.exe is installed into an application folder one level below (i.e. an immediate child folder of) C:\Program Files.