How to use an Application SHIM or Compatibility Fix with App-V 5

If you want to use an application that does not work on newer operating systems, it’s possible to trick the application to think that it is being started on an older operating system.
This trick is called a SHIM/FIX and can be created using the Microsoft Application Compatibility Toolkit.

The SHIM/FIX needs to be applied on the local system so when using Application Virtualization, like App-V, it’s required that the SHIM/FIX is applied before the application is started.

In this blog post I am going to create a virtual application with a SHIM/FIX to trick the application to think that it runs on Windows XP. The application I am going to virtualize is AIDA32 – Personal System Information 3.93 because this can display the system information and I can test if the SHIM/FIX works. AIDA can be downloaded here.

 

Step 1 – Creating a SHIM / Compatibility Fix

 

Download the Microsoft Application Compatibility Toolkit (ACT) here  
Copy the ApplicationCompatibilityToolkitSetup.msi to your computer.  
Start the installation of the Microsoft Application Compatibility Toolkit.

Click Next

image
Click I accept the terms in the License Agreement

Click Next
image
Click Next image
Click Install image
  image
Click Finish image
Extract aida32pe_393.zip and start the application  
AIDA32 displays the system information
In this case the information of the local system without a shim.

(Windows 7 Enterprise Professional)

Close the application

image
Start the Compatibility Administrator image
Click on Fix image
Fill in the name of the application, the Vendor and the Program file location.

The file location isn’t important because later it’s changed on the client to the App-V 5 location of the cache.
What is important is the version of the .exe. This needs to be exactly the same as the .exe in the App-V package.

Click Next

image
Select the operating system where the application can be started successfully.

For this application, I select Windows XP.

It’s possible to test the fix by clicking Test Run

Click Next

image
These are advanced options, I am not going to use them right now.

Click Next

image
These are advanced options, I am not going to use them right now.

Click Finish

image
Click Rename image
Enter the name of the application image
Click Save image
Enter the name of the application image
You can apply the SHIM/FIX using the command:

sdbinst.exe –q *file* .sdb

image
Start AIDA32.exe to test the SHIM/FIX image
The SHIM/FIX works because the Operating System found by AIDA is Windows XP and the application is started on Windows 7. image

 

Step 2 – Creating an App-V 5 package and integrate the SHIM

 

The next step is to create a virtual application and integrate the SHIM/FIX into the package.

 

Start the sequencer and click on Create a new Virtual Application Package image
Click Next image
Click Next image
Click Next image
Select Perform a custom installation
Click Next
image
Enter the name of the virtual application and the installation path.

Click Next

image
Install the application

Copy the SHIM/FIX file *filename*.sdb to the installation folder.

In my application I copied the file to the Windows folder.

 
Select I am finished installing

Click Next

image
Click Next image
Select Customize
Click Next
image
Optional: select Force…
Click Next
image
Click Next image
Select Continue to modify package without saving using the package editor

Click Next

image
Click Finished image
Click on Package Files

Check if the *filename*.sdb is in the list of files and write down the location in App-V 5 syntax.

For example: [{AppVPackageRoot}]\AIDA32.sdb

image
Click on File, Save  
Save the package image

Step 3 – Modify the App-V 5 DeploymentConfig.XML

 

Now that the SHIM/FIX is integrated into the virtual package, it’s possible to modify the DeploymentConfig.XML file so the SHIM/FIX is applied when the virtual application is started/streamed to the client.

 

Open the DeploymentConfig.XML file using Notepad  
Modify the file so the User Scripts are enabled and the following command line is added. This can be added to the Start Virtual Environment part of the XML file.

<Path>C:\Windows\System32\cmd.exe</Path>
<Arguments>/c "sdbinst.exe –q [{windows}]\AIDA32.sdb"</Arguments>

image
   
As always editing the App-V 5 XML file, you can use ACE to prevent errors. image

 

Step 4 – Test the virtual application and the SHIM/FIX

 

You can test the virtual application using two ways;

1) Import the application into the App-V 5 Management Console, or

2) Import the application on the client using PowerShell

I prefer option 2 before option 1.

 

Copy the Virtual Application to the client.  
Start PowerShell as Administrator  
Enable Script execution by running the command:

Set-ExecutionPolicy Bypass
image
Import the App-V 5 client module by running the command:

Import-Module AppVClient
image
Import the Virtual Package by running the command:

Add-AppVClientPackage –path C:\package\name.appv –DynamicDeploymentConfiguration C:\package\DeploymentConfig.XML | Mount-AppVClientPackage | Publish-AppVClientPackage
image
The application is now published into the startmenu and you can start it.  
When I start AIDA it displays Windows XP as operating system because the SHIM/FIX is applied.

Finished!

image

 

Additional information:

When a SHIM/FIX is applied to the system, it is placed in the folder: C:\Windows\AppPatch\Custom
The SHIM/FIX is saved here as the GUID name.

image

 

You can remove a SHIM/FIX from a system by using the command sdbinst.exe –u *path and filename*

image

This entry was posted in App-V, Microsoft General and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s