Lately I wrote a few articles about fixing bad applications using Compatibility Shims. If you didn’t read them yet, here are the links: 

I also described that you can install an Application Compatibility Database using the sdbinst command.

At first I just took a script task in my Altiris Server to deploy the database using sdbinst -q <dbname> but later on I got a better idea.

I decided to build a seperate installer for the Compatibility Database that will upon install launch sdbinst -q and upon uninstall sdbinst -q -u.

I see several advantages to this approach: 

  • You can check/see in Add/Remove Programs that a Compatibility Fix for a certain application has been installed.
  • You can easily Uninstall a fix when it’s no longer required (eg when the Vendor has updated the Application)

AddRemovePrograms

You can of course use your utility of choice to create an Installer, below a sample using a free tool called InnoSetup.

First go to the InnoSetup site and download the QuickStart Pack, this includes InnoIde which is a GUI front-end for creating and editing Inno Setup Scripts.

Use the Wizard button to start the Setup Script Wizard and Click Next

Inno1

Fill in Application Information for the Fix and Click Next:

Inno2

This is a very simple sample, so we don’t need an Application Folder. You may wish to create one and copy the database into that folder.

Inno3

Deselect the #define options:

Inno4

Click Next until you can Finish, now you have created a Project.

Go to Install Actions and select New Install Run Action:

AddInstallRun

And add an Uninstall Action and Select New Run Uninstall Action:

AddUninstallRun

Now use the Compile button to create a setup.exe (in the Output subfolder), use Setup.exe /SILENT to do an UnAttended install.