Pages

Thursday, 21 June 2012

When OSD Script Runs


When the script runs

You can use the .osd file to run scripts at various times during the startup of App-V (SoftGrid)-enabled programs. The "SCRIPT TIMING and EVENT" setting in the script comes first. Under this setting, the following attributes determine when the script runs:
  • PRE STREAM
    This attribute runs the script before the program starts streaming. For example, use this attribute when you have to open a virtual private network (VPN) connection to the App-V (SoftGrid) server before you run the program.
  • POST STREAM
    This attribute runs the script after authorization and after the program starts streaming but before the Virtual Environment is set up.
  • PRE LAUNCH
    This attribute runs the script inside the virtual environment before the program runs.
  • POST LAUNCH
    This attribute runs the script after the program is started.
  • POST SHUTDOWN
    This attribute runs the script after the program is shut down. For example, use this attribute to clean up configuration settings or to delete configuration files.

How OSD script runs


How the script runs


The new TIMEOUT attribute determines the following:
  • Whether the App-V (SoftGrid) client waits for the script to finish
  • The period that the App-V (SoftGrid) client will wait for the script to finish
For backward compatibility, the WAIT attribute is still supported in Microsoft App-V 4.x and in Microsoft SoftGrid 4.x

Set these attributes as follows:
    TIMEOUT
    • TIMEOUT=x
      The client will wait x seconds for the script to finish before the client returns an error.
    • TIMEOUT=0
      The client will wait indefinitely for the script to finish.

    WAIT
    • Wait=False
      The client will continue without waiting for the script to finish.
    • Wait=True
      The client will not start the next step until the script finishes.
Notes
  • The client does not support a pre-shutdown event. You cannot determine the exact moment at which a user will perform a shutdown. For example, you cannot predict when the user will clickClose or when the user will press ALT+F4.
  • You can use scripts in any language. However, the language must be installed locally on the client computer.

AppV OSD Script - Map Network Drive


This sample script does the following:
  • It uses the SCRIPTBODY tag to contact a server by using its IP Address.
  • It deletes a drive mapping, and then it creates a new drive mapping by using the same drive letter.
<DEPENDENCY>
<SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
<SCRIPTBODY> @echo on \n
ping 192.168.100.100 \n
net use x: /delete /y \n
net use x: \\\\ServerName\\Achieve \n
net use y: /delete /y \n
net use y: \\\\ServerName\\Achieve\\claims\\Bethany \n
</SCRIPTBODY>
</SCRIPT>
</DEPENDENCY> 

AppV OSD Script Example


This script does the following:
  • It uses the SCRIPTBODY tag to map a network drive to a server's netlogon share.
  • It calls an existing .cmd file that is located on the mapped network drive.
  • It calls the Editini.exe file.
  • It adds a Temp path to the Word.ini file.
DEPENDENCY>
<SCRIPT EVENT="LAUNCH" TIMING="PRE" PROTECT="TRUE" WAIT="TRUE">
<SCRIPTBODY>
net use k: \\\\w2k-pdc\\netlogon \n
CALL k:\\usr-w2k.cmd \n
\\\\sft-softgrid\\shr\\editini.exe c:\\word\\word.ini "FileLocations" TempPath c:\\tem \n
</SCRIPTBODY>
</SCRIPT>
</DEPENDENCY>

App-V 5.0 Beta: No more OSDs?

The publishing process no longer points to App-V client launcher program (sfttray.exe).  


Now in AppV 5.0, The shortcut points to actual exe, hence OSDs are not required.

App-V Client Offline Mode Settings


Following registries needs to be changed on App-V Client systems to run AppV client in Standalone/Offline modde

On 32bit machines the registry path is HKLM\SOFTWARE\Microsoft\SoftGrid\4.5\Client


On 64bit machines the registry parth is
HKLM\SOFTWARE\Wow3264Node\Microsoft\SoftGrid\4.5\Client


The settings required are:


HKLM\...\Configuration AllowIndependentFileStreaming 1
HKLM\...\Configuration RequireAuthorizationIfCached 0
HKLM\...\Network AllowDisconnectedOperation         1
HKLM\...\Network LimitedDisconnectedOperation 0

Custom Action Conditions in MSI


You can execute a custom action or make the component install using conditions as per the requirement.
  1. Condition for Action to run only during Installation
    Condition: NOT Installed
  2. Condition for Action to run only during Uninstallation/Removal of MSI
    Condition: REMOVE="ALL"
  3. Condition for Action to run during Install and repair
    Condition: NOT REMOVE
  4. Condition for Action to run only during Upgrade
       Condition: NOT UPGRADINGPRODUCTCODE