I am using NSIS to install an executable (A), as well as run a third party installer for their drivers (B, Matlab Compiler Runtime, done with ExecWait), then run the executable (A) so the user can check a few other things. For some reason the installation of the third party drivers is not recognised. This is only a problem when I launch the executable (A) from within my NSIS installer. If I launch it manually it works. If the third party drivers were already installed (eg if I run the installer twice) it works. Waiting a long time does not work. I can leave the NSIS installer open and launch executable A manually, and it will work, then come back to the NSIS installer and launch from there and it still does not work. I am using buttons to launch executable A from within the NSIS installer.
I have tried Exec, Execwait, nsExec::Exec and ExecShell. Makes no difference.
I would prefer not to have to reboot the PC, as it should not be necessary, and the code I found for that gives me a headache. There is just something in the way that NSIS launches the executable that is causing problems. Maybe the user type, or it is somehow only aware of the drivers that were present when it started, and passes that on to the executable.
It is a pain to debug, as the drivers take a long time to install and uninstall.
New drivers not recognised
4 posts
Perhaps something to do with environment variables? %path%? Exec Foo.exe and then Exec Bar.exe will not let Bar.exe see things set by Foo.exe.
Something like that. Setup.exe runs installerB.exe, and then runs executableA, which cannot see the output of installerB.exe, regardless of how much time passes.
A workaround might be to restart the NSIS installer. I have found a script for rebooting the PC mid installation, but not a simpler one that just restarts the installer.
A workaround might be to restart the NSIS installer. I have found a script for rebooting the PC mid installation, but not a simpler one that just restarts the installer.
Without the driver installed, check the environment variables by running "set" in cmd.exe. Then install the driver and run a new cmd.exe from the start menu and check again.
Variables can be applied to the installer process and will then apply to child process B:
Variables can be applied to the installer process and will then apply to child process B:
System::Call 'Kernel32::SetEnvironmentVariable(t "DRIVERTHING", t "$InstDir")'
Exec '"$InstDir\ChildB.exe"'