Installing a driver in NSIS script

痴心易碎 提交于 2019-12-10 18:33:59

问题


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?


回答1:


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}


来源:https://stackoverflow.com/questions/20293299/installing-a-driver-in-nsis-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!