Discussion:
[Unattended] Multiple-step setups, problem with "visibility" of new environment variables
Gerhard Hofmann
2011-03-11 09:16:01 UTC
Permalink
Hi all,

I have a problem concerning installation of Ingres RDBMS (for those of
you who don't know it, it's something like MySQL...) client software.

In the moment it looks like this.

todo.pl "%Z%\install\packages\ingresclientservicepack\setup.exe /silent"
todo.pl ".reboot"
todo.pl "%Z%\install\packages\ingresclient\setup.exe /silent"

(The switches are a little bit more complicated in reality, so the
above is somehow simplified...)

The reboot is necessary because the Ingres-Client software defines a
new environment variable II_SYSTEM (pointing to the Ingres
installation path) and the Ingres-Client-Servicepack setup *must see*
that variable in order to run through. If I leave out the reboot, the
service pack installation does not work.

So the question is: how can I achieve in "multiple step" scenarios
that the second step will see environment variables set by the first
step *without* having to reboot?

Regards
Gerhard
Juanjo Pablos
2011-03-11 11:07:14 UTC
Permalink
Post by Gerhard Hofmann
The reboot is necessary because the Ingres-Client software defines a
new environment variable II_SYSTEM (pointing to the Ingres
installation path) and the Ingres-Client-Servicepack setup *must see*
that variable in order to run through. If I leave out the reboot, the
service pack installation does not work.
So the question is: how can I achieve in "multiple step" scenarios
that the second step will see environment variables set by the first
step *without* having to reboot?
well, try to add a path for the user:

set II_SYSTEM=C:\Ingres

|reg add HKCU\Environment /v PATH /d "%II_SYSTEM%;%path%" /f|



http://superuser.com/questions/65816/setting-or-modifying-a-system-wide-environment-variable-in-cmd-exe
Gerhard Hofmann
2011-03-11 14:26:43 UTC
Permalink
Post by Juanjo Pablos
Post by Gerhard Hofmann
The reboot is necessary because the Ingres-Client software defines a
new environment variable II_SYSTEM (pointing to the Ingres
installation path) and the Ingres-Client-Servicepack setup *must see*
that variable in order to run through. If I leave out the reboot, the
service pack installation does not work.
So the question is: how can I achieve in "multiple step" scenarios
that the second step will see environment variables set by the first
step *without* having to reboot?
set II_SYSTEM=C:\Ingres
|reg add HKCU\Environment /v PATH /d "%II_SYSTEM%;%path%" /f|
http://superuser.com/questions/65816/setting-or-modifying-a-system-wide-environment-variable-in-cmd-exe
Hello Juanjo,

first of all, thanks for your response.

I have setup a little test case based on your suggestion.

***part1.bat***
set II_SYSTEM=C:\Ingres
reg add HKCU\Environment /v PATH /d "%II_SYSTEM%;%path%" /f
***part1.bat***

***part2.bat***
todo.pl "echo %PATH%"
***part2.bat***

***runallwithoutreboot.bat***
todo.pl "part2.bat"
todo.pl "part1.bat"
***runallwithoutreboot.bat***

I have executed runallwithoutreboot.bat using appsonly.bat

Unfortunately, the output of echo command in part2.bat will *not show* c:\Ingres

Logging off from Windows (or rebooting) + logging in + cmd.exe + path command
---> c:\Ingres is shown

So it was worth a trial but doesn't seem to solve the problem.

I wonder if the with-env.pl script would be useful for my scenario,
has anybody here used it and can give some examples?

Regards
Gerhard
Juanjo Pablos
2011-03-11 15:57:52 UTC
Permalink
Post by Gerhard Hofmann
So it was worth a trial but doesn't seem to solve the problem.
I wonder if the with-env.pl script would be useful for my scenario,
has anybody here used it and can give some examples?
Could you please upload the content of this script on the wiki.

https://sourceforge.net/apps/trac/unattended/wiki

it helps to test it.
Gerhard Hofmann
2011-03-11 16:21:22 UTC
Permalink
Post by Juanjo Pablos
Post by Gerhard Hofmann
So it was worth a trial but doesn't seem to solve the problem.
I wonder if the with-env.pl script would be useful for my scenario,
has anybody here used it and can give some examples?
Could you please upload the content of this script on the wiki.
https://sourceforge.net/apps/trac/unattended/wiki
it helps to test it.
with-env.pl is in the SVN trunk:
http://unattended.svn.sourceforge.net/viewvc/unattended/trunk/install/bin/with-env.pl?view=log

Should I upload to the WIKI anyway...?

Regards
Gerhard
Juanjo Pablos
2011-03-11 19:27:31 UTC
Permalink
Post by Gerhard Hofmann
Post by Juanjo Pablos
Post by Gerhard Hofmann
So it was worth a trial but doesn't seem to solve the problem.
I wonder if the with-env.pl script would be useful for my scenario,
has anybody here used it and can give some examples?
Could you please upload the content of this script on the wiki.
https://sourceforge.net/apps/trac/unattended/wiki
it helps to test it.
http://unattended.svn.sourceforge.net/viewvc/unattended/trunk/install/bin/with-env.pl?view=log
Should I upload to the WIKI anyway...?
I was talinkg about your script, no the with-env.pl
--
La mayor ventura es gozar de la coyuntura.
Gerhard Hofmann
2011-03-13 09:10:56 UTC
Permalink
Post by Gerhard Hofmann
Post by Juanjo Pablos
Could you please upload the content of this script on the wiki.
https://sourceforge.net/apps/trac/unattended/wiki
it helps to test it.
http://unattended.svn.sourceforge.net/viewvc/unattended/trunk/install/bin/with-env.pl?view=log
Should I upload to the WIKI anyway...?
I was talinkg about your script, no  the with-env.pl
It is in the scripts section of the WIKI, under "attachments".

Regards
Gerhard

Steven Blackery
2011-03-11 15:29:23 UTC
Permalink
Have you tried:

todo.pl "ingres-sp.bat"
todo.pl "%Z%\install\packages\ingresclient\setup.exe /silent"

And in your scripts folder, have ingres-sp.bat as follows:

set II_SYSTEM=C:\ingres
%Z%\install\packages\ingresclientservicepack\setup.exe /silent

That should work to enable your service pack installer see the environment variable, it won't last beyond that shell launched for the batch script to run in, but it doesn't need to.

Steven

--
Steven Blackery
ICST Support Manager

Direct: +44 (0)20 3006 4051
Mobile: +44 (0)7903 742112

E-mail: ***@steakdigital.co.uk
Web: www.steakdigital.co.uk

------------------------------------------------------------------------------------------
www.steakdigital.co.uk/blog www.facebook.com/BruceTheBull www.twitter.com/steakdigital
------------------------------------------------------------------------------------------

Steak Ltd, 62-70 Shorts Gardens, Covent Garden, London, WC2H 9AH
Reception: +44 (0)20 7420 3500 Fax: +44 (0)20 7420 3518

Registered Company No: 05349447. Registered in England & Wales
Registered Office: Tennyson House, 159 - 165 Great Portland Street, London. W1W 5PA
VAT Number: GB 918 5692 84

Steak Ltd is part of the Steak Group

------------------------------------------------------------------------
The information in this email is intended only for the addressee(s) named
above. Access to the email by anyone else is unauthorised. If you are
not the intended recipient of this message any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may
be unlawful. The sender does not warrant that any attachments are free
from viruses or other defects and accept no liability for any losses
resulting from infected email transmissions. Please note that any views
expressed in this email may be those of the originator and do not
necessarily reflect those of this organisation.
------------------------------------------------------------------------
Arne Lovius
2011-03-11 10:11:31 UTC
Permalink
If the variable is in effect a "fixed" path, how about setting the variable before the client is installed ?

http://vlaurie.com/computers2/Articles/environment.htm might be of use

Cheers

Arne



-----Original Message-----
From: Gerhard Hofmann [mailto:***@planat.de]
Sent: 11 March 2011 09:16
To: unattended-***@lists.sourceforge.net
Subject: [Unattended] Multiple-step setups, problem with "visibility" of new environment variables

Hi all,

I have a problem concerning installation of Ingres RDBMS (for those of
you who don't know it, it's something like MySQL...) client software.

In the moment it looks like this.

todo.pl "%Z%\install\packages\ingresclientservicepack\setup.exe /silent"
todo.pl ".reboot"
todo.pl "%Z%\install\packages\ingresclient\setup.exe /silent"

(The switches are a little bit more complicated in reality, so the
above is somehow simplified...)

The reboot is necessary because the Ingres-Client software defines a
new environment variable II_SYSTEM (pointing to the Ingres
installation path) and the Ingres-Client-Servicepack setup *must see*
that variable in order to run through. If I leave out the reboot, the
service pack installation does not work.

So the question is: how can I achieve in "multiple step" scenarios
that the second step will see environment variables set by the first
step *without* having to reboot?

Regards
Gerhard
Loading...