views:

54

answers:

1

i try installing a driver in a Windows 7 x64 environment, by using cmd, and a nsis installer made from a script

from cmd i do for example:

 InfDefaultInstall C:\kit\driver\win7-64\my_driver.inf

from nsis i do (this is the line from the script):

 Exec 'InfDefaultInstall $INSTDIR\driver\win7-64\my_driver.inf'

the inf file should copy a .sys file in the Windows\system32\drivers folder and write some stuff in the registry

problem is, that it happens in cmd, and it doesn't happen if using nsis installer (i mean it appears like it's doing it, but the .sys file doesn't go where it should go)

also, at uninstall i do from the nsis script:

Delete '$WINDIR\system32\drivers\my_driver.sys'

this command doesn't delete the sys file (which went where it should because i ran the cmd line command AFTER the installation)

==

all tests done running with an administrator account, UAC disabled, also tried right click run as admin on the installer, but it just won't copy it

==

i tried this on windows xp

Exec 'rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 $INSTDIR\driver\win7-64\my_driver.inf'

and works perfectly (from cmd and the nsis script)

also tried this command on win7 and i got same not working results. ALSO tried it on vista x86, so i don't think it's an architecture problem, but something like permissions, or uac-related (although uac is not enabled)

+1  A: 

I doubt it matters in your case, but you should be quoting your paths: Exec 'InfDefaultInstall "$INSTDIR\driver\win7-64\my_driver.inf"' etc

You should include the x64.nsh file and call the DisableX64FSRedirection macro (You probably also want to use $sysdir and not $WINDIR\system32)

As far as the InfDefaultInstall command goes, maybe the current/working directory matters, you can set it in nsis with SetOutPath

Anders
if i try quotes, i get an error message saying something like cannot install driver with an ok button (cmd and nsis too)
andrew
Well I assume $INSTDIR can be changed by the user, so unless InfDefaultInstall has special command line handling, you could run into trouble with spaces
Anders
i think the problem was because i didn't used the DisableX64FSRedirection macro.. coz now it's working
andrew