Presented By- Ryan Will and Drew Walz
In the continuation of the popular Sequencing for Success series, learn how to sequence like a boss. Just because an application doesn't work at first pass, it doesn't mean it can't be virtualized. In this session, discover how shims and symbolic links can improve application compatibility. Learn how to identify the files and folders that need them. Find out how to use the same tools to troubleshoot application errors once an application has been virtualized.
Session Takeaway: Because there are still many applications that have issues being virtualized, you will learn techniques that offer a second look at an application previously thought of as unable to be sequenced. Knock a new App-V project out of the park!
2. Bio: Ryan Will
Eight years in the industry
Seventh year of working with App-V
Systems Architect II at nGenX
Fourth BriForum, Second year speaking
Blog: www.RyanWill.com
Twitter: @RyanWilldotcom
Email: Ryan@RyanWill.com
3. Drew Walz: Bio
Beating on windows apps in Terminal
server/RDSH scenarios since 2002
Director of Systems Architecture for nGenx
Corporation
Started my IT career providing dial-up internet
tech support.
Twitter: @drew_walz
Email: drew.walz@ngenx.com
5. Start with a solid foundation
< Not a solid foundation
6. Sequencer build
Use a Virtual Machine
Snapshots
Roll back to clean between sequences
Use multiple snapshots for different scenarios
Power off VM before creating - http://www.tmurgent.com/TmBlog/?p=1311
8. Sequencer build
Run Windows update
Keep updates in sync with your client build
Prerequisites and Windows Updates
Test prerequisite updates
Disable UAC and System Protection
Domain joined
Run empty sequence. Compare to domain and non-domain
http://ryanwill.com/app-v-5-sequencer-reboot-error/
Can break domain machine trust after 30 days
No anti-virus
9. Client build
Keep updates in sync with the sequencer
Windows updates
Prerequisites
Install non-virtualized pre-requisites
Set anti-virus exclusions
Client version should be the same or higher
Backwards compatible
Have at least one VM with snapshots for testing.
The more the better.
12. Troubleshoot app errors
App Prerequisites
Make sure the prerequisites exist… somewhere
Are they on the client machine?
Are they in the App-V package?
If they are not virtualized, make sure they are on the client
App-V 5.0 SP2 + will capture Visual C++ Runtimes
13. Troubleshoot app errors
Next steps
Enable/Disable local interaction
Enable for Office add-ins
Allow VFS write access
Run ProcMon and check for
Access denied
Missing files/folders
Check sequencer exclusions
Tools, Options, Exclusion Options
Test on a clean client in standalone mode
http://bit.ly/1CBeUTD - http://virtualvibes.co.uk
14. Troubleshoot app errors
Check the client logs
Event Viewer – Applications &
ServicesMicrosoftAppVClient
ViewShow Analytic and debug logs
Check the client logs when
AppV package won’t launch
Unusual application crash/errors
Download AppV_Manage
http://www.tmurgent.com/appv
Check the local app/system logs
15. Troubleshoot app errors
Check the sequencer logs
Event Viewer - Applications & ServicesMicrosoftAppVSequencer
ViewShow Analytic and debug logs
Check sequencer logs when
Application packaging fails
Crashes while sequencing an application
• Not much help when a packaged
application crashes on a client
21. Scripts
Use what you know
VBS, PowerShell, Batch Script (CMD)
Copy files to/from the VE
Licensing
Use a script to copy license files containing different keys
Some vendors have site media
Files/Folders
INIs
Templates
Registry changes
Custom registry keys for a specific user/department
22. Symbolic links
A file-system object that points to another file system object.
Can be a file or folder
Created via command line
No separate installation needed
No scripting knowledge required
24. Using Symlinks with AppV
May require modifying the AppV package
Demonstration BriForum 2014 –
Sequencing for Success
http://ryanwill.com/?p=287
25. Shims
Created via Microsoft Application Compatibility Toolkit (ACT)
A shim is a small library that transparently intercepts an API and changes the arguments passed,
handles the operation itself, or redirects the operation elsewhere - Wikipedia
27. Symlinks & Shims - Advantages
Good for a large quantity of data
Avoid launch delays due to file copy
Store files/folders outside of the Virtual Environment
App stores data in Program Data, Program Files, etc.
Allow data to persist between package GUIDs
When you can’t use scripts
Company policy may limit scripting abilities
Haven’t upgraded to AppV 5 SP2 HF4 +
Work around VFS write access
29. Identifying files/folders
Tools
ProcessActivityView
Monitor a single process for files read, modified, and deleted
Can detect a missing file if the app tries to access it
ProcMon
Can be overwhelming
Great if you’re having trouble finding to where an application writes
data
WinMerge
Great for comparing differences between text files and directories
30. Identifying files/folders
Recommended steps to monitor an application
Use a test VM that you can roll back to clean
Install application natively
Configure the software
Get as close to live deployment as possible
Take snapshots of your VM (timesaver if you need to start over)
Prepare monitoring tools
Start application and get to the data change point
Start monitoring tool(s)
Make changes in application and wait
Stop monitoring tool(s) and look for your changes
31. Demo #3 – How to locate where an app writes data
Demo Removed
33. Application printers
Typically a PDF converter
Must be installed separately on the client machine
Occasionally locked down to app specific use
Can be hard to track down separate installers
Adobe Acrobat: Adobe PDF Converter
No separate install released by Adobe for Acrobat users
A PDF Creator Add-on is packaged with other Adobe software
Works with Acrobat Sequences
Adobe PDF Pack Desktop Printer
Untested with Acrobat. Subscription pricing - probably not worth it.
34. Application printers
Printer installation media
Search the install media
Look for an MSI or EXE
Check TEMP directory during installation
%Temp%
Extract MSI, check for separate installer
35. Application printers
Printer installation media
Contact software vendor for standalone install method
Vendor: “Just install the software. We don’t support separate installs”
Contact print driver vendor for standalone install method
Vendor: “Sure we’ll give it to you if you buy a license from us”
Modify MSI to only install print driver
Capture printer install with MSI packager
Advanced Installer, EMCO
Very messy
36. Amyuni Printer Drivers & AppV
Abila, Intuit, Sage, Vertafore, etc.
Amyuni Document Converter Driver
Printing restricted to the app it came with
Look in Program Files for the installer or extract the MSI
License key stored clear text in HKLM
RDS Hosts – Delete from the AppV package
HKLMSystemCurrentControlSetHardware ProfilesCurrentSoftware
Alternate Registry Editor location - HKEY_CURRENT_CONFIG
Must be accessible and shared between users
Make sure users have modify access to the printer key
Will be created on the local system with printer install
Introduction – Ryan
My name is Ryan Will. This is my Seventh year of working with App-V. I live in Evansville, IN where I am a Systems Architect at nGenx.
This is my Fourth time attending BriForum and my second year speaking.
I have a blog RyanWill.com where I tackle first world problems with application delivery. You can reach me via twitter handle @RyanWilldotcom or email Ryan@RyanWill.com
Started my IT career providing dial-up internet tech support.
Y’know, so I understand Pain.
Ryan - We have a full agenda today.
We’ll get into solidifying your sequencer and client machines.
How to troubleshoot applications that have been sequenced.
Two demos troubleshooting demos
How to take a sequence and reuse multiple times. And why you would want to do so
How to identify files and folders that you may need to redirect outside of the AppV VE
What you should do with those pesky application printers and drivers. With a special mention of a certain print driver we’ve seen several times.
And a compiled list of tools and resources.
Ryan - Starting with a solid foundation starts at the sequencer and client machines.
Ryan - Using a virtual machine for your sequencer is a must.
This allows you to use snapshots and have a clean VM in just a few clicks.
Be sure to have different snapshots for different scenarios.
You may need a different version of the sequencer or have Office for certain applications.
When taking a snapshot, make sure the VM is powered off.
If you take a snapshot with it on, it can cause duplicate AppV pkg IDs.
Ryan - Make sure to keep your machine as clean as possible.
This is a screenshot of one of my sequencers. It has .NET Framework 4.5.2, Office 2013, Silverlight, and some F# runtimes on it.
Ryan - You want to make sure Windows is patched when taking your snapshots.
But make sure to keep the updates in sync with your client machine. Windows Updates can break applications and it’s a good idea to keep them at the same patch level.
Disable UAC and System Protection. Again, you want the machine to be as lean as possible and not capture any miscellaneous items
You can join your sequencer to the domain. You may capture some items you don’t normally see when you’re in a workgroup. So do a comparison of what you capture in a sequence while on and off the domain. Set exclusions as necessary.
If you do join it to the domain, you may have problems rebooting during a sequence. I have an article on how to fix that on my blog.
Also watch out for domain trust breaking when rolling back a sequence over 30 days old. Can set GPO to keep from happening.
Make sure you don’t have anti-virus installed. You don’t want this messing with your sequence, but of course be careful what you do on the sequencer. Another good reason to keep it off of the domain.
Ryan - Just like the sequencer, make sure the patch levels are in sync. This helps to avoid application issues.
If you have any prerequisites that aren’t included in your app-v sequence, make sure they are installed on the client machine.
Set your anti-virus exclusions. To my knowledge Microsoft hasn’t released any recommendations. But I make sure to exclude the Package Installation Root.
The client version of the AppV client must be equal to or higher than the version it was sequenced with. The client is backwards compatible if you need to upgrade without touching the App-V packages.
Keep as least one client VM around for testing. Personally I think the more you have for testing, the better.
Ryan On to troubleshooting application errors.
We’ve all seen applications crash. It happens regardless if an application is virtualized or not. But what about when the virtualized application crashes on a specific feature or function of the application.
Let’s learn how to troubleshoot a reoccurring error for virtualized apps.
Ryan - So you’ve sequenced a few applications and they went well. But now you’ve come across an application that crashes every time you run it. Hopefully that’s why everyone is here today. Let’s learn how get that sequence up and running.
Application Prerequisites
Make sure they exist somewhere.
Are they on the client machine?
Are they in the App-V package?
In my experience this is one of the #1 issues where I’ve seen an application have problems.
You must have them installed where the application can see them or the application isn’t going to work properly.
One thing that AppV 5 SP2 & higher does is virtualize the Visual C++ runtimes. Previously you had to install those ahead of time on the client machines.
Try disabling and enabling local interaction in the sequencer depending on how you have it set now.
In my experience I’ve always needed to allow local interaction for Office addins. For example you can’t click and drag attachments to outlook with it disabled.
Try allowing Full VFS write access.
Check your sequencer exclusions. See if the sequencer excluded any files or folders that are necessary for the application to function. Maybe it captured too much and you need to exclude certain files.
Test on a clean AppV client machine in standalone mode. This will help ensure you don’t have anything else on the machine to interfere with the testing.
Be sure to check the AppV client logs
You can find them in the Event Viewer\Applications&Services\Microsoft\AppV\Client
Go to the view menu and click Show Analytic and Debug logs
You have will see a lot more options now for logs.
Check the client logs when – an appv package wont launch or you see unusual errors or application crashes
I highly recommend downloading Tims tool AppV_Manage. It is a great tool for troubleshooting issues and having one spot to view the logs.
The logs are in the same location as the client except they are under the sequencer folder. Be sure to enable the Analytic and debug logs
Check the sequencer logs when
Application packaging fails
The sequencer crashes while sequencing
This doesn’t provide much help when your having issues when a packaged application crashes on a client
Ryan .NET User profile error
Ryan Crystal Reports file length issue.
Drew Another way to sequence like a boss is to reuse your AppV sequences instead of creating duplicate ones for different deployments.
Drew In order to reuse a sequence for different deployment scenarios, we need a way to be able to modify the AppV package on the fly.
Listed in order of usefulness: Scripting, Symbolic links, and shims
Drew You can use the built-in windows supported scripting languages to script in your changes.
Scripting is very flexible with appv. You can use what you know – Batch scripts, PowerShell, and VBScripts
Drew You can use the scripting language you know – Visual Basic, PowerShell, Batch Scripts
Scripts can used for copying files to and from the virtual environment
Copy files such as License files – If you multiple license keys because you manage different departments, business entities, or are a service provider. Copy these in at application runtime.
Some vendors have site media so the software doesn’t activate against a SID and can push the package out to several machines.
You can also use scripts to copy files and folders. Such as INIs that contain database or SQL instances, templates, reports, anything that may need to be changed.
With scripting you can also make registry changes. You may have different values/keys depending on what user or department is logging in.
Drew The next option is using symbolic links.
A symbolic link is A file-system object that points to another file system object
It can be a file or folder and is created via the command line.
No separate installation is needed to manage these and you don’t need to how to script to use these.
Drew To make a symbolic link you use the command line – MKLINK
And use the parameters /D for a directory
And no parameter for a file
Drew When you use symbolic links you may need to modify the AppV package. For examples be sure to watch last years Sequencing for Success session
You may need to either remove or merge the files or folders you want to redirect.
Drew Next we have shims. Shims are created via the Microsoft Application Compatibility Toolkit – ACT for short
The best definition of a shim I could find was on Wikipedia. Which defines it as - A shim is a small library that transparently intercepts an API and changes the arguments passed, handles the operation itself, or redirects the operation elsewhere
Explain the chart.
Drew To download the toolkit you can visit this URL.
I/Ryan has a blog post on creating shims.
You can also view last years presentation for some shim demos
Drew There are some advantages of Symbolic links and Shims over scripting
You can avoid application delays due to large file copies. Symlinks and shims redirect the application straight to the source.
You can use these to store files/folders outside the AppV Virtual Environment.
If an application stores data in Program Data or Program Files, you can redirect certain files or folders to an alternate location. Such as the user’s home drive.
This can allow the data to persist between future package GUIDs and makes the data easier to get to.
I imagine some companies may have restrictions on what you can do with scripting. Hopefully not, but if so this could be an alternative for you.
If you have red tape on what versions of AppV you run and can’t use AppV 5 SP2 HF4 or higher, this can help you work around the VFS write access problem pre-SP2 HF4.
Drew Next we’ll move into how to identify those files and folders that may need to be modified via script or symbolic links or shims.
Drew If you are unsure where an application is storing data or writing configuration files to, you have several tools at your disposal.
Describe these:
ProcessActivityView
ProcMon
WinMerge
Drew Go through the list
Ryan Explain the demo then start
Ryan Lets move onto to how to handle applications that bring printers along with them.
Ryan Most application printers are typically some sort of PDF converter
AppV will not allow you to virtualize printers or drivers at this time. So you must install them separately onto the client machines
Keep in mind that sometimes the printers are locked down so they can only be used by the originating software it came with. So just because you can’t print to it from notepad, doesn’t mean your install does not work
It can be very difficult to get a stand alone installer for a driver or printer.
Adobe acrobat is one of those next to impossible to obtain examples.
They do not have a separate installer for their PDF printer. It has to be installed alongside Acrobat.
However, they do have a separate software package that contains a PDF creater addon that works with acrobat. But the chances of you owning the software is probably pretty slim.
I recently found out adobe has something call Adobe PDF pack desktop printer. It’s a cloud based subscription with an option to download a desktop printer. I have not personally tested this so I have no idea if it would work. IF it does work, you would have to consider if $7.50 a month is worth the cost.
Ryan As I mentioned earlier, locating stand alone printer media can be difficult. Here are some recommended steps for trying to obtain this: list the steps.
Ryan As I mentioned earlier, locating stand alone printer media can be difficult. Here are some recommended steps for trying to obtain this: list the steps.
Ryan The Amyuni print drivers gets its own special mention. This is one we tend to see more often than any other printer.
Example applications are Abila software, Intuit, Sage, Vertafore and many others.
The driver is named the Amyuni Document Converter Driver.
Printer access is restricted to the application it came with. And its restricted to certain functions. You can’t just print to it from anywhere in the application. It must come from a Save as PDF function in the app because it sends an unlock code to allow printing.
To find the installer you can typically find it in the program files directory of the installed application. You should alse be able to locate it in the MSI if you extract it.
The license key for installing is easy to find since its stored clear text in the registry
If you are deploying to the printer Remote Desktop Host and using the application with AppV, you will need to make some modifications to the AppV package.
You will need to delete the HKLM\System\CurrentControlSet\Hardware Profiles\Current\Software key
You can also access this location in the Registry Editor via HKEY_CURRENT_CONFIG
Users will need modify access to the printer key here due to the way the driver operates.
The key will be created when the printer is installed on the client machine.
Ryan You can typically locate the installer in program files. Look for the two highlighted files here Install.exe and Install.ini.
Ryan If it’s the correct Install.ini file, it will should show a printername of Amyuni PDF Converter. Keep in mind this is most likely not the printer name that application installed and looks for.
Ryan You can find the licensee code and license name in HKLM\System\CurrentControlSet\Hardware Profiles\Current\Software\<PrinterName>
Ryan Now that we have our media and license info, you can run a command line to install the printer. Make sure to double check the printer name from a default installation of your application. Go through the command line and how it made the custom printer.
Ryan Explain this list of tools and resources. Phew. Lots and lots of typing.