Page 1 of 2 12 LastLast
Results 1 to 5 of 6

Thread: get system env variable

  1. #1
    Join Date
    Dec 2011
    Posts
    18

    get system env variable

    You can set a system environment variable, and you can refresh the
    the windows environment, but where is the Action to Get a system environment variable???

  2. #2
    Join Date
    Feb 2011
    Posts
    54
    Get a system environment variable can be retrieved using getEnvironmentVariable() method this is present in SystemUtilService Interface. This Interface performs system-level operations.

    getRawEnvironmentVariable
    java.lang.String getRawEnvironmentVariable(java.lang.String variableName, int level) throws ServiceException

    This method is useful to developers when creating a custom bean. Gets the raw value of the specified environment variable. For operating systems whose environment variable settings are script-controlled, this returns the value of the environment variable from the InstallShield section of the script. For other operating systems, this method acts the same as getEnvironmentVariable . The returned value may contain references to environment variables that are not resolved.

    Parameters:
    variableName - - The name of the variable for which to return a value.
    level - - Specifies the level of the environment variable. This parameter may be ignored on platforms which do not support the setting of environment variables at different levels (e.g., Win9x).

    Returns:
    A string containing the value of the environment variable; null if the environment variable does not exist

    Regards
    SunnyBoy

  3. #3
    Join Date
    Dec 2011
    Posts
    18
    thanks for the quick response. I was hoping for an InstallAnywhere Action from the Add Action panel. I just found it somewhat limited that a Set action is provided without the corresponding Get action.

  4. #4
    Join Date
    Jul 2011
    Posts
    19

    get system env variable

    InstallAnywhere has an action to get environment variables. We can use

    $lax.nl.env.SYSTEM_ENV_VARIABLE_NAME$.

    For example, to get JAVA_HOME we have to use $lax.nl.env.JAVA_HOME$.

  5. #5
    Join Date
    Dec 2011
    Posts
    18
    thanks for the reply, I will give it a try.
    BTW where are the $lax.nl.env.???$. variables documented?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •