[wix-users] Wix Failing to install driver
Phill Hogland
PhillHogland+wix at gmail.com
Mon Mar 20 19:16:13 PDT 2017
While I use DifxAppExtension to install several drivers, it has been a
while since I did the development and I don't have the code handy. But I
may be able to share a few points.
1) USB drivers are a PnP drivers, so I would not specify Legacy='Yes'.
Just let wix use the default value.
2) I also don't specify Component/@SharedDllRefCount as it is an old
reference counting mechanism which I understood is only useful when a DLL
is being shared between non-msi based setup technologies. Others may
provide more details.
https://blogs.msdn.microsoft.com/heaths/2009/12/21/about-shared-components/
3) When a PnP driver is installed, it is always copied to the Driver Store
(on Vista or later) by the PnPManager/Class Installer and then installed
from that location. Use pnputil.exe (a system tool) to view the driver
store (or clean up entries). I would never try to create the folder or
copy files directly to the driver store area, as I believe that results in
unsupported behavior.
4) Regarding the failure to copy the driver to the driver store, I would
enable verbose driver setupapi logging and evaluate the setupapi.dev.log
typically in C:\Windows\INF
https://msdn.microsoft.com/en-us/windows/hardware/drivers/install/setting-setupapi-logging-levels
This behavior of not copying the driver to the driver store usually means
that there is a driver ranking issue, and since you indicated that this
driver is having an issue on this version of the OS, it may be that the
author did not specify that version of the OS as supported when the driver
was code signed. The verbose setupapi log will tell the story as to the
root cause of the problem.
https://msdn.microsoft.com/en-us/windows/hardware/drivers/install/how-setup-ranks-drivers--windows-vista-and-later-
https://msdn.microsoft.com/en-us/windows/hardware/drivers/install/overview-of-the-driver-selection-process
https://msdn.microsoft.com/en-us/windows/hardware/drivers/install/driver-rank-information-in-the-setupapi-log
On Mon, Mar 20, 2017 at 5:14 PM, Jon Earle <earlej at hotmail.com> wrote:
> We have a Windows Server 2012R2 box, onto which I am attempting to install
> our product. One installation option of our product, is to install a USB
> driver for our device. The server is a real box (not a VM with passthrough)
> with the USB device attached.
>
> The installation is failing for this particular device; other USB drivers
> for unrelated devices can be installed without issue. It is also failing
> on this particular server, others, incl VMs, work without issue. Installer
> built with WiX 3.10.3.
>
> The relevant wix code. The actual code in our fragment file contains
> actual GUID values (not '*').
>
> <Fragment>
> <DirectoryRef Id="INSTALLDIR">
> <Directory Id="$(var.DriverID)" Name="TroublesomeUSBDriver">
> <Component Id="USBDriver_Driver" Guid="*" KeyPath="yes"
> SharedDllRefCount="yes" Win64="$(var.Win64)">
> <Driver AddRemovePrograms="no" DeleteFiles="yes"
> Legacy="yes" PlugAndPlayPrompt="no" Sequence="1" xmlns="http://schemas.
> microsoft.com/wix/DifxAppExtension" />
> <CreateFolder/>
> </Component>
>
> <!-- INF file -->
> <Component Id="USBDriver_inf_Win7" Guid="*" KeyPath="yes"
> SharedDllRefCount="yes" Win64="$(var.Win64)">
> <File Id="TroublesomeUSBDevice.inf_win7"
> Name="TroublesomeUSBDevice.inf" Vital="no" DiskId="1"
> Source="$(var.DRIVER_SRC_DIR)\TroublesomeUSBDevice.inf" />
> </Component>
>
> <!-- catalog file -->
> <Component Id="USBDriver_cat_Win7" Guid="*"
> KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
> <File Id="TroublesomeUSBDevice_.cat_win7"
> Name="TroublesomeUSBDevice_.cat" Vital="no" DiskId="1"
> Source="$(var.DRIVER_SRC_DIR)\TroublesomeUSBDevice_.cat" />
> </Component>
>
> <!-- x86 system file -->
> <Directory Id="X86_$(var.G5_ID)" Name="x86">
> <Component Id="USBDriver_sys32_Win7" Guid="*"
> KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
> <File Id="TroublesomeUSBDevice.sys32_win7"
> Name="TroublesomeUSBDevice.sys" Vital="no" DiskId="1"
> Source="$(var.DRIVER_SRC_DIR)\X86\TroublesomeUSBDevice.sys" />
> </Component>
> </Directory>
>
> <!-- x64 system file -->
> <Directory Id="AMD64_$(var.G5_ID)" Name="AMD64">
> <Component Id="USBDriver_sys64_Win7" Guid="*"
> KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
> <File Id="TroublesomeUSBDevice.sys64_win7"
> Name="TroublesomeUSBDevice.sys" Vital="no" DiskId="1"
> Source="$(var.DRIVER_SRC_DIR)\AMD64\TroublesomeUSBDevice.sys" />
> </Component>
> </Directory>
>
> </Directory>
> ...
> <Fragment>
> <ComponentGroup Id="USBDriver_and_Tools">
> <ComponentRef Id="USBDriver_inf_Win7" />
> <ComponentRef Id="USBDriver_sys64_Win7" />
> <ComponentRef Id="USBDriver_sys32_Win7" />
> <ComponentRef Id="USBDriver_cat_Win7" />
> <ComponentRef Id="USBDriver_Driver" />
>
> The driver is failing with:
>
> DIFXAPP: ENTER: InstallDriverPackages()
> DIFXAPP: INFO: 'CustomActionData' property 'DIFxApp Version' is '2.1'.
> DIFXAPP: INFO: 'CustomActionData' property 'UI Level' is '5'.
> DIFXAPP: INFO: 'CustomActionData' property 'componentId' is
> '{80619707-A4B1-4049-8DBE-D5C682D44079}'.
> DIFXAPP: INFO: 'CustomActionData' property 'componentPath' is
> 'C:\Program Files\MyCompany\MyProduct\TroublesomeUSBDriver\'.
> DIFXAPP: INFO: 'CustomActionData' property 'flags' is 0x1E.
> DIFXAPP: INFO: 'CustomActionData' property 'installState' is '2'.
> DIFXAPP: INFO: 'CustomActionData' property 'ProductName' is 'Coyote
> Client 7.0.0'.
> DIFXAPP: INFO: 'CustomActionData' property 'ManufacturerName' is 'Acme
> Inc.'.
> DIFXAPP: INFO: user SID of user performing the install is
> 'S-1-5-21-2541645536-3375437705-2618122102-500'.
> DIFXAPP: INFO: opening HKEY_USERS\S-1-5-21-2541645536-3375437705-
> 2618122102-500\Software\Microsoft\Windows\CurrentVersion\DIFxApp\
> Components\{80619707-A4B1-4049-8DBE-D5C682D44079} (User's SID:
> 'S-1-5-21-2541645536-3375437705-2618122102-500') ...
> DIFXAPP: INFO: ENTER: DriverPackageInstallW
> DIFXAPP: WARNING:DRIVER_PACKAGE_LEGACY_MODE flag set but not
> supported on Plug and Play driver on VISTA. Flag will be ignored.
> DIFXAPP: INFO: Installing INF file 'C:\Program
> Files\MyCompany\MyProduct\TroublesomeUSBDriver\TroublesomeUSBDevice.inf'
> (Plug and Play).
> DIFXAPP: INFO: Could not open file C:\Windows\System32\
> DriverStore\FileRepository\TroublesomeUSBDevice.inf_
> amd64_a1a4a56e5081c229\TroublesomeUSBDevice.inf. (Error code 0x3: The
> system cannot find the path specified.)
> DIFXAPP: ERROR: PnP Install failed. (Error code 0x3EE: The volume for
> a file has been externally altered so that the opened file is no longer
> valid.)
> DIFXAPP: INFO: Attempting to rollback ...
> DIFXAPP: INFO: No devices to rollback
> DIFXAPP: INFO: RETURN: DriverPackageInstallW (0x3EE)
> DIFXAPP: ERROR: encountered while installing driver package
> 'C:\Program Files\MyCompany\MyProduct\TroublesomeUSBDriver\
> TroublesomeUSBDevice.inf'
> DIFXAPP: ERROR: InstallDriverPackages failed with error 0x3EE
> DIFXAPP: RETURN: InstallDriverPackages() 1006 (0x3EE)
> CustomAction MsiInstallDrivers returned actual error code 1603 (note
> this may not be 100% accurate if translation happened inside sandbox)
> Action ended 14:38:13: InstallFinalize. Return value 3.
>
> I have googled the error message and found no answers. One site suggested
> creating the missing folder (TroublesomeUSBDevice.inf_amd64_a1a4a56e5081c229,
> in this case) and populating it with the content provided (I copied the
> content from another, working instance) and running the install. I found
> that, that worked, I could install the driver, but, it had an oddball side
> effect where, attempting to uninstall via control panel resulted instead,
> in the app attempting to install again (rather than uninstall).
>
> Cleaning the system does not help.
>
> So, primarily, I am trying to understand why it's broken, but, another
> question I have is, why is the driver being installed from a copy-target
> location, vs the installed location?
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
More information about the wix-users
mailing list