When it comes to migration projects, Citrix's AppDNA can prove invaluable for packaging teams, consultants or partners who need to analyse large numbers of applications to determine whether they are compatible with Windows 10 desktops, or their XenApp hosted environments. AppDNA uses static analysis to scan imported applications, and compare the results against a set of rules for the target system, and detect any incompatibilities with Windows 10, Server 2016, XenApp 7.x, App-V or security & compliance rules. AppDNA creates a Red Amber Green Report (RAG Report) - Green is compatible, Amber issues exist but they can be resolved, Red known incompatibles exist. The report is sometimes affectionately referred to as a 'Fruit Salad' because it can be so colourful, especially when you are viewing the results of many applications. The results of the RAG analysis can then be used by AppDNA's automation framework, Forward Path, to make decisions and trigger actions, for example package the application using App-V. Citrix’s AppDNA enables teams to automate the to end process of migrating applications to a new platform, reducing the time and effort it takes to identify the applications that can’t be migrated.
Unfortunately, packaging teams are all too familiar with messages likes the one below, or large numbers of applications appearing as Red, or worse Amber, in AppDNA when they try and package their line of business applications for Windows 10. Why because their business apps were developed for legacy systems like Windows XP or Server 2003. Why is Amber worse than Red for a packaging team? It usually means a significant amount of time will need to be spent researching and remediating the problem. Why is Red worse than Amber for the team delivering the apps to the user? To continue delivering the apps to the users, it means that they need to maintain the unsupported operating system.
This blog covers,
- Using AppDNA’s analysis engine to identify problem apps for Win 10, and App-V.
- 5 Top Tips for using AppDNA.
- How to automate packaging of incompatible apps into Cloudhouse Compatibility Containers for deployment onto Win 10*.
Note: The same approach can be used for packaging apps for Windows 2016 and XenApp 7.15
A big thanks to Ben Reese, and Mykola Bondarenko from Citrix’s AppDNA team who provided advice, and helped debug some problems I had with my initial install of AppDNA, which brings me straight to…
Top Tip 1: We are going to be using the Forward Path, Windows 10 Primary, App-V script, make sure the Forward Path reporting module is working, and the page loads without error. If you get an exception, then the Forward Path reporting module is corrupt, and the scripts wont execute. Recommend, reinstalling AppDNA.
Packaging when ‘This app can’t run on your PC’
We are going to use a version of Snagit that displays this message when you attempt to install it on Windows 10 as an example because our customers’ apps are either heavily customised off-the-shelf apps, or their own proprietary apps.
Prepare the packaging machine
Firstly, you need to create a VM for packaging. To get apps from XP to Windows 10 you will need
- A Win XP SP2 VM that meets all the AppDNA pre-recs; AppDNA VM Configurations Tools, RDP enabled, ports 54593 open.
- Install the Cloudhouse Auto Packager, requires .Net 4.0 Client Profiles - disk space, memory and other requirements can be found here, but they are usually met by the requirements of the application that is being packaged.
- The VM will need write access to a shared network directory to store the data collected by AppDNA, and the Container created by the Auto Packager.
Configure AppDNA to package with Cloudhouse
To automate the install capture process, go to Edit Settings / Install Capture Virtual Machines, and run through the ‘New’ configuration wizard; name the configuration, for example “Cloudhouse Auto Package Virtual Machine” and provide the connection details to the hypervisor management tool. This will enable you to browse to the Win XP VM created previously. Next, create a snapshot with the packager installed.
Top Tip 2: Be sure to always run AppDNA’s handy automated test steps, they help you identify and resolve connection problems that will prevent analysis and package automation from completing successfully.
Create an execution profile for Compatibility Containers
To run packaging tools like AppV, or the Auto Packager, AppDNA requires an Execution Profile to be created; the series of commands required to install and package the application. The Auto Packager automates all the steps required to package, including the install of the application, so you need only to enter a single command.
Cloudhouse’s Product Documentation includes a template Execution Profile that you can save to file and then import into AppDNA.
Alternatively, to create one manually, go to Edit /Settings / Install Capture /Execution Profile, provide a name for example “Cloudhouse Compatibility Containers” and specify the following command:
powershell "c:\programdata\cloudhouse\packager\autopackagerCLI.ps1" -InstallerPath '$(InstallerPath)' -InitialLaunchExecutable '$(App:InstallCommand)' -Arguments "$(Arguments)" -AppName '$(AppName)' -AppGUID $(AppGUID) -PackageFolder '$(PackageFolder)\$(AppName)’
The documentation on the command line interface is available here, if you want to know more about how it works.
Top Tip 3: AppDNA enables you to define variables, called Replaceables, these can be used in commands and scripts to pass in information about the environment, the application etc. Select the tab Replaceables to define them
Import the application
You need to import the application before you can configure the Forward Paths. This will ensure that all the variables are available for AppDNA to use in the scripts. Select ‘Import’, and then browse to the network share hosting the installer. It is quicker to select the option to Analyze Later.
Configuring Forward Paths to Package with Cloudhouse
AppDNA’s Forward Path turns the analysis results into actions based upon the RAG status identified for the app. The ‘AppDNA Windows 10 Primary, App-V Secondary’ forward path script, provided by AppDNA, tests the application to see if it is suitable for Windows 10. If not, it will then try App-V. But what if the app is incompatible with App-V? Based upon the actions of the forward path script provided by AppDNA, it would flag it as ‘Red’ and ‘Incompatible’ which would mean keeping the app on Win XP. By modifying the script, you can make the recommendation to use the dedicated Task Script ‘Suitable for Cloudhouse’.
Configuring the “Suitable for Cloudhouse” Task Script
When AppDNA runs the Forward Path, it will evaluate the conditions and will run the Task Script stated in RAG results myForwardPath.Outcome – there should be a unique script for green, amber and red. In the figure above, the Task Script is called “Suitable for Cloudhouse”. Replaceables in the script are variables that you can pass in to the script, or used commands you want to run.
Top Tip 4: Select the Property Explorer tab to see a categorised list of variables you can use in the scripts. You must use the fully qualified name in the script e.g. Controller.Application.Name. If you want to use “AppID” specify it as his controller.Application.Id
The “Suitable for Cloudhouse” Task Script
In the following example script, the InstallerPath required by Auto PackagerCLI.ps1 is assigned the controller.Application.SourcePath which uses the path provided when you imported the application above. The AppName, and AppGUID are similarly defined with values from the AppDNA environment.
It is the ProductionManager.RunExecutionProfile command that passes in the controller object, the execution profile that will be used, the replaceables and the definition of the packaging VM.
Public Class ScriptClass
Public Function Start(controller As IActionController) As TaskStatusEnum
'Pass replaceables into the execution profiles using the dictionary
Dim replaceables As New Dictionary(Of String, String)
replaceables.Add( "InstallerPath", controller.Application.SourcePath)
replaceables.Add( "AppName", controller.Application.Name)
replaceables.Add( "AppGUID", controller.Application.AppID)
' This informs the controller that it can abort if the user cancels
' This call allows you to run the execution profile for a given app using a given VM
ProductionManager.RunExecutionProfile(controller, "Cloudhouse Compatibility Container", replaceables, "Cloudhouse Auto Packaging VM")
' Add you own actions
controller.GUI.ProgressPercent = 100
Start = TaskStatusEnum.Complete
Top Tip 5: To test your script, you must execute it through Forward Paths\ Evaluate Tasks, otherwise the variables won’t get substituted.
That’s a wrap! A Compatibility Container for Windows 10
That’s all you need to set up AppDNA to Auto Package with AppDNA; once you have run the Analysis you can perform Evaluate Tasks, and AppDNA will execute the packaging on the VM creating a Compatibility Container on the shared network drive.
In summary, provided 5 top tips how AppDNA can be used to determine whether an application is incompatible with Win 10 and App-V, automate the packaging by changing the default App-V Forward Path script, and creating a Task Script to create a Compatibility Container.
By Stu Moore, Head of ProductTags: CitrixCompatibilityContainerWindows 10/10S