How To: Creating Shims

By Rory Monaghan

SHARE

If you do not have the luxury of using an Application Compatibility tool such as Citrix AppDNA, Quest ChangeBase or Flexera Application Compatibility Pack you will not have the capability of creating automatic compatibility fixes. Which will mean you will rely on creating shims of manifest files to resolve some of your compatibility issues. Microsoft recommends developers to use manifest files for their developed applications, the manifest file lives with the .exe of the app and mitigates certain compatibility issues. Manifest files are not meant to be applied to third party applications. Instead, Microsoft suggests us to use Shims.

Shim are like a trick or a lie to your operating system. You create one per application with an issue. As you will see illustrated below you can target per application. The shim will then live on your systems alongside the application. It acts like a listener, waiting for the application you targeted during the creation of the shim to launch and when the application attempts to invoke the action which without the shim applied was generating an error, the shim kicks in and tells the application to allow the application to function. This may seem a little confusing. I hope to clarify as I go.

SHIM1

 

You can open Application Compatibility Administrator and you will see the above Interface.

SHIM2

 

If you expand applications you will see a long list of application within. Each represents valid shims for these applications. These are canned and ready for your use. This list does seem to be pretty outdated but I guess it would be, considering newer applications will be compatible. The list contains a large variety of application types but seems to be mainly for games.

SHIM3

 

If you expand fixes you will see a long list of possible fixes. These are individual fixes which can be applied as required. For example if you have an application which checks what version system you are running upon launching, you can use a SystemVersionLie to trick the application and OS to believing the version being checked by the application, is the version of the operating system being run. Tricky Dicky!

SHIM4

 

Compatibility Modes are specific pre-identified and known issues which can be resolved using a special compatibility mode. For example, you might browse to the properties of a .EXE on your system and set a compatibility mode to Windows XP SP3. Well, you can set that for your users applications by using a shim if you would like.

SHIM5

 

To create a shim browse to the yellow drum symbol, right click and choose to create a new Application Fix.

SHIM6

 

In this dialog type in your application name. Vendor Name and then browse to the .exe with the issue.

SHIM7

 

If you would like to use a compatibility mode you can select it here. It’s a good idea to not use compatibility modes when not required. If you can figure out the individual shim or shims required you should do that instead. Which is in the next dialog. Click Next.

SHIM8

 

For Orca 3.1, I was noticing that when I try to open Orca I got a prompt that it requires elevation. The fix for this issue is RunAsInvoker. Unfortunately there’s not a whole lot of info regarding Shims. When you look at the list of shims available you may feel overwhelmed and wonder if you’ll need to use most or all of them. The truth is, you will not. In fact you are likely to only use five or six. The most commonly used are RunAsInvoker as described here for handling UAC prompts for elevation. SystemVersionLie for getting around OS checks. If you have an application that requires to always run as an Administrator you can use RunAsAdmin. ForceAdminAccess will resolve issues which may arise if an application will only run if the user is a member of the local Administrator group. Session shim will help when Session 0 is a problem. You can also use Folder Redirection or Registry Redirection shim when you know of either which requires redirection to work. This solution seems to set up a symlink or something similar to dummy to the system that the file or registry is in the correct location.

SHIM9

 

The final dialog shows what will be used for validating what .exe the shim should execute for. For example you could base it off the sum count of the .exe.

Let's make virtualization easier!

Be amongst the first to know when I publish new reviews, guides and tools to simplify your projects.

By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.

We'll virtualise your 5 most complex apps for FREE