none
AppV 5.0 Environment Variable

    Question

  • Hi all,

    I need to set the Path Environment variable for an application in a Appv 5.0 sequence. So far I have found that there might be a bug in appv 5.0 that prevents this.  Does anybody know how to set the Path enviroment variable?

    Thanks

    Tuesday, August 6, 2013 1:29 PM

Answers

  • Hello,

    Ok,

    1. Your verification is off

    - You need to execute this within a virtual environment

    -You need to check the %PATH% variable within your virtual environment

    The native registry, command-prompt and properties will never reflect what is within your virtual environment

    Open a command-prompt within the virtual environment

    2. If you have captured the change during the sequencing process, it is part of the package.

    It is not necessary to apply the configuration files.


    Nicke Källén | The Knack| Twitter: @Znackattack

    Wednesday, August 28, 2013 3:59 PM

All replies

  • Take a look at your Deployment Config URL, I believe you can find a sample in there for setting an environment variable.

    http://technet.microsoft.com/en-us/library/jj713466.aspx


    PLEASE MARK ANY ANSWERS TO HELP OTHERS Blog: rorymon.com Twitter: @Rorymon

    Tuesday, August 6, 2013 2:57 PM
  • Out of Curiousity, have you tried bringing the ENV value in using a <Registry> element in the Configuration XML?

    i.e

    <Subsystems>

      <Registry>

        <Include>

           <Key Path="HKEY_CURRENT_USER\Environment"/>

    .... etc.


    Steve Thomas, Senior Consultant, Microsoft

    App-V/MED-V/SCVMM/Server App-V/MDOP/AppCompat

    http://blogs.technet.com/gladiatormsft/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”

    Tuesday, August 6, 2013 3:08 PM
  • I too am running into the same roadblock.  As per Rorymon's suggestion, I did find that both the DeploymentConfig.xml and UserConfig.xml files contained the below entry:

    <EnvironmentVariables Enabled="true">

            <Include>

              <Variable Name="PATH" Value="[{AppVPackageRoot}]\bin;%PATH%" />

            </Include>

    </EnvironmentVariables>

    However, that updated path to include a "bin" directory does not seem to take effect on an App-V client for neither the system nor the user environment variables.  Does anyone believe that it SHOULD function?


    Nick Moseley | http://t3chn1ck.wordpress.com

    Tuesday, August 27, 2013 5:24 PM
  • Hello,
    I have multiple environment variables set in a package - they are all reflected in the virtual environment

    How did you verify that they were not applied?

    How did you apply the config-files?


    Nicke Källén | The Knack| Twitter: @Znackattack

    Wednesday, August 28, 2013 2:53 PM
  • For verification, I am just simply running (in a command prompt) a .bat file which resides in that BIN folder.  If the PATH environment variable was updated, then it would have located that .bat for execution. Additionally, I do not see evidence in system/user properties that the PATH environment contains the package root.

    For applying the config files, I have done two different things:

    1. Run PowerShell command: Add-AppvClientPackage -Path "mypath" | Publish-AppvClientPackage -Global
    2. Add/publish through the console

     

    Nick Moseley | http://t3chn1ck.wordpress.com

    Wednesday, August 28, 2013 3:07 PM
  • Hello,

    Thats not a correct way of applying configuration files.

    See this guide on howto do it;

    http://spablog.ontrex.ch/2013/04/23/shims-and-app-v-5-0/


    Nicke Källén | The Knack| Twitter: @Znackattack

    Wednesday, August 28, 2013 3:15 PM
  • Same result when publishing the DeploymentConfig.xml file with -DynamicDeploymentConfig.

    And you have packages that correctly update either a system or user's PATH with the EnvironmentVariables element inside the XML files?  I didn't specifically add that element into my DeploymentConfig.xml file - it was captured during sequencing (much to my surprise) - I thought I was going to need to use a custom script to update the PATH.


    Nick Moseley | http://t3chn1ck.wordpress.com

    Wednesday, August 28, 2013 3:51 PM
  • Hello,

    Ok,

    1. Your verification is off

    - You need to execute this within a virtual environment

    -You need to check the %PATH% variable within your virtual environment

    The native registry, command-prompt and properties will never reflect what is within your virtual environment

    Open a command-prompt within the virtual environment

    2. If you have captured the change during the sequencing process, it is part of the package.

    It is not necessary to apply the configuration files.


    Nicke Källén | The Knack| Twitter: @Znackattack

    Wednesday, August 28, 2013 3:59 PM
  • Oh! Now I understand, thank you very much for the explanation.  Your right, when I launch the command prompt for the VE, the PATH is set correctly.

    Nick Moseley | http://t3chn1ck.wordpress.com

    Wednesday, August 28, 2013 4:15 PM