locked
Environment Variable from Host Machine RRS feed

  • Question

  • Is it possible to read a machine's environment variable, (i.e. TEST=S:\SERVER1) in a sequenced application?  Trying to dynamically read an environment variable for one sequenced application instead of making 5 different sequenced applications.  Thanks.
    Thursday, June 17, 2010 3:35 PM

Answers

  • If the environment variable is at the machine system level, I wouldn't think an application would have an issue reading it?  Are you saying you've tried and it doesn't work?
    • Proposed as answer by znack Tuesday, June 22, 2010 5:01 AM
    • Marked as answer by Aaron.ParkerModerator Wednesday, August 7, 2013 9:59 PM
    Friday, June 18, 2010 11:59 AM
  • As Redparadox wrote, virtual applications can see and read Environment Variables.

    Additionaly, you can have different values for EnvVariables depending on the app-V package.

    To "personalize" a Package, you could use a "pre launch script" to read out an Variable's value and modify the virtual package accodingly. Just search for "App-V pre launch script" and you should find some advice

     


    Falko
    Friday, June 18, 2010 8:01 PM
    Moderator

All replies

  • If the environment variable is at the machine system level, I wouldn't think an application would have an issue reading it?  Are you saying you've tried and it doesn't work?
    • Proposed as answer by znack Tuesday, June 22, 2010 5:01 AM
    • Marked as answer by Aaron.ParkerModerator Wednesday, August 7, 2013 9:59 PM
    Friday, June 18, 2010 11:59 AM
  • As Redparadox wrote, virtual applications can see and read Environment Variables.

    Additionaly, you can have different values for EnvVariables depending on the app-V package.

    To "personalize" a Package, you could use a "pre launch script" to read out an Variable's value and modify the virtual package accodingly. Just search for "App-V pre launch script" and you should find some advice

     


    Falko
    Friday, June 18, 2010 8:01 PM
    Moderator
  • Additional note on this topic....

    If the environmental variable is also created at sequence time, the sequencer may capture this setting and deliver it with the package (which is probably not what you want).  You can check this by looking at the OSD file (<ENVIROMENT VARIABLE="name">value</ENVIRONMENT>), which is how it is delivered to the client.  Manual removal from the OSD can be necessary is some cases, although if you add a script that ALWAYS sets the variable, that will override the value supplied by the OSD ENVIRONMENT tag so you don't neeed to manually remove.

    Saturday, June 19, 2010 2:09 PM
    Moderator