3 Replies Latest reply on Feb 20, 2018 7:43 AM by Landon Winburn

    Environment Variable Expansion

    GRAYS Rookie

      Hi,

       

      We are currently seeing an issue whereby an environment variable set in 'Logon' trigger is not expanded in a later node. We set a PFILES86 variable depending on the device architecture. This is set in 'Logon', Environment.

       

      A shortcut deployed to the users desktop uses this variable in the target path, this is set to occur after explorer.exe starts.

       

      Intermittently, the shortcut can be created as:

       

      C:\%PFILES86%\....

       

      When checking the users environment variables on the device, we can see that the PFILES86 variable is set correctly.

       

      I am trying to understand if what is being experience is a result of a race condition. i.e. PFILES86 being set after the shortcut is created. The reason for this thinking is that this is intermittent. It may be created correctly one day, but the next it will not.

       

      What is the different between setting an Environment variable in 'Logon', Environment, as opposed to setting the variables in a node / node group within the 'Logon' trigger in terms of time of processing?

       

      Could we assume that the Environment variables are the first thing above all other actions which occurs?

       

      I understand that AppSense should "pause" the Logon until all Logon actions are completed, is it at all possible that these actions could over run?

       

      We are using AppSense Environment Manager 8.3 & Agent 8 FR3 (Build 267)

       

      Many Thanks,

      Scott

        • 1. Re: Environment Variable Expansion
          Landon Winburn ITSMMVPGroup

          Whoa, you are long due for an upgrade...

           

          The "Environment" section of your logon trigger runs before the logon trigger itself. This section was added to address the issue you are seeing. The best course of action is to set the environment variables there and then set the actions in nodes of the logon trigger.

           

          There is a 30 second timeout and if you run over that the logon will continue on even if the actions have yet to complete unless its a custom action. If you absolutely have to set the variable in the logon trigger itself then make sure the actions are sub actions of the set environment variable action or in a sub-node under the node that contains the set environment variable. I'd stick with the first solution with the variable in the "environment" section though.

          • 2. Re: Environment Variable Expansion
            GRAYS Rookie

            Just to clarify the sequence:

             

            1) Logon node is triggered

            2) Environment variables are set, before any other Logon actions run

            3) Remaining Logon actions run. If not completed within 30 second timeout, the remaining actions are not executed.

            4) Login resumes

             

            It should follow then, that the environment variable is set at the time the "Create shortcut" action occurs, which is on a process start trigger, and the variable should be expanded?

             

            Since we have no "Pre-Desktop" triggers in this version, we have an exe called postlogon.exe which runs when explorer.exe starts, this then triggers the creation of the desktop shortcut.

            • 3. Re: Environment Variable Expansion
              Landon Winburn ITSMMVPGroup

              So you do have a Pre-Desktop trigger (sort of).

               

              If you click directly on the logon trigger itself you will see an Environment tab. In this tab you can only set environment variables. This portion will process and apply variables before the nodes of the logon trigger are ran. In versions prior to 8.5 this is the ideal place to set variables.

               

              If a node/action times out then the logon will continue and no longer wait. The actions will continue to run but the logon will no longer be held.

               

              Most of the time before 8.5 came along, to create a "Post Logon" trigger we would use "Process Stop" of UserInit.exe. This process runs at logon regardless which "shell" your using. You could be launching a desktop or a published application and this trigger will always run.