Issues with Patchwiz.dll v4.0
Issue Description
Performing either of the following operations causes patchwiz.dll v4.0 to delete all writable files and folders in the root directory:
1. UiCreatePatchPackage is called with the hwndStatus parameter set to NULL OR
2. UiCreatePatchPackageEx is called with the hwndStatus parameter set to NULL and dwFlags set to 0×800 OR
3. Using msimsp.exe v3.0 to create Windows Installer patches while using patchwiz.dll v4.0.
Cause
When invalid parameters are supplied to UiCreatePatchPackageEx API, it bails out with an error code. However, while returning, the API erroneously uses partially initialized data to clean up the temporary directory. This partially initialized data results in deleting the writeable data root drive.
Resolution
There are three resolutions for this issue currently:
1. Do not use patchwiz.dll v4.0 to call UiCreatePatchPackage and UiCreatePatchPackageEx with these parameters.
2. Get the latest patchwiz.dll v4.5 from the Windows Installer 4.5 Beta program. The latest version of patchwiz.dll there fixes the data loss issue mentioned in this blog. However, the call to UiCreatePatchPackage with hwndStatus parameter set to NULL will fail to create a patch. We understand that this is a regression. It will be fixed in Windows Installer 4.5 RTM.
3. Use patchwiz.dll v3.1.
[Author: Hemchander Sannidhanam]
This posting is provided “AS IS” with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.
Original post by Windows Installer Team