I have a driver installing using DriverPackageInstall, and uninstall DriverPackageUnInstall in wix installer. It works very well, If install and Uninstall driver version 1.0.0.0.
But when I install 1.0.0.0 and upgrade 1.2.0.0. it works well replaces drivers with 1.2.0.0 binaries.
But when I uninstall, driver is not uninstalled, checked logs found that uninstallation successful DriverPackageUnInstall return 0, also logContext.difxError is also 0.
Not able to figure why driver is not being uninstalled.
<Custom Action='InstallDriverAction'
After='InstallFiles'>NOT Installed</Custom>
<Custom Action='UninstallDriverAction'
After='InstallInitialize'>
Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
One observation is driver,cat,inf of version 1.0.0.0 is still present at DRVSTORE, and driver with 1.2.0.0 deleted.
Any help will appreciated.
Thanks
The condition looks wrong. It currently says "uninstall the driver if it is installed, except during a major upgrade". You propably want to uninstall the old version of the driver during major upgrade, so the
AND NOT UPGRADINGPRODUCTCODE
should be removed.The
Installed
part of the condition is also wrong. Actually this would uninstall the driver when doing a repair! It could be argued that it can be useful to uninstall the driver and then install it again to hopefully fix some errors. But in its current state, the driver would not be installed again during a repair, because the properties are checked only once at the acquisition phase and won't be updated during the execute phase of the setup.My suggestion:
The first condition is pretty standard: install the driver if it is not already installed OR this is a reinstall (aka repair).
The second condition says to uninstall the driver in any of these cases:
RemoveExistingProducts
standard action so the uninstall of the existing version will be done entirely before installing the new version. When using the WiXMajorUpgrade
element the default isSchedule="afterInstallValidate"
, which does exactly that.