Author Topic: How to add to the workspace environment PATH variable?  (Read 5048 times)

mjdl

  • Senior Community Member
  • Posts: 151
  • Hero Points: 18
  • SE Pro 2023 v28.0.2.0 64-bit Qt5 Win 11 23H2
How to add to the workspace environment PATH variable?
« on: March 29, 2011, 05:30:24 PM »
I can't figure this out using the latest SE 15 on Windows 7 SP1 x64:

I need to add directories to the inherited system PATH environment variable in the Workspace Environment Properties dialog for a particular workspace.

None of these work in that dialog:

set PATH=C:\Foo\Bar;%(PATH)
set PATH=C:\Foo\Bar;%PATH%
set PATH=C:\Foo\Bar;%(%PATH%)

Executing echo %PATH% on the build window command line just shows that PATH has been set to the literal value of the set command without substituting the value of the existing PATH environment variable.

I'm really surprised that there is no way of expanding inherited environment variables via the Workspace Environment variables dialog, only setting literal values! It seems such an obvious way of extending PATH, INCLUDE, LIB, etc. environment variables inherited from the Slickedit environment to apply to an entire workspace.

The other thing I've been surprised about, is that the value of a workspace PATH variable set in this way persists even after the workspace is closed and the build shell in the build window has been exited (via typing "exit" on the command line). On restaring the build window shell, the prior workspace's settings seem to have changed Slickedit's own values for these environment variables inherited from the system environment; e.g., I have to restart Slickedit to get back the PATH inherited from the system.

What am I doing wrong here, have misunderstood? I just want to reference and change environment variables inherited from the system environment on a workspace by workspace basis!

« Last Edit: March 29, 2011, 05:32:28 PM by mjdl »

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Re: How to add to the workspace environment PATH variable?
« Reply #1 on: March 30, 2011, 03:36:15 PM »
I went through this awhile ago and ended up with the following:

http://community.slickedit.com/index.php?topic=5194.0

Hops this helps,
Peter

mjdl

  • Senior Community Member
  • Posts: 151
  • Hero Points: 18
  • SE Pro 2023 v28.0.2.0 64-bit Qt5 Win 11 23H2
Re: How to add to the workspace environment PATH variable?
« Reply #2 on: March 30, 2011, 04:03:34 PM »
Thanks, Peter. My search of forum posting also found hs2's and Graeme's solutions you reference, but I'm still a bit surprised expansion for user-set workspace environment variables hasn't been fully implemented by the Slickedit team--surely it must be used a fair amount for large projects (which mine isn't)?

Has this feature evolved at all in Slickedit 16?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: How to add to the workspace environment PATH variable?
« Reply #3 on: March 31, 2011, 05:31:20 PM »
I wasn't sure if you noticed that you need to use %xe.

You need the following:

set PATH=%xeC:\Foo\Bar;%(PATH)

The above gets expanded immediately.

mjdl

  • Senior Community Member
  • Posts: 151
  • Hero Points: 18
  • SE Pro 2023 v28.0.2.0 64-bit Qt5 Win 11 23H2
Re: How to add to the workspace environment PATH variable?
« Reply #4 on: March 31, 2011, 08:41:40 PM »
Thank you! Somehow I had concluded that the %xe was not needed or not relevant ::) On SE 16 beta 4, expansion now works as advertised.