Desktop Env Vars

Hi,

I noticed that Xojo has the following method: System.EnvironmentVariable can this be use in desktop applications? I have set a env in my .bash_profile like this: export MYVAR=onetwothree and when I run the app, the app does not seem to get MYVAR. I have also restarted the computer to make sure the env variable is set.

TIA

It should work if your evn hold the values.
Test it on the terminal and see if the variable is there type “env” then run a xojo app and it should have the same keys/values

It’s going to depend on how you start your app though. If you’re just double-clicking the app bundle, that doesn’t get the env vars. If you do what Derk suggests and open the app from a bash terminal then it would. Keep in mind that the default shell is no longer bash… it’s zsh, and uses different config files.

2 Likes

Thank you guys! Both of you were correct… my fault was i was saving my env in .bash_profile when i should be using .zprofile. Thank you again.