Installing a driver in NSIS script
Asked Answered
G

1

3

I'm trying to create an NSIS installer that installs an inf file. The inf file is extracted from the installer to the correct place, and then I use:

nsExec::ExecToLog '"$SYSDIR\PnPutil.exe" /a "$INSTDIR\driver\xser.inf"'

However, the command does not seem to get executed at all - the install log doesn't print anything - not success nor failure. I've checked thoroughly the command line and it points to the right PnPutil path. I've also checked that it's being run with administrator privileges and it also looks correct. Replacing PnPutil.exe with a different executable in the System32 directory also seem to work without any problem. What am I missing here?

Gautea answered 29/11, 2013 at 21:0 Comment(0)
B
5

If this only happens on 64bit systems you can try to disable FS redirection around the call to nsExec::ExecToLog by using the macros in x64.nsh:

!include x64.nsh
${DisableX64FSRedirection}
nsExec::ExecToLog '"$SYSDIR\PnPutil.exe" /a "$INSTDIR\driver\xser.inf"'
${EnableX64FSRedirection}
Brouhaha answered 29/11, 2013 at 21:27 Comment(1)
so obvious but I spent a lot of time not thinking of this option even though I have done this elsewhere in my install script, thank you.Blotter

© 2022 - 2024 — McMap. All rights reserved.