Two particularly useful Shims

As promised in my BriForum 2014 session, I will start a small series on Application fixes using shims and symbolic links. The first installment is on shims:

Shims can be really useful in just about any environment and I wish there were some better resources explaining how to use them. This is why I wrote this article explaining my two favorite shims.

As Microsoft releases new versions of their OS, folder structures and other key areas are bound to change. Or some applications may store personal user settings in a shared location or has a registry key that is best lived in HKCU instead of HKLM. This is where shimming or “Compatibility Fixes” come to the rescue.
A shim is installed at the system level and will essentially intercept an application call and change the default behavior of the application. The two main flavors of shims that I find extremely useful are CorrectFilePaths and VirtualRegistry. There are several hundred types of shims, but these two are the ones I find myself using a lot.

CorrectFilePaths
This shim is particularly useful when an application stores a file or folder in a directory that you want stored somewhere else. For example, say you install an application on an RDS server that stores a configuration file in ProgramData. This is not a good location if each user writes settings to it and get overwritten by other users. The CorrectFilePaths shim allows you to redirect the file call from the original path (e.g. C:\ProgramData\ABC Inc\UserConfig.ini) and replace it with a path that is user specific (e.g. %appdata%\ABC Inc\UserConfig.ini).

During shim creation you specify what process will be intercepted and redirected. This way when a user launches the process you specified and calls the file, it will be redirected to the new location. Now every user will have their own configuration file instead that doesn’t conflict with other users.

VirtualRegistry
Much like CorrectFilePaths, the VirtualRegistry shim allows you to redirect a registry call to a different location. An example where this would be useful is when an application stores a database server value in HKLM. This value may tell the application what server to establish a connection to. Now, say you have two groups of users – Group A & Group B. Group A connects to database server 1 and Group B connects to database server 2. Normally you would build a separate RDS server for each group to accommodate the multiple database values, but what if you wanted to have both user groups use the same server? How would you be able to accommodate that?

Create a new VirtualRegistry shim! You can redirect the HKLM values to HKCU and set those values with a logon script. This way Group A gets its registry key for database server 1 and Group B gets theirs for database server 2.

Shims sound great and they really are, but they can be a pain in the rear to get configured. I’ll post an article on both shims with examples in a few days.

If you want to get started Shimming, download the Application Compatibility toolkit from Microsoft here: http://go.microsoft.com/fwlink/p/?linkid=205020

Sequence Google Chrome v36 with App-V 5 SP2 HF4

Sequencing Google Chrome 36.0.1985.125 with App-V 5.0 SP2 HF4

GoogleChromeLogo

 

 

 

My personal lab setup-

Sequencer:

Windows Server 2008 R2 SP1 – fully patched as of 7/25/14

App-V version: 5.0 SP2 HF4

Non-domain joined

Client:

Windows 8.1 – fully patched as of 7/25/14

App-V version: 5.0 SP2 HF5

 

Pre-installation:

Download Google Chrome for Business – The IT manager (MSI) download

https://www.google.com/intl/en/chrome/business/browser/admin/

You should now have GoogleChromeStandaloneEnterprise.msi

 

Installation steps:

PVAD: C:\Dummy

If you want to use Microsoft best practices, here is the default installation directory: C:\Program Files (x86)\Google

 

Run – GoogleChromeStandaloneEnterprise.msi

The only way you will know the install is complete is by the new Google Chrome icon on the desktop.

 

Disable the following services:

  • Google Update Service (gupdate)
  • Google Update Service (gupdatem)

 

Save and deploy your sequence.

Catch me at BriForum 2014

BFBoston2014SPKR

You can catch me at BriForum Boston this year from July 21 – 23, 2014. I will be speaking with my colleague Rory Monaghan (App-V MVP) on sequencing for success.

We will discuss the best practices to get the best results with App-V. Ryan will detail how to use symbolic links, shims and other methods to enable you to produce a disposable application ready for us with any potential client. Sequencing once for many. Rory will discuss some sequencing best practices and give food for thought regarding planning. Just because an application can be sequenced, should it? Just because Microsoft says something like drivers can’t work or DCOM, that doesn’t mean you’re dead in the water yet. There may be a way to get around this. Also, Rory will cover some sample case studies of his successes for clients versus some failures.

Attendees will learn:
• How to produce an application that can be used for all of your customers who need it despite possible unique settings for each
• Examples of where this can be useful and required. e.g. Cloud Services
• Case studies of different client projects and success versus failures
• An idea of what set of applications may be better delivered as a local traditionally installed application
• How to decide to deliver applications which have been reported to have issues during Sequencing e.g. an application with DCOM, an application with Drivers, an application with COM+
• Learn some sequencing best practices and possible gotchas

Find more information on our session here

Information about the speakers: Rory and Ryan

briforum_US_logo

App-V 5.0 SP2 Hotfix Package 5

Microsoft recently released Hotfix Package 5 for App-V 5.0 SP2. The first two below are items that I’ve wanted for a while:

1 – Enabling user-publishing in the Administrator context through Windows PowerShell

This hotfix release enables user-publishing to be done in the Administrator context through the following four Windows PowerShell cmdlets:

Publish-AppVClientPackage
Unpublish-AppVClientPackage
Enable-AppVClientConnectionGroup
Disable-AppVClientConnectionGroup

To do this, use the optional -UserSID parameter, and pass in the SID of the intended user.

2 – Connection groups cannot support both user-published and global-published packages

With this hotfix release, App-V 5.0 SP2 supports creating user-entitled connection groups that contain user-published and global-published packages by using Windows PowerShell.

3 – Deprecation of PackageStoreAccessControl support in App-V 5.0 SP2

Effective immediately, the PackageStoreAccessControl (PSAC) setting that was introduced in App-V 5.0 SP2 is being deprecated in both single-user and multiuser environments.

 

Download the hotfix and get more information here: http://support.microsoft.com/kb/2963211/en-us

Updating a new Adobe Acrobat install

About to deploy Acrobat and find there are a lot of updates to install? Good luck trying to find an updated installer higher than version XX.0. Not only is it a pain to download and run every applicable update, trying to figure out the upgrade path can be like doing super math.

To make your life a little easier when deploying Acrobat, follow these steps:

1 .Determine the upgrade path

There is an Acrobat and Reader release notes page that can help you determine the upgrade path. Click on the version numbers to determine what version is required before that update can be applied. The patching got a little easier in 10.X and 11.X with more cumulative updates, but 9.x is still a PITA. For version 9, I suggest you obtain the upgrade path from here.

2. Download the update(s)

You can download all updates from this page.

3. Modify the Acrobat setup.ini

Next, grab your xx.0 installer and extract it with an archive utility such as WinRAR.

Open setup.ini with notepad and look for the [Product] section. Start a new line here line that begins with “Patch=” and list the MSPs in order from oldest to newest separated by a semi-colon.

Here are some examples of what your Patch line would be at the time of this writing:

Acrobat 11:

Patch=”AcrobatUpd11007.msp”

Acrobat 10:

Patch=”AcrobatUpd10110.msp”

Acrobat 9:

Patch=”AcroProStdUpd910_T1T2_incr.msp;AcrobatUpd912_all_incr.msp;
AcrobatUpd913_all_incr.msp;AcrobatUpd920_all_incr.msp;AcrobatUpd930_all_incr.msp;
AcrobatUpd932_all_incr.msp;AcrobatUpd933_all_incr.msp;AcrobatUpd940_all_incr.msp;
AcrobatUpd942_all_incr.msp;AcrobatUpd945_all_incr.msp;AcrobatUpd946_all_incr.msp;
AcrobatUpd950_all_incr.msp;AcrobatUpd951_all_incr.msp;AcrobatUpd952_all_incr.msp;
AcrobatUpd953_all_incr.msp;AcrobatUpd955_all_incr.msp”

4. Copy in your patches

Place all of the MSPs into the root of the installation folder. This is the same folder that contains setup.ini.

5. Install

Run the Acrobat install and let it run all of the updates for you. The final version to be installed should be displayed in the installation menus. This can help you verify the latest version will be ready when the install is complete.

Optional

Use the Adobe customization wizard to generate a custom install. You can insert your license key, change the install directory, set default PDF viewers, disable the EULA, and many other useful settings. You can grab Adobe customization wizard 9 here,  X here, and XI here.

Hopefully these steps can keep you from going crazy when deploying Adobe Acrobat (especially version 9).

Sequencing DWG TrueView 2015 with App-V 5.0 SP2

TrueView2015

There are several recipes out there for DWG TrueView 2014 and older, but I couldn’t find one for 2015. So here’s one for your sequencing pleasure. I’ll start off by saying that the recipe is very similar to the other ones out there, but I modified a few things to make the process simpler.

Sequencing System:

Server 2008 R2

App-V 5.0 SP2 with HotFix 4


Prerequisites-

Microsoft .NET 4.5

The following Visual C++  redistributables (if not using App-V 5.0 SP2):

  • 2008 x64 with SP1
  • 2010 x64 with SP1
  • 2012 x64 update 4

If you are using SP2, you do not need to worry about having C++ in your base build.

A sample DWG file – I grabbed one from here


Exclusions:

Remove the local appdata exclusion

If you do not remove this, the application will not launch when deployed.


Installation:

PVAD: Default location of C:\Program Files\Autodesk

Install using all default selections

Launch the DWG TrueView software.

This is where I differ from the other recipes and I’ll explain why.

Launching TrueView while sequencing will create the FTAs in the virtual environment. There will be no FTAs in editing mode if you do not launch it before finishing the sequence. Another reason is that you will need to open one of the sample DWG files I mentioned above. Doing so will drop two DLLs into AppData that will allow the application to open CAD files when published to a user (that’s the purpose of this application, right?). If those DLLs aren’t put into the package, you will be presented with this lovely message:

TrueView Missing DLL

Normally you could copy the DLLs to AppData from the originating location, but you won’t find them anywhere. Or you could always copy in the DLLs from another machine and manually create the FTAs, but why go through those extra steps?

Anyways, after you launch DWG and open the sample file, close DWG and finish the sequence.

Go straight to editing unless you need to optimize the package or restrict OS deployment.


Editing:

There will be some extra shortcuts that show up due to us launching the application. I removed all shortcuts except for DWG TrueView 2015.  None of the others show up in the start menu or desktop.

Go to the package files tab and browse to: ‘VFS\AppData\Autodesk\DWG TrueView 2015 – English\R13\enu\recent\select file’

Delete the file that shows up in this folder (This is a shortcut to the sample file you opened).

Go to the registry tab and browse to: ‘CurrentUserSID\Software\Autodesk\DWG TrueView\R13\dwgviewr-E001:409\Recent File List’

Delete the ‘Recent File List’ registry key (This will clear the recent files in the application).

Save your package and deploy.

 

Possible errors you may receive:

  • A DLL error when opening a DWG file. Be sure to launch a sample file while sequencing as mentioned above
  • Launching the published application and receiving: Unhandled e0434352h exception at fe0xxxx. Make sure you have .NET 4.5.X on your target machine.

Bonus:

Direct download links for DWG TrueView 2015

64-bit

32-bit

App-V 5.0 SP2 Hotfix package 4!

Finally! The hotfix package we all have been waiting for.

For starters, grab the hotfix package here: http://support.microsoft.com/kb/2956985

The fixes are as follows:

  • Enhancements to publishing and refresh performance have been made in all App-V deployment scenarios (RDS, Traditional Desktop, and VDI).
  • Publishing and start performance have been implemented in non-persistent VDI or RDS deployments together with a user environment management (UEM) technology.
  • Package converter has reported low success rates and low detection diagnosis.
  • Virtual application packages that require write access to any files and folders in the virtual environment are incompatible with App-V 5.0.
  • Upgraded versions of virtual application packages cannot be deployed in parallel with the original version of the package on the client.
  • Virtual application packages that contain shortcuts to executable (.exe) files on a network share cannot start those executables if the system account does not have access to the network share.
  • App-V Deployment configuration does not handle certain registry settings correctly.
  • The Windows PowerShell window is listed on the taskbar during App-V Client startup.
  • App-V Service crashes when packages are deployed through System Center Configuration Manager.

All things considered, I would consider this App-V 5.1 with the way Microsoft has been naming their product updates as of late. Things that caught my eye: Writable VFS, improved performance in VDI environments, and application shortcuts on the network.

As always, please use caution when deploying an update and test on a non-production system first.

App-V 5 and duplicate package GUIDs

An associate of mine recently discovered that we had two App-V 5 packages with the same GUID. This was not a case of mistakenly adding onto an existing package or anything weird like that. These were two new sequences made by reverting the snapshot on the virtual machine back to clean. This was a strange predicament because these are supposed to be randomly generated GUIDs with little chance of ever coming across the same GUID again. As we dug into it some more, we found two more packages with similar GUIDS, but different from the first. In total we have four sequences in our library that had duplicate GUIDs.

A quick search of the interwebs brought us to an article by Tim Mangan (godfather of App-V). I recommend anyone that will be sequencing applications read that article, but to sum up- Don’t take a snapshot of your virtual machine with it powered on. Make sure your snapshots are taken with the machine powered off. This will ensure the seed that creates the unique GUID will be different than the one that was saved in your snapshot. It may add a few seconds to your process, but its worth it in the end to avoid this issue.

Read more here: TMurgent

Batch and Powershell sleep commands

Sometimes when creating a script, you may need the script to wait or sleep for a certain period of time.

Batch Scripts:

If you search the interwebs, you will find a lot of workarounds that involve pinging a network address for a certain number of times. While this gets the job done, it isn’t necessarily the most straightforward way.

Luckily, there is another command that allows you to specify a wait time in seconds. This command is called timeout, which is something you are probably familiar with if you have kids. It does exactly what it sounds like, it sits there and waits for the number of seconds you specify. Or if you want the Microsoft definition: This utility accepts a timeout parameter to wait for the specified time period (in seconds) or until any key is pressed. It also accepts a parameter to ignore the key press.

According to Microsoft, the command applies To: Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista, Windows XP.

So I am curious why this isn’t more widely used.

PowerShell:

Although you can use the same command with PowerShell, you may want to take advantage of a new command called Start-Sleep. The Start-Sleep cmdlet suspends the activity in a script or session for the specified period of time. You can use it for many tasks, such as waiting for an operation to complete or pausing before repeating an operation.

Find more on these commands here:
Timeout
Start-Sleep