Sign in to follow this  
Followers 0
van_renier

Updating ENV within au3 script?

6 posts in this topic

I'm using a script to install a program, which installs files to flder (possibly new install or possible upgrade of existing files), adds some services to the system, etc...

Using EnvUpdate, though, appears to only update the OS environment with changes we've made, but does not update the AutoIt script as it's running. Spawning a new @COMSPEC (using Run/Runwait) doesn't work either, as those as just children of the original, and they inherit the ENV from the parent.

Anyone know of a way that I can;

Update a RUNNING Au3 script, with changes the installation of the program (that au3 is performing) has performed? (i.e. added new entries in the path statement, set new system variables, added services, etc...)

EnvUpdate() is not working for this.

Thanks for you time, effort, and thoughts,

Van

Share this post


Link to post
Share on other sites



what have you tried with code?

Sorry... meaning what; adding code in my Au3 script?

Or is 'code' a 3rd-party program?

Van

Share this post


Link to post
Share on other sites

Thanks. Although, it's not what I wanted to hear... it does answer my question... sort of.

(meaning I was hoping there was a way around this 'current' script ENV limitation.) :whistle:

That thread you referenced though, references the user's script(s) setting variables and such.

My au3 is kicking off an external installation program, waits for the external program to finish then continues.

After the external program finishes, the system has been updated with new values.

Anyone know if there is a way to update the environment which the current au3 script is using?

Kind of like a 'reverse' EnvUpdate() ; like Au3EnvUpdate()?

(I guess this would involve, reading each existing SYSTEM variable in, and performing an EnvSet() for each one, so the current script could make use of the new environment/values, right?)

Thanks again for your time effort and patience.

Van

Share this post


Link to post
Share on other sites

...My au3 is kicking off an external installation program, waits for the external program to finish then continues...........

At the point at which it continues, you could have the main script launch a secondary script. See AutoIt3ExecuteScript in this post: http://www.autoitscript.com/forum/index.ph...showtopic=22531

This would only be worth doing if you did not have a lot of variables to pass to the new script. These variables could be passed via a file write/read or STDIO. Or (as you mentioned) it might be easier to "reading each existing SYSTEM variable in" to the original script.

Or maybe others have a better work around..... Anyone?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0