Handling SHIMs in Wise Package Studio
This article talks about creating and applying SHIMs to bypass UAC prompts during application launch in Windows Vista and Windows 7.
When you launch an application shortcut from Start Menu/Desktop/Quick Launch, it may prompt UAC prompt for Standard User. It can be suppressed through applying a SHIM to the main executable.
This article talks about creating a SHIM and installing/uninstalling SHIM in two different methods using Wise Package Studio:
Using a custom action in MSI/MST
Creating a SHIM:
Requirement: Application Compatibility Tool Kit
Open Compatibility Administrator and create a new Application Fix. Below window pops up and it has 3 fields.
- Name of the Application
- Executable file path [Shortcut target executable path]
Enter the information and click NEXT
Compatibility mode window, select NONE from “Operating System modes” and click NEXT
Under compatibility Fixes select the following options and click NEXT:
Click FINISH and save the shim database file [.SDB] to a location. This SDB file should be used in the Custom Action to install/uninstall.
1.Installing/Uninstalling a SHIM through CUSTOM ACTION:
A SHIM database file [.SDB] can be installed using sdbinst.exe, which is part of Operating System and exists under C:\Windows\System32
Use the Full path of the SDB file for installation and uninstallation like below:
Installation: Sdbinst.exe <PATH OF .SDB>
Uninstallation: Sdbinst.exe –u <PATH OF .SDB>
The same commandline for installation and uninstallation can be implemented using Custom Action in Wise Package Studio.
Copy .SBD file to [INSTALLDIR]. Install custom action should be DIFFERED EXECUTION IN SYSTEM CONTEXT and should be before INSTALLFINALIZE.
Uninstall custom action should be DIFFERED EXECUTION IN SYSTEM CONTEXT and should be immediately after INSTALLINITILIZE [or before REMOVEFILES custom action] as the SDB file is part of installation.
2. Installing/Uninstalling a SHIM through REGISTRY:
Step 1: Add shim (sdb file) to the package. For example: INSTALLDIR
Step 2: Add the registry (Shim.reg attached to this article) to the package as shown below:
Step 3: Edit the registry settings to the required value. Rename [FileName] to the actual name of the file which requires shim. For example: KCM310.CPL
Database Description: Name of Shim file. For example: KCM310
DatabasePath: Path to sdb file. For example: [INSTALLDIR]KCM310.sdb
Note: Shim.reg.txt file has been attached to this article. Download and rename the file to "Shim.reg" and add it to MSI/MST.
I hope this helps.