spacefight
27th September 2005 15:18 UTC
ExecWait to Program which requires newly added PATH
Hi Forum,
My NSIS script installs Perl via ExecWait to msiexec silently. The Perl Installation Wizard adds the path to perl to the PATH variable. After installing Perl, I want to install Perl modules via ExecWait to PPM (the perl package manager).
This step fails because the newly started ExecWait thread/program/whatever does not see the path to perl added by the Perl Installer.
If I open a new shell window after the installation is done and start PPM, it works, so the path is then correctly loaded.
Now my Question:
Is there a method for an installation script to add a directory to the PATH value so that later ExecWaits within the same installation script can use it?
If the PATH to perl is set before PPM runs, it all works fine.
Thanks for any hints,
spacefight
Code Snippet:
; install perl which adds C:\perl\bin\perl.exe to the PATH variable
ExecWait 'msiexec /i "$INSTDIR\ActivePerl-5.8.7.813-MSWin32-x86-148120.msi" /qn INSTALLDIR=C:\perl\ PERL_PATH="Yes" /l $INSTDIR\perlinstall.log'
[..]
; install IO-stringy module
ExecWait 'c:\perl\bin\ppm.bat install $INSTDIR\perl\IO-stringy.ppd'
kichik
27th September 2005 17:19 UTC
You'll find your answer in the following Wiki page:
http://nsis.sourceforge.net/wiki/Set...taller_Process
spacefight
28th September 2005 07:41 UTC
Thanks,
Your plugin worked, the 1st option didn't work on XP either. I'd suggest that you remove this option from the wiki page in order to avoid having people trying without success.
spacefight
spacefight
28th September 2005 10:13 UTC
Oops.
I have to restate: your plugin does not work as supposed. The processes started by the ExecWaits after the Plugin call do not have the correct path set, so they fail.
Is there a way to verify that the plugin does what it's supposed to?
deguix
28th September 2005 10:18 UTC
Could you try that option again? I fixed a bug that a string wasn't being delimited as it should on the System plug-in call. (I just didn't test it :()
spacefight
28th September 2005 10:24 UTC
deguix: What option are you talking about?
spacefight
28th September 2005 10:34 UTC
Ah you changed the wiki page. Well it does not work with your changes (the quotes around PATH) either.
spacefight
28th September 2005 11:09 UTC
On the wiki page, it should be
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$R0").r0'
so R0 as well in quotes. Then it works. No need for the plugin at all.
deguix
28th September 2005 11:55 UTC
Sorry 'bout that. Forgot to add those to $R0 also...
spacefight
28th September 2005 12:02 UTC
Ok thanks.