Driver upgrade requires a scan for new hardware - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

blaze
Posts: 16
Joined: Wed May 23, 2007 7:16 pm
Location: Macrovision
Contact: Website

Driver upgrade requires a scan for new hardware

Hello,

I am deploying a product built with AI 5.0 to private WinXP systems. I have noticed that when we upgrade our product to a new version, the new device drivers are not automatically available. Sometimes a manual scan for new hardware is necessary and sometimes we need to manually uninstall each driver then trigger a scan for new hardware.

I am into a region of Windows that I do not understand ;-/ I have found a Microsoft document that suggests that a call to the UpdateDriverForPlugAndPlayDevices function ought to load the new driver without manual intervention.

http://www.microsoft.com/whdc/system/pn ... eboot.mspx

Can the UpdateDriverForPlugAndPlayDevices function be called by AI 5.0 or 5.1.1?

Thanks
--Blaze
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Blaze,

What exactly you are using to install the driver, DIFX? Please give me more details.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
blaze
Posts: 16
Joined: Wed May 23, 2007 7:16 pm
Location: Macrovision
Contact: Website

Hello,

I am using AI 5.x to install the drivers so I think DIVx is implied. I added each driver to the list of "Driver Packages" by providing the path to each INF file.

I am using two drivers for a Crystalfontz LCD display device, one driver for a TechniSat ATSC tuner card, and one driver for a Norpak MPEG-2 multiplexer card (I wrote the INF file for this driver).

Is that helpful?
--Blaze
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Blaze,
I am deploying a product built with AI 5.0 to private WinXP systems. I have noticed that when we upgrade our product to a new version, the new device drivers are not automatically available. Sometimes a manual scan for new hardware is necessary and sometimes we need to manually uninstall each driver then trigger a scan for new hardware.

I am into a region of Windows that I do not understand ;-/ I have found a Microsoft document that suggests that a call to the UpdateDriverForPlugAndPlayDevices function ought to load the new driver without manual intervention.
We shall investigate this. I have added this on our TODO list. Thank you for your suggestion.

Meantime maybe you can achieve what you want with a custom action but I'm afraid I don't have more informations on this.

http://www.advancedinstaller.com/user-g ... -page.html

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
blaze
Posts: 16
Joined: Wed May 23, 2007 7:16 pm
Location: Macrovision
Contact: Website

Hello Gigi,

Given the DIFx reading material I used the Microsoft Driver Kit to fix-up and sign all four of the drivers in our product. That fixed the unattended installation issue. We had a further problem that when upgradding the previous devices were not fully unloaded before the new product was installed. Fixing this was a matter of using Microsoft's DevCon utility both within the install and the uninstall process.

I'll include a few documents below. The 1st is a writeup on creating a signable driver catalog. The 2nd is a writeup on creating a test signature and signing a driver. The 3rd is commands we added to our install and out uninstall to fix up the device PnP loading.

--Blaze


-------------------------------------------------------------------------------
How To Create Signable Driver Catalog
-------------------------------------------------------------------------------

Code: Select all

1.  Driver Kit

  Install:
    'Windows Driver Kit 6001' (CD)
    'Microsoft Winqual Submission Tool'

    Note: You can find useful tools and documentation within the
          'Microsoft Windows Driver Development Kit' (CD).

-------------------------------------------------------------------------------

2.  Driver requirements

  For a driver to be signable and support Plug and Play the driver must comply
  with the details outlined in the following documents:
    * Requirements for Driver Packages that are Used with the Driver Install
      Framework (DIFx) Tools
    * Using Authenticode to Digitally Sign Driver Packages

-------------------------------------------------------------------------------

3.  Update the driver inf to have DriverPackageType and CatalogFile entries.

  For a fictious Plus and Play toaster device the driver would contain:

    [Version]
    ...
    DriverPackageType = PlugAndPlay
    CatalogFile       = toaster.cat
    ...

-------------------------------------------------------------------------------

4.  Find and repair problems within driver inf file.

  Use the tool chkinf to analize each driver's inf file.  The tool builds two
  HTML report files within an 'htm' directory of the driver being analized.
  Open the HTML reports, fix the reported errors and evaluate the warnings.

  For a fictious Plus and Play toaster device the command would be:

    c:\winddk\6001\tools\chkinf\chkinf.bat toaster.inf

-------------------------------------------------------------------------------

5.  Generate a signable catalog file for driver

  Copy all the driver files into an empty directory.  Do not have any extra
  files within the directory as they will be listed within the generated
  catalog file.

    Note: You could run the signability.exe tool, but it failed after my
          initial success.  Identical failures discussed on the internet
          suggest using the inf2cat tool instead.

  For a fictious Plus and Play toaster device the command would be:

    "C:\Program Files\Microsoft Winqual Submission Tool 2\Inf2Cat"
        /driver:. /os:XP_X86 /v

    Note: The driver for TechniSat ATSC Tuner may be configured to support
          Windows XP 32-bit and 64-bit.

    Note: The generated catalog file is not human readable.
-------------------------------------------------------------------------------
How To Create Signature And Sign Driver
-------------------------------------------------------------------------------

Code: Select all

1.  Driver Kit

  Install:
    'Windows Driver Kit 6001' (CD)

-------------------------------------------------------------------------------

2.  Create a test Software Publisher Certificate (SPC)

  First, delete any old certificate from the Personal certificate store for the
  fictious company "toad":

    C:\WINDDK\6001\bin\SelfSign\certmgr -del -c -n "www.toad.com" -s My

  Now, create the new certificate for the fictious company "toad" and store it
  in the certificate store:

    C:\WINDDK\6001\bin\SelfSign\makecert -r -pe -ss My -n "CN=www.toad.com"
        -b 01/01/2001 -e 12/31/9999

    Note: This command generates X.509 certificate for testing purposes only.
          This sample command generates a self-signed certificate; the
          generated private key is exportable (included within certificate);
          the certificate store name is 'My' (aka Personal); the subject's
          simple certificate name conforming to X.500 is "CN=www.toad.com";
          the start of the validity period is 01/01/2001 and the end of the
          validity period is 12/31/9999.

  Displays the content of the Personal certificate store.

    C:\WINDDK\6001\bin\SelfSign\certmgr -s My

  Now, launch the certificate manager GUI.  The new certificate will be listed
  as a Personal certificate.

    C:\WINDDK\6001\bin\SelfSign\certmgr

    1.  Export the "www.toad.com" certificate with these settings:
        * Do not export the private key
        * DER encoded binary X.509
        * Filename: TOAD_Certificate.cer

    2.  Export the "www.toad.com" private key with these settings:
        * Export the private key
        * Enable strong protection
        * No password protection
        * Filename: TOAD_Certificate.pfx

  Delete the new certificate from the Personal certificate store.

    C:\WINDDK\6001\bin\SelfSign\certmgr -del -c -s My -n "www.toad.com"

-------------------------------------------------------------------------------

3.  Sign the driver catalog file with a Software Publisher Certificate (SPC)

  For a fictious company "toad" with a fictious Plug and Play toaster device
  the signing command would be:

    C:\WINDDK\6001\bin\SelfSign\signtool sign -v -f TOAD_Certificate.pfx toaster.cat

    Note: This command signs the catalog file of a Plug and Play driver with a
          Software Publisher Certificate (SPC).  This sample command signs the
          catalog file using the SPC found within the certificate store 'My'.

    Note: The signtool may sign using our certificate within the Personal
          certificate store.  To do this you would replace the signtool
          arguments
              -f TOAD_Certificate.pfx 
          with
              -s My -n "www.toad.com"
          (This assumes that our certificate is in the Personal certificate
           store.)

    Note: To load our certificate into the Personal certificate store, launch
          the certificate manager GUI and import the certificate:

          C:\WINDDK\6001\bin\SelfSign\certmgr

          Import the "www.toad.com" certificate with these settings:
          * Filename: TOAD_Certificate.pfx
          * Place the certificate into the Personal certificate store

-------------------------------------------------------------------------------

4.  Install the certificate on the target system

  These two commands add the certificate in the file TestCertTOAD.cer to the
  Trusted Root Certification Authorities certificate store and the Trusted
  Publishers certificate store.

    C:\WINDDK\6001\bin\SelfSign\certmgr -add TOAD_Certificate.cer -s -r localMachine root
    C:\WINDDK\6001\bin\SelfSign\certmgr -add TOAD_Certificate.cer -s -r localMachine trustedpublisher
-------------------------------------------------------------------------------
Install script device PnP juggling to ensure clean installs
-------------------------------------------------------------------------------

Code: Select all

@ECHO * Step 1: Disable and remove devices.
%1"\Installer\DevCon\devcon" disable PCI\VEN_13D0
%1"\Installer\DevCon\devcon" remove PCI\VEN_13D0
%1"\Installer\DevCon\devcon" disable PCI\VEN_1666
%1"\Installer\DevCon\devcon" remove PCI\VEN_1666
%1"\Installer\DevCon\devcon" disable FTDIBUS\COMPORT*
%1"\Installer\DevCon\devcon" remove FTDIBUS\COMPORT*
%1"\Installer\DevCon\devcon" disable USB\VID_0403*
%1"\Installer\DevCon\devcon" remove USB\VID_0403*

@ECHO * Step 2: PnP hardware scan...
%1"\Installer\DevCon\devcon" rescan

@ECHO * Step 3: Wait while OS catches up with PnP device loading...
ping 127.0.0.1 -n 20 -w 1000 > nul

@ECHO * Step 4: Enable devices.
%1"\Installer\DevCon\devcon" enable PCI\VEN_13D0
%1"\Installer\DevCon\devcon" enable PCI\VEN_1666
%1"\Installer\DevCon\devcon" enable USB\VID_0403*
%1"\Installer\DevCon\devcon" enable FTDIBUS\COMPORT*

@ECHO * Step 5: Update PnP device drivers...
START /WAIT RunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers

@ECHO * Step 6: Enable devices.
%1"\Installer\DevCon\devcon" enable PCI\VEN_13D0
%1"\Installer\DevCon\devcon" enable PCI\VEN_1666
%1"\Installer\DevCon\devcon" enable USB\VID_0403*
%1"\Installer\DevCon\devcon" enable FTDIBUS\COMPORT*
-------------------------------------------------------------------------------
Uninstall script device PnP juggling to ensure clean uninstalls
-------------------------------------------------------------------------------

Code: Select all

@ECHO * Step 1: Disable and remove devices.
%1"\Installer\DevCon\devcon" disable PCI\VEN_13D0
%1"\Installer\DevCon\devcon" remove PCI\VEN_13D0
%1"\Installer\DevCon\devcon" disable PCI\VEN_1666
%1"\Installer\DevCon\devcon" remove PCI\VEN_1666
%1"\Installer\DevCon\devcon" disable FTDIBUS\COMPORT*
%1"\Installer\DevCon\devcon" remove FTDIBUS\COMPORT*
%1"\Installer\DevCon\devcon" disable USB\VID_0403*
%1"\Installer\DevCon\devcon" remove USB\VID_0403*

@ECHO * Step 2: Update PnP device drivers...
START /WAIT RunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers

Return to “Feature Requests”