Categories
How-to Microsoft Windows Installer, Application Compatibility and Deployments

Application Compatibility Toolkit 5.5 Guides, How To Tutorials

Microsoft Application Compatibility Toolkit is a lifecycle management tool that assists in assessing compatibility issues in your overall application/device/computer portfolio.  This tool helps in,

  1. Gathering Inventory for software, hardware, and device assets
  2. Compatibility evaluation and Get Vendor Support Statements
  3. Recommendations for fixing applications
  4. Tools to apply compatibility fixes or “shims” to applications

The Application Compatiblity process can be easily defined in 3 Steps – Collect-Analyze and Mitigate.

To facilitate Readers/ People who plan their first steps towards Application Compatibility, I have written these 6 Part Series on various tools which are a part of the ACT. These articles will provide information on how to start the appcompat process in an organization (or even as an individual) and fix applications!

Application Compatibility Process (ACT 5.5)

Install and Setup the Application Compatibility Environment

This article will give you detailed instructions on how you can setup up the ACT 5.5 Environment, configure the Application Compatibility Manager and start the AppCompat Process. This is the first step towards solving Application Compatibility Issues with Windows 7.

Creating and Deploying a Data Collection Package (DCP)

In this article, we will look at how to Create and Deploy a Data Collection Package (DCP) to gather inventory for software, hardware, and device assets. This package will start the ACT Data Collector Service to monitor the machine State. You will also learn options to schedule the Data Collection.

How to Analyze the Application Reports Collected?

In this article, we will look at how to categorize and prioritize applications in the ACT report which we get from the Data Collection Packages. We will also look at how to send/receive reports to get hints and support from the Community on solving AppCompat Issues.

Testing your applications as a Standard User

During Develop / Deploy phase of an application, its very important to test the functionality of an app as a Standard User. Especially when the organization has a locked-down environment. Standard User Analyzer tool exactly helps you in this purpose!

Identify Website Issues with Internet Explorer Compatibility Test Tool

This Tool collects your Web-based issues from Internet Explorer 7 / Internet Explorer 8, uploads the data to the ACT Log Processing Service, and gives the details about discovered compatibility issues. It also provides you links for more information about each of this compatibility issues.

Creating Shims to Fix Broken Applications

This article explains the Compatibility Administrator tool which enables you to resolve many of your potential application compatibility issues. It also explains you on how to create customized compatibility fixes, modes, AppHelp messages, and compatibility databases.

Shims for Specific scenarios:

Do lemme’ know your comments and Thoughts.!

Categories
Windows Installer, Application Compatibility and Deployments

Creating a Shim/Fix Using Compatibility Administrator

In the earlier article on Analyzing the ACT Reports, we learnt on how we can identify the application Compatibility issues in your machine/organization. Even If you are not keen in generating an app-report,  this method described in this article will help you learn how to mitigate an application using shims.

The Compatibility Administrator tool enables you to resolve many of your potential application-compatibility issues before deploying a new version of Windows in your organization. This tool enables you to create customized compatibility fixes, compatibility modes, AppHelp messages, and compatibility databases.

Process to Fix an Application – The steps involved in fixing an application using this tool is quite easy. First launch the application, test its functionality. If your enviroment is a locked-down one, then test the application as a Standard User. Identify the issues which arise. Use the Compatibility Administrator tool to create a new Shim database (.sdb), select the compatibility modes and fixes for this application. Apply this shim and test the application again. If the app works and responds fine, deploy the same on the machine.

Compatibility Administrator Process

Step 1: Install the Application Compatibility Toolkit and Start the Compatibility Administrator. You will need to run this as administrator

Launch Compatibility Administrator

As mentioned earlier, This tool  provides individual compatibility fixes, compatibility modes, and AppHelp messages which can help you resolve specific compatibility issues. Right click on the New Database, you will find these below options.

Creating an Application Fix Compatibility Administrator

Step 2: In this example, we will look at how you can fix an application. So lets choose Application Fix here. In this below dialog, give the application details and the executable you would wanna fix.

Create New Application Fix

Step 3: When you press the next button, you will get to see the list of the compatibility modes listed by default. If you have an issue with just the version in-compatiblity then choose the version in which the application was working earlier! You can also do a “Test Run” of the app.

OS Modes - Compatibility Administrator

Step 4: As of now, lets not choose any OS mode here. You can do it in the next window (when you have combination of shims to be choosed). As shown below, you have lots of shims to choose from. Select all the shims which would fix your application (based on the analysis you did during the Application Tests or from the Analyzed Report).

Available Shims - Compatibility Administrator

As you can see above, few of the shims do have parameters to work with. You can check the ACT Documentation to understand more on these individual shims. Check out these 2 articles, where I have written on how you can use Parameters for File and Registry Re-Direction shims (VirtualRegistry and CorrectFilePaths).

Step 5: Let me select the shims, which will resolve the issues with the application I am currently fixing. You can click on the Show Selected Button, which will list out all the shims you have selected.

Selected Shims - Compatibility Administrator

Summary Fixed Application - Compatibility Administrator

Click on Finish. This will give you the complete summary of the application and the fixes applied.

Summary Application - Compatibility Administrator

The Windows installs a System Application Fix database for use with the Compatibility Administrator. This database can be updated through Windows Update, and is stored in the %WINDIR% \AppPatch directory. The custom databases which we create are automatically stored in the %WINDIR% \AppPatch\Custom directory and are installed by using the Sdbinst.exe tool provided with the Compatibility Administrator.

Step 6: Now you need to save this shim database file, and install it. You can either install it by, right click on the shim and press install button, or by using a command-line option.

Install Shims

Or using Command Line arguments – sdbinst.exe C:\msigeek.sdb

sdbinst Command Line

You also have an option to use a query tool that enables you to search for installed fixes on your local computers.

Query Database

You can read these articles to understand more on how to create shims for specific scenarios.

You must keep it in mind that, shims would just pass the condition (in simple words.. just a return true). This does not ensure or simulate the platform. So only when you are sure that, the application functionality can be achieved and this condition is just a road-block.. you can use shims to mitigate these issues!

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

VirtualRegistry Shim: Registry Re-Direction to Fix Broken Apps

In this article, we will look at how to create a Registry redirection and make the application point to a new hive instead of the old one!

The Compatibility Administrator tool enables you to resolve many of your potential application-compatibility issues before deploying a new version of Windows in your organization. This tool enables you to create customized compatibility fixes, compatibility modes, AppHelp messages, and compatibility databases. To know more on how to create one and implement it, Read – Creating a Shim/Fix Using Compatibility Administrator.

Scenario: When I launch this application, and press on the browser button, i get a error dialog which says “The browse functionality requires IE6”. Windows 7 comes with IE8 as the default browser and we do not have any options to downgrade it to IE6.

Browse Internet Explorer 6

If the browse functionality will not work in IE8 or by Emulating IE7, and only works in IE6; the method to make it work is using Windows XP Mode.

On analyzing with Process Monitor (a Sysinternals tool) and clicking the Browse Button again, we will see a detailed report on all the resources this application action accessed. In this below dialog, you can find that this action has actually checked the IE Version number in the registry hive.

Process Monitor - Queries the IE Version

I reckon that the developer of this application had some functionalities which was working only with IE6 (at that time – legacy app), and hence, he would’ve added this as a launch condition. As IE8 is a higher version, and it would have a backward compatibility.. we will just need to comment this condition of checking the browser. Now if we want to send this application to the developer again to fix this simple stuff, it would involve lots of efforts of re-compiling, testing, communication etc. This is where, the shims come into picture.

In this post,we will create a new registry hive and path; make this application to point to the new hive, when the quering is done.  VirtualRegistry Shim exactly helps us in doing so.

Step 1: Create a new registry key which would mimick the original registry key. Instead of HLM->Software->Microsoft->Internet Explorer->Version, I will create a new hive in HKLM->Software->msigeek -> Fix Apps ->Internet Explorer->Version

Creating a Redirect Registry

Step 2: Launch the Application Compatibility Administrator, and create a new Application Shim. Select VirtualRegistry Shim and press the parameters button. This will give you options to configure the paths. You will need to use the ADDREDIRECT command.

VirtualRegistry Shim Parameters

Step 3: Give the parameter for this shim.

ADDREDIRECT(oldpath^newpath) is the general syntax. In our scenario, we will give it as ADDREDIRECT(HKLM\Software\Microsoft\Internet%20Explorer^HKLM\Software\msigeek\Fix%20Apps\Internet%20Explorer). You will need to give %20 to signify empty spaces.

VirtualRegistry Shim with IE Parameters

Step 4: Apply the shim and test the application.

Now, when I launch the browse button, the Internet Explorer window opens. What happens in background is that, a condition is checked for the old path and this shim redirects it to the new one. This passes the condition and launches the browser!

This mitigation technique can be used for any registry path redirection. If you have any application which is hard-coded and checks a particular registry key, this technique can make it refer a new path and hence pass the condition. You must keep it in mind that, this would just pass the condition (in simple words.. just a return true). This does not ensure or simulate the platform. So only when you are sure that, the application functionality can be achieved and this condition is just a road-block.. you can use shims to mitigate these kind of issues.

If you have issues with Hard-coded file paths, then do read this article!

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

Using CorrectFilePaths Shim to Fix Broken Applications

In this article, we will look at how to create a File redirection and make the application point to a new File Path instead of the old one!

The Compatibility Administrator tool enables you to resolve many of your potential application-compatibility issues before deploying a new version of Windows in your organization. This tool enables you to create customized compatibility fixes, compatibility modes, AppHelp messages, and compatibility databases. To know more on how to create one and implement it, Read – Creating a Shim/Fix Using Compatibility Administrator.

Scenario: When I launch this application, and press on the update button, i get this below error dialog which says “Access to a certain path is denied”. This can occur in a locked down environment or as a part of the User Account Control, where the user works as a Standard User unless he elevates explicitly.

File Access Error

This application stores the configuration preferences in an ini file which gets saved in the folder C:\Windows\Downloaded Program Files\. This is a protected folder and a Standard User will not have permissions to write on it. We will need to change the path to a folder where a normal user will have the access, the %APPDATA% (User Profile’s Application Data) folder.

In this post,we will change this file path; make this application to point to the new folder, so that when this file tries to get saved…we do not get an access denied error. CorrectFilePaths Shim exactly helps us in doing so!

Step 1: Launch the Application Compatibility Administrator, and create a new Application Shim. Select CorrectFilePaths Shim and press the parameters button. This will give you options to configure the paths. You will need to use the ADDREDIRECT command.

CorrectFilePaths Shim

Step 2: Give the parameters for this shim.

General Syntax: “oldpath”;”newpath” . In this case, we will give it as  “C:\Windows\Downloaded Program Files\StockViewer.ini”;”%USERAPPDATA%\StockViewer.ini”

Parameters - Correct File Path Shim

Step 3: Apply the shim and test the application.

Now, when I click on the Save Preferences button, the configuration File gets saved. What happens in background is that, the hard-coded path is redirected to the new one. The User Application Data folder has the write access and hence the file gets created!

Redirected File gets Created in the User AppData

This mitigation technique can be used for any file path redirection. If you have any application which is hard-coded and writes to a particular restricted file paths, this technique can make it refer a new path and hence give you access.

If you have issues with Hard-coded registry key paths, then do read this article!

Categories
How-to Microsoft Windows Installer, Application Compatibility and Deployments

Create Shims or Compat Modes in Windows 7 – AppCompat Series

In this first part of the AppCompat Series, we will look at the significance of the OS version number change (6.1 in Windows 7) and how will this impact the existing applications. We will also look at the ways to mitigate them. The internal version number for Windows Vista is changed to 6.0 and 6.1 for Windows 7.  The GetVersion function will now return these version numbers to applications when queried { dwMajorVersion (6) and dwMinorVersion (0 or 1) }.

Any application that specifically checks for the OS version may get a higher version number which it may not be designed to handle. Setup packages may prevent themselves from installing and applications may prevent themselves from starting. Summing up, when a developer writes the code to check for the version numbers, there are some potentional issues with few of the applications.

  1. They only check the dwMajorVersion (These application will only install in Windows 2000,XP and Server 2003)
  2. They hardcoded the Version checks { if (majorVersion = 5 && minorVersion = 1) } (These application will only install in Windows XP)
  3. They implemented a wrong condition check { if (majorVersion > 5 && minorVersion > 1) } (Though the check condition loooks correct, this fails on Windows Vista)

The windows Team suggests the developers not to use the Version Numbers Checks in their applications !!

Mitigations

For new applications,

  1. Best Practice is to check for features instead of versions
  2. Look for OS versions greater than (>) compatible OS version

You can get the version numbers for all the Windows OS here

For existing applications,

Method 1: Compatiblity modes – Right click on the executable (StockViewer.exe in this example), goto the compatibilty tab. You will find all the previous operating systems. You can select the version in which it had worked/installed. Click on Apply and close the window.  Now you can invoke the executable.

comp_modes

Method 2: Applying Shims / Layers – If you are planning to deploy this fix to all the machines where this application needs to be installed. You can use this option. In this method, you can create a shim using Compatibilty Administrator and install this shim database file(sdb) file.

Compatibilty Administrator is a part of the Application Compatiblity Toolkit 5.5, which can be downloaded here

Step 1: Launch the Compatiblity Administrator, and create a new application fix

comadm

Step 2: Select the Compatiblity modes, Click next, and complete this dialog.

selectshim

On completing the dialog, you can see the shim which was just created.

shimsapplied

Step 3: Install the Shims which was just created.

installshim

Step 4: Now launch the application.

You can also deploy this sdb file to all the machines, where this application is to be installed. (you can either export these mitigations as an MSI, or run this in a command line using sdbinst.exe)

Both of these above methods add the Compatibility layers in the registry key – HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\[app path]

PS: This OS fix is only an interim solution and cannot promise complete functionality. Getting back to the Vendor for the compatible version is always a better practice.

The Complete Application Compatibility Series