Error spawning a command prompt
I am seeing some odd behavior when spawning a command prompt from an NSIS installer. Specifically, I am trying to run the following command:
rundll32.exe setupapi.dll,InstallHInfSection DefaultInstall 132 myInf.inf
This will install a filter driver on Windows. If I run this command from a command prompt without using the installer, everything works just fine (it creates the necessary registry entries from the .inf file and copies my .sys file to \Windows\System32\drivers). However, if I try and run this from the installer using something like
nsExec::Exec '"rundll32.exe" setupapi.dll,InstallHInfSection DefaultInstall 132 myInf.inf'
it kind of works. I say 'kind of' because only the registry entries are created but the .sys file is not being copied (and no error is returned). This seems to indicate an error registering the driver even though no error is returned. I have made sure that I am running this command from the directory which contains 'myInf.inf'.
As an experiment, I ran the following:
ReadEnvStr $R0 COMSPEC
Exec '"$R0" start cmd.exe'
This opens up a command prompt that I can now interact with. If I type the rundll32 command in here directly, I still see the odd behavior that my .sys file is not being copied but no error is being returned. Is there some issue I don't know about when spawning a command prompt from the installer? This is incredibly frustrating and seemingly inexplicable. The fact that my registry entries are being created from the .inf file and no errors are returned, seems to suggest that it should work even though it isn't. Any input is appreciated.