App-V Package Publishing in XenApp 7.8

Purpose –

The purpose of this blog post is to state the steps required to publish virtualized package created using Microsoft App-V in Citrix XenApp 7.8.

App-V Package Publish Steps for XenApp 7.8 –

Follow the below steps –

1. Launch “Citrix Studio”.

2. Go to the node Configuration -> App-V Publishing. Right click on “App-V Publishing”. Click on Add Package.

image

3. It will open window to browse App-V package (.appv) file. Select the file with extension “.appv” and click Open.

image

Below screen will appear…

image

On successful addition of package, below screen will appear:

image

4. Now, go to the “Applications” node, right click it and select “Add Applications” option as shown below –

image

5. Below screen will appear. Click Next.

image

6. Select the “Delivery group” where the virtualized application will be delivered.

image

7. Click on Add button and select the “App-V..” option as shown below –

 image

Below screen will be displayed. It will show the list of App-V packages we add before. Select the respective one and click Ok. It will close the below screen and will take the control to the above screen. Click Next and it will take to the summary screen and click finish to add the application.

image

8. Once the application is added, right click on the added application and select the properties to add the users for its access control. Below screen will appear.

image

Add the required users as shown below –

image

Application is now published in XenApp 7.8 and is now ready to use.

How to verify environment variable created by VBScript in XenApp for User session?

In many scenarios, in XenApp, we write VBScript to create USER environment variable. We publish this VBScript in XenApp and then we launch it through Web interface. Now, to test it, we need to verify if this user environment variable is created or not? How to verify it? Answer is below:

1. Note: Run the below steps while user “session” is still running. If user is logged off, the USER details will be deleted.

2. Run Regedit.exe

3. Go to HKEY_USERS and find long ID for USER.

4. Expand the long ID and click on the node “Environment”. This node will display all the USER environment variables.

clip_image001

To verify, if the long ID as shown above belongs to the particular user, go to the node “Volatile Environment” and see the key “USERNAME” as shown below:

image

How to publish VBScript at UNC from Streaming Package

Sometimes for some application, we have the requirement that the VBScripts that will perform certain actions (like mapping, copying etc) and finally, the launch of the application, kept in some share location in the network, needs to be published for the application. In case of the manual installation, it can be easily published from the XenApp AppCenter.

What if we are creating the streaming package and we need to publish this VBScript kept in network location? 

Here is the solution:

Follow the below steps:

  1. In the Streaming package “files and folder” section, add cscript.exe from “C:\Windows\System32”.
  2. Create shortcut for cscript.exe that will be visible under “Application to launch from the Citrix streaming application profile” dropdown in Citrix AppCenter for publishing the application.
  3. Save the package to the AppHub.
  4. In the application publishing wizard, under Location screen, select:
    1. the application streamed profile.
    2. Select “Cscipt” from “Application to launch from the Citrix streaming application profile” dropdown.
    3. Add the VBScript file and location on the “Extra command line parameter”.
  5. Finish the publishing part.

Below screenshot, shows the above step 4:

image

Now, when user will click the published icon, Cscript from within the virtual bubble will launch the VBScript kept at the network location and this VBScript will run under this virtual bubble. It will launch application installed inside the bubble as if it is installed on the XenApp server.

XenApp: How to add and run VBScript in Streaming package

Streaming is the virtualization technique. It enables applications to be delivered to client devices and run in a protected, virtual environment.  Applications are managed in a centralized Application Hub, but are streamed to the client device and run in an isolation environment.  Applications become an on-demand service that is always available and up-to-date.

Streaming package needs to be created using the Streaming profiler. Once created successfully, it needs to be published for the user community.

Its creation is explained in my article at https://mdaslam.wordpress.com/2010/08/18/xenapp-application-streaming-package-creation

Now in this article, we will learn:

  1. How to add VBScript in streaming package : Sometimes we need to add VBScript to the package for doing some required operations like mapping of drives. 
  2. How to run the added VBScript: We need to run the VBScript before launching the application. Application launch instruction should be written in the VBScript. 

For implementing above requirement, I will use streaming package for MS Word component that we created in my article at the above link.

Steps to Update streaming package:

  1. Streaming package is modified using Streaming Profiler. To run streaming profiler go to {All Programs > Citrix > Streaming Profiler} and click on Streaming Profiler. Following screen will appear:image
  2. Click on “Open Profile” button, following screen will appear: Select the application streaming package profile file and click Open.image
  3. Following screen will appear:image
  4. Expand the package {MSOffice – Word} node and right click on first child node and select “Update / Install Application as shown below:image  Following progress screen will appear: It will take couple of minutes to open package for editing.image
  5. Following screen will appear: Click Nextimage   
  6.   Select radio button for “Advanced Install” and click Next. Note: image
  7. For first requirement {adding VBScript} Select the radio button for “Select files and folders” and Click Next.              image  Following screen will appear:  Select the required file from left hand side window and select the required destination location from right hand window. Once selected, click on arrow button to add the file. Once added, Click Next.                                      Note: We need to add wscript.exe along with VBScript on same location as it will be required to run the script. image Following screen will appear: Select radio button for “Finish  installations”. Click Next.image
  8. Below screen will appear, containing the list of applications that are installed on this package. You can select application from this list and click on “Run” button to run that application. Some application requires some settings to be done after launching it for the first time. Those type of activities can be done using this screen.image 
  9. Once the application is executed in above step for the first time, exit the application and its status will be changed to “Application Run” as shown below: image
  10. If you want to add/modify/delete any application, use the below screen: image Click Add {for above second requirement}, following screen will appear:                                                                                     Add the following information:                                              Application name: MSOffice – Word                                          Version: 2003                                                                        Path: C:\Program Files\Microsoft Office\wscript.exe {Browse to this location by clicking Browse button. Browse button will take you inside package to get the file that you have added above}. Working Directory: C:\Program Files\Microsoft Office.              Command line parameters: testWord.vbsimage  After clicking ok, following screen will appear: Click Next.image
  11. You can sign the profile using below screen: Click Nextimage
  12. Profile summary will appear in the below screen. Click Finish to finish the profile creation.image
  13. On successful updation of profile, following main screen will appear. Click on the save button as shown in circle in below screenshot to save the profile: Profile will saved under the same shared location.image
  14. Now during its publishing in XenApp, we need to select “MSOffice – Word” as application name under “Location” screen as shown below: image  For information of how to publish streaming package, refer to below articles:  https://mdaslam.wordpress.com/2010/08/25/xenapp-publishing-streaming-package/ and https://mdaslam.wordpress.com/2010/09/01/xenapp-automated-streaming-package-publish-using-powershell/ 

XenApp: How to modify Streaming package?

Streaming is the virtualization technique. It enables applications to be delivered to client devices and run in a protected, virtual environment.  Applications are managed in a centralized Application Hub, but are streamed to the client device and run in an isolation environment.  Applications become an on-demand service that is always available and up-to-date.

Streaming package needs to be created using the Streaming profiler. Once created successfully, it needs to be published for the user community.

Its creation is explained in my article at https://mdaslam.wordpress.com/2010/08/18/xenapp-application-streaming-package-creation

Now in this article, we will learn, how to modify streaming package for

  1. adding one file : Sometimes we need to add/update application configuration file
  2. updating registry: Sometimes we need to update registry entry for application data

For implementing above requirement, I will use streaming package for MS Word component that we created in my article at the above link.

Steps to Update streaming package:

  1. Streaming package is modified using Streaming Profiler. To run streaming profiler go to {All Programs > Citrix > Streaming Profiler} and click on Streaming Profiler. Following screen will appear:image
  2. Click on “Open Profile” button, following screen will appear: Select the application streaming package profile file and click Open.image
  3. Following screen will appear:image
  4. Expand the package {MSOffice – Word} node and right click on first child node and select “Update / Install Application as shown below:image  Following progress screen will appear: It will take couple of minutes to open package for editing.image
  5. Following screen will appear: Click Nextimage  
  6.   Select radio button for “Advanced Install” and click Next. Note: image
  7. For first requirement {adding one file} Select the radio button for “Select files and folders” and Click Next.              image  Following screen will appear:  Select the required file from left hand side window and select the required destination location from right hand window. Once selected, click on arrow button to add the file. Click Next.image Following screen will appear: Select radio button for “perform additional installations” to implement second requirement. Click Next.image
  8. For second requirement {updating registry} Select the radio button for “Edit registry” and Click Next. image  Following screen will appear:  Click on “Lunch Windows Registry Editor” button:image Registry editor will be launched as shown below: Update it for the required data and then close the editor. image Following screen will appear again: Click Nextimage
  9. Following screen will appear: Select radio button for “Finish installations” and Click Next.image              
  10. Below screen will appear, containing the list of applications that are installed on this package. You can select application from this list and click on “Run” button to run that application. Some application requires some settings to be done after launching it for the first time. Those type of activities can be done using this screen.image
  11. Once the application is executed in above step for the first time, exit the application and its status will be changed to “Application Run” as shown below: image
  12. If you want to add/modify/delete any application, use the below screen: Click Next image
  13. You can sign the profile using below screen: Click Nextimage
  14. Profile summary will appear in the below screen. Click Finish to finish the profile creation.image
  15. On successful updation of profile, following main screen will appear. Click on the save button as shown in circle in below screenshot to save the profile: Profile will saved under the same shared location.image
  16. Resultant Folder structure of profile as saved at shared location: image  Please note the presence of second cab file. Whenever streaming profile is updated, new cab file is created. You can delete the old cab file if you don’t want to maintain history as old cab file might be used to rollback the changes.

XenApp: Automated streaming package publish using PowerShell

Purpose:

To publish application streaming package in XenApp automatically using PowerShell script.

Pre-requisite:

Following are the prerequisites for setting up the environment to execute PowerShell script to publish application in XenApp:

  1. .Net Framework 3.5 SP1 {Download it from Microsoft website}
  2. Microsoft PowerShell 1.0 {Download it from Microsoft website}
  3. XenApp Command technology preview{Download it from citrix site: https://www.citrix.com/English/ss/downloads/details.asp?downloadId=1687620&productId=186#top} : These commands are a PowerShell Tool Pack that allows managing most aspects related to XenApp.  They cover all of MFCOM functionality for features available in XenApp 5 and include functionality from both AMC and CMC.
  4. Person who is publishing application icon should have full administrative rights on Access management console and should have atleast read access rights on the shared location where streaming package is stored.
  5. Application users should also has read access rights on the shared location where streaming package is stored.

Install all the above components {step 1 – 3} in the given order onto the XenApp environment.

Solution: 

Below script is the solution. It has four parts:

  • Creation of input box for application information – {Line 10 – 99}
  • Creation the published application icon for streaming package – {Line 101-117}
  • Addition of users/groups to the application –{Line 119-120}
  • Assignment of servers to the published app –{Line 122-123}

    Script:

       1: # =========================================================

       2: # 

       3: # AUTHOR: Mohd Aslam

       4: # DATE  : 7/06/2010

       5: # 

       6: # COMMENT: This script will publish application streaming 

       7: # package in XenApp.

       8: # 

       9: # =========================================================

      10: [void] [System.Reflection.Assembly]::LoadWithPartialName(

      11: "System.Drawing") 

      12: [void] [System.Reflection.Assembly]::LoadWithPartialName(

      13: "System.Windows.Forms") 

      14:  

      15: $objForm = New-Object System.Windows.Forms.Form 

      16: $objForm.Text = "Server Desktop publish information"

      17: $objForm.Size = New-Object System.Drawing.Size(430,200) 

      18: $objForm.StartPosition = "CenterScreen"

      19:  

      20: $objForm.KeyPreview = $True

      21: $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 

      22:     {$x=$objTextBox.Text;$objForm.Close()}})

      23: $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 

      24:     {$objForm.Close()}})

      25:  

      26: $OKButton = New-Object System.Windows.Forms.Button

      27: $OKButton.Location = New-Object System.Drawing.Size(190,140)

      28: $OKButton.Size = New-Object System.Drawing.Size(75,23)

      29: $OKButton.Text = "OK"

      30: $OKButton.Add_Click(

      31: {

      32: $AppName=$objAppName.Text;

      33: $AppUsers=$objAppUsers.Text;

      34: $AppServers=$objAppServers.Text;

      35: $objForm.Close()

      36: }

      37: )

      38: $objForm.Controls.Add($OKButton)

      39:  

      40: $CancelButton = New-Object System.Windows.Forms.Button

      41: $CancelButton.Location = New-Object System.Drawing.Size(290,140)

      42: $CancelButton.Size = New-Object System.Drawing.Size(75,23)

      43: $CancelButton.Text = "Cancel"

      44: $CancelButton.Add_Click(

      45: {

      46: $objForm.Close()

      47: }

      48: )

      49: $objForm.Controls.Add($CancelButton)

      50:  

      51: $objLabel = New-Object System.Windows.Forms.Label

      52: $objLabel.Location = New-Object System.Drawing.Size(10,15) 

      53: $objLabel.Size = New-Object System.Drawing.Size(280,20) 

      54: $objLabel.Text = "Please enter the information in the space below:"

      55: $objForm.Controls.Add($objLabel) 

      56:  

      57: $objLbl_AppName = New-Object System.Windows.Forms.Label

      58: $objLbl_AppName.Location = New-Object System.Drawing.Size(10,40) 

      59: $objLbl_AppName.Size = New-Object System.Drawing.Size(160,20) 

      60: $objLbl_AppName.Text = "Application Name:"

      61: $objForm.Controls.Add($objLbl_AppName) 

      62:  

      63: $objAppName = New-Object System.Windows.Forms.TextBox 

      64: $objAppName.Location = New-Object System.Drawing.Size(190,40) 

      65: $objAppName.Size = New-Object System.Drawing.Size(205,20) 

      66: $objForm.Controls.Add($objAppName) 

      67:  

      68: $objLbl_AppUsers = New-Object System.Windows.Forms.Label

      69: $objLbl_AppUsers.Location = New-Object System.Drawing.Size(10,70) 

      70: $objLbl_AppUsers.Size = New-Object System.Drawing.Size(160,20) 

      71: $objLbl_AppUsers.Text = "Application Users*:"

      72: $objForm.Controls.Add($objLbl_AppUsers) 

      73:  

      74: $objAppUsers = New-Object System.Windows.Forms.TextBox 

      75: $objAppUsers.Location = New-Object System.Drawing.Size(190,70) 

      76: $objAppUsers.Size = New-Object System.Drawing.Size(205,20) 

      77: $objForm.Controls.Add($objAppUsers) 

      78:  

      79: $objLbl_Server = New-Object System.Windows.Forms.Label

      80: $objLbl_Server.Location = New-Object System.Drawing.Size(10,100) 

      81: $objLbl_Server.Size = New-Object System.Drawing.Size(160,20) 

      82: $objLbl_Server.Text = "Servers*:"

      83: $objForm.Controls.Add($objLbl_Server) 

      84:  

      85: $objAppServers = New-Object System.Windows.Forms.TextBox 

      86: $objAppServers.Location = New-Object System.Drawing.Size(190,100) 

      87: $objAppServers.Size = New-Object System.Drawing.Size(205,20) 

      88: $objForm.Controls.Add($objAppServers) 

      89:  

      90: $objLbl_Server = New-Object System.Windows.Forms.Label

      91: $objLbl_Server.Location = New-Object System.Drawing.Size(10,120) 

      92: $objLbl_Server.Size = New-Object System.Drawing.Size(180,20) 

      93: $objLbl_Server.Text = "*: Enter ';' separated data if any"

      94: $objForm.Controls.Add($objLbl_Server) 

      95:  

      96: $objForm.Topmost = $True

      97:  

      98: $objForm.Add_Shown({$objForm.Activate()})

      99: [void] $objForm.ShowDialog()

     100:  

     101: New-XAApplication -BrowserName $AppName `

     102: -DisplayName $AppName -FolderPath "Applications/Office" `

     103: -Enabled $true `

     104: -ApplicationType StreamedToServer `

     105: –ProfileLocation "\\Server\App_Profiles\MSOffice - Word.profile" `

     106: –ProfileProgramName "Microsoft Office Word 2003" `

     107: –IconStream (

     108: Get-XAIconStream `

     109: -profilelocation "\\Server\App_Profiles\MSOffice - Word.profile" `

     110: -profileprogramname "Microsoft Office Word 2003" `

     111: –Index 0) `

     112: -AnonymousConnectionsAllowed $false `

     113: -InstanceLimit "-1" `

     114: -ColorDepth 1 `

     115: -AudioRequired $false `

     116: -ClientFolder "Office"`

     117: -ProfileProgramArguments %* `

     118:  

     119: Add-XAApplicationAccount -BrowserName $AppName `

     120: -Accounts $AppUsers.Split(";")

     121:  

     122: Add-XAApplicationServer -BrowserName $AppName `

     123: -ServerNames $AppServers.Split(";")

     How to Run above script?:

    Save above script to some location with .ps1 extension. To Run above script, go to “Programs > Citrix > XenApp Commands” and click “Windows PowerShell with XenApp Commands (CTP2)” icon. It will launch PowerShell command prompt.

    On the PowerShell command prompt, write script name with full location and click enter. Script will run and below screen will be displayed:

    image

    Enter all the required data and click “Ok”. For application users and servers, multiple data can be entered separated by “;”.

    Following screen will be displayed containing information about the published icon.

    image

    To confirm the successful publish, go to access management console and see the published icon as:

    image

                                                                    –Finish–

  • XenApp: Publishing streaming package

    Access Management console is required to publish application streaming package in XenApp.

    Below are the steps required to publish streaming package.

    Prerequisite:

    1. Citrix Access Management console should be installed on the XenApp farm.
    2. Person who is publishing application icon should have full administrative rights on Access management console and should have atleast read access rights on the shared location where streaming package is stored.
    3. Application users should also has read access rights on the shared location where streaming package is stored.
    4. Streaming client should be installed on the user’s machine.

    Steps:

    1. Double click on the desktop icon “Access Management Console” or launch the exe “CmiLaunch.exe” from "C:\Program Files\Common Files\Citrix\Access Management Console – Framework\". Citrix Access Management console window will be launched. Left side of window will have tree structure as shown below. It has a node for Presentation server and under it, there is a node for XenApp farm. It has different folders under it to manage the farm. For this article, our interest is the “Applications” folder under it.           image 
    2. Right Click on “Applications” folder and Select New –> Create Folder as  shown below:            image
    3. Following screen will appear: image                                Enter the application name and click ok. It will create “Office” folder under the applications node.
    4. Right click on “Office” folder and select New –> Publish application. “Welcome” screen will appear: Click Nextimage
    5. “Name” screen will appear, add the following details and Click Next:                                                                                     Display Name: MSOffice – Word | Application description: MSOffice – Wordimage
    6. “Type” screen will appear, Select the radio button for “Application” and then select radio button for “Application from a server”. From Server application type dropdown, select “Streamed to server” and Click Next.image
    7. “Location” screen will appear, browse to the application profile location and then select the required application from Application to launch dropdown list and then click Next. image
    8. “Servers” screen will appear, Click on “Add” button to add all the servers where you want application to stream to. By stream to, I mean, application will be run in isolation from that server. Servers added here will be having load balancing.image
    9. “Users” screen will appear for adding users who will have access rights on the published icon. Click Add button and it will open “second screen”. On that screen, click on “Add List of Names” button to add the users. “third Screen” will appear. Enter the users into the screen and click “Check Names” button to see the validity of the entered users. Once verified click Ok. Click Ok on second screen and click Next on First screen.                              Note: You can add any number of users from the below screens but the best practice is to have active directory group containing all the required users and that group can be added directly to the below screen. With active directory group it is very easy to manage users. By manage I mean, addition and deletion of users.image
    10. “Shortcut Presentation” screen will appear. Enter “Office” folder in the textbox for “Client application folder”. If the user access is through web ICA, do not check the checkbox for “add to the client’s start menu” and “add shortcut to the client’s desktop”.                                                                                 Note: You should enter the folder name that you have created at step 2 above. Users will see the application icon under this folder in their web ICA session. image Check for the application icon displayed on this screen. If you want to change it, click on change icon button, following screen will appear, select the appropriate radio button and get the required application icon and click Ok and then click Next to the parent screen.image
    11. “Publish immediately” screen will appear, select the checkbox for “Configure advanced application settings now” and click next.image
    12. Access control screen will appear: Keep the default options and click Next.image
    13. “Content redirection” screen will appear: select the required extensions and click Next.                                                        Note: For more information, refer to my article: https://mdaslam.wordpress.com/2009/09/09/associating-published-applications-with-file-types/image
    14. Alternate profiles: Keep the default value and click Next.image
    15. “Limits” screen will appear: Depending on the application architecture and the bandwidth, check the checkbox for “Limit instances allowed to run in server farm” and then add Maximum instances. Click Next.image
    16. “Client options” screen will appear: Select the different options based on your requirements like the bandwidth, security or printing requirements. Click Next.                                                  Note: For Client audio, refer to the article https://mdaslam.wordpress.com/2009/11/24/xenapp-legacy-audio/image
    17. “Appearance” screen will appear: Select the appropriate session window size and required color depth. Click Finish.                 Note: For seamless mode, selecting any value under “session window size” will not make any difference. For Color depth, refer to my article: https://mdaslam.wordpress.com/2009/09/22/xenapp-colors-depth-in-published-application-properties/image After this step, application icon will be published and available under “Office” folder. Users who are given access to this icon, will be able to see it in Web ICA session.  

                                                                –Finish–