[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Setting Windows Environment Variables

Cameron, Gemma (UK)

8/14/2006 4:44:00 PM


Thanks a lot Jan.

Think I'll stick to the original idea of using NSIS to set up the machine...

Regards

Gem


-----Original Message-----
From: Jan Svitok [mailto:jan.svitok@gmail.com]
Sent: 14 August 2006 17:08
To: ruby-talk ML
Subject: Re: Setting Windows Environment Variables


*** WARNING ***

This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.

On 8/14/06, Cameron, Gemma (UK) <gemma.cameron@baesystems.com> wrote:
>
> Hi all!
>
> I'm another Ruby noob and wondered if any of you can help me with my problem.
>
> I've have been tasked with writing some rake files to automate parts of our project and to begin I'm trying to automate the setup of the build machine. The first task is to set the environment variables.
>
> Can this be done in Ruby without using system("%PATH% = %PATH%;c:\ruby\bin") etc.?
>
> Thanks in advance!!!! ( :

ENV['PATH'] += "c:\ruby\bin"

will be vaild only in processes that you'll start from your script, in
other words, you cannot modify parent environment. (you could do by
some batch file wizardry)

J.



********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

2 Answers

Jeff Schwab

8/14/2006 4:47:00 PM

0

Cameron, Gemma (UK) wrote:
> -----Original Message-----
> From: Jan Svitok [mailto:jan.svitok@gmail.com]
> Sent: 14 August 2006 17:08
> To: ruby-talk ML
> Subject: Re: Setting Windows Environment Variables
>
>
> *** WARNING ***
>
> This mail has originated outside your organization,
> either from an external partner or the Global Internet.
>
> Keep this in mind if you answer this message.


Heheheh. :)

Jano Svitok

8/14/2006 5:19:00 PM

0

On 8/14/06, Cameron, Gemma (UK) <gemma.cameron@baesystems.com> wrote:
>
> Thanks a lot Jan.
>
> Think I'll stick to the original idea of using NSIS to set up the machine...

If you need to setup machine's global environment, maybe you can use
Win32OLE or Win32/registry modules (actually I don't have a clue how
it's done orm where it's stored except for manual clicking ;-)

I've used Win32OLE (i.e. COM interface) for (partially) configuring
machine via WMI.

J.