Installing drivers from NSIS installer in x64 system
Asked Answered
A

4

8

I want to add support for x64 OSes to my NSIS installer. One of the installer's task is drivers installation. I've written a special NSIS plugin for this task. This plugin uses Driver Install Frameworks API (DIFxAPI) to install drivers.

The problem is that this API does not work in WOW64.

Is there any way to create x64 installer application with NSIS? Has anybody solved similar problem with NSIS?

P.S.: The only solution I can see now is to run another application from the installer. This will be x64 executable that installs drivers. But this way seems somewhat harder to me. So, I'm interested in other solutions.

Anneal answered 17/3, 2010 at 18:27 Comment(0)
C
13

I am encountering a similar problem and I think that the only solution at the moment is to run something else (64bit) via CreateProcess.

This doc appears to have a solution using DPInst (http://www.microsoft.com/whdc/driver/install/32-64bit_install.mspx) though I have not tried it myself yet.

Will add anything else I find.

Additional: Have now got it to work, boils down to

  1. Download Windows Driver Kit Version 7.1.0
  2. Mount the ISO and install Full Development Environment->Tools to C:\
  3. Copy C:\WinDDK\7600.16385.1\redist\DIFx/dpinst/EngMui/amd64/dpinst.exe to myApp/drivers/dpinst64.exe
  4. Copy C:\WinDDK\7600.16385.1\redist\DIFx/dpinst/EngMui/x86/dpinst.exe to myApp/drivers/dpinst32.exe
  5. Copy your driver package (inf file etc.) to myApp/drivers
  6. To the top of myApp.nsi add !include "x64.nsh"
  7. And somewhere in the install section in myApp.nsi add:

${If} ${RunningX64}
       ExecWait '"$INSTDIR\drivers\dpinst64.exe" /c /q /sa /sw /PATH 
"$INSTDIR\drivers"'
    ${Else}
       ExecWait '"$INSTDIR\drivers\dpinst32.exe" /c /q /sa /sw /PATH 
"$INSTDIR\drivers"'
    ${EndIf}
Chowchow answered 30/4, 2010 at 14:44 Comment(3)
Thanks! I've already tried using dpinst, and it worked for me.Anneal
Great idea! this link have a link to a .zip file containing just both versions of dpinst, then you don't have to download the whole WDK.Selfexamination
As an added note, if the driver you are installing is unsigned, make sure you omit the /q since it will automatically choose not to install the driver and not return an error. The unsigned driver message will pop up and the user will have to select the install anyway option.Terribly
G
2

A native x64 version of NSIS is in the planning stages at best, so you will have to create something custom, either a new helper application, or a 64-bit version rundll32 + some sort of helper DLL file.

Gracious answered 17/3, 2010 at 21:3 Comment(0)
G
2

I'm specifically trying to install a file system filter driver on x64 from the NSIS installer using an INF file.

On 32 bit I can quite happily call:

ExecWait '$SYSDIR\RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 $INSTDIR\<myinf>.inf'

But... on x64 even with the file redirection turned off using ${DisableX64FSRedirection} it still does a WOW64 thing...

I found that to get RUNDLL32.EXE to work properly on x64 from NSIS, you need to also set the registry view to be 64 as well:

    ${If} ${RunningX64}
        ${DisableX64FSRedirection}
        SetRegView 64
    ${EndIf}

    ExecWait '$SYSDIR\RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 $INSTDIR\<myinf>.inf'
Gt answered 22/3, 2011 at 9:37 Comment(0)
G
2

Just for reference: https://bitbucket.org/dgolub/nsis64

Glutenous answered 20/6, 2012 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.