Utility retrieves programs' names, versions, and more
Suppose that a couple of years ago, you downloaded a Windows Installer package named mwta.msi, but you can't remember what it's for and its obscure filename doesn't provide any clues. How can you find out the name, manufacturer, and version of the software it will install without actually installing it?
Unfortunately, right-clicking an .msi file and choosing Properties doesn't provide much information. If you have installed Orca, you can right-click the .msi file, choose Edit with Orca, navigate to the Properties table, and look at the .msi file's properties. However, this is time-consuming. Plus, Orca updates the last modified date of an .msi file after you close it, even if you don't make any changes—a behavior I find less than optimal. (If you're unfamiliar with.msi files and Orca, see the sidebar "Windows Installer at a Glance".)
I found myself wanting a simpler solution, so I created MSIInfo. This utility displays five properties for .msi files:
- Manufacturer, which specifies the manufacturer of the software to be installed.
- ProductName, which specifies the name of the software to be installed.
- ProductVersion, which specifies the version of the software to be installed.
- ProductCode, which specifies the globally unique identifier (GUID) that identifies the Windows Installer package.
- UpgradeCode, which specifies a GUID that Windows Installer uses to search for related versions of an installed product. Related products share the same UpgradeCode GUID.
The MSIInfo utility, which works on Windows 2000 and later, consists of two scripts: MSIInfo.js, which retrieves the five properties, and MSIInfo-Context.js, which adds a Windows Explorer context-menu option so that you can simply right-click an .msi file to display those properties. You don't need to adapt these scripts at all, which means you don't have to know how to read or edit a script to use them. And I'll walk you through how to run them so you can get the MSIInfo utility working in your environment.
You first need to download the MSIInfo utility by clicking the Download the Code Here button near the top of the page. Unzip the 103497.zip file, and place MSIInfo.js and MSIInfo-Context.js in the same folder.
The next step is to add the context-menu option to Windows Explorer by running MSIInfo-Context.js. Open Windows Explorer and navigate to the directory where you put the scripts. Right-click MSIInfo-Context.js, and choose Open (not Open with Command Prompt). MSIInfo-Context.js will display the prompt shown in Figure 1.
Figure 1: Adding the Info option
Click Yes. The script then adds an option named Info to the context menu that appears when you right-click an .msi file in Windows Explorer. If you later want to remove that option, you simply run MSIInfo-Context.js again. When you're asked if you want to remove context menu support, click Yes.
Note that you need to run MSIInfo-Context.js under an administrator account or elevated permissions. Here are the specifics:
Windows Server 2003, Windows XP, or Windows 2000. If you're using Windows 2003, XP, or Windows 2000, you must run MSIInfo-Context.js under an administrator account.
Windows Vista. If you're using Vista and have User Account Control (UAC) enabled, you must use elevated permissions, even if you're logged on as an administrator. Here's why: When you're logged on as an administrator and you have UAC enabled, Windows disables the Administrators group token in your logon session. When you perform an action that requires privilege elevation, the OS prompts you for confirmation to enable the Administrators group token to prevent inadvertent changes to the system. However, this can make some administrative tasks more difficult, such as running a Windows Script Host (WSH) script (i.e., a .js, .vbs, or .wsf file) with elevated credentials.
Fortunately, there's a workaround for this problem. First, close any open Windows Explorer windows. Next, open Windows Explorer and choose Folder Options on the Tools menu. (If you can't see the Tools menu, press F10.) Then, select the View tab. Scroll down the list of advanced settings and enable the option Launch folder windows in a separate process (see Figure 2), and click OK. Close Windows Explorer.
Figure 2: Configuring Windows Explorer to run elevated permissions
Next, right-click a Windows Explorer shortcut (e.g., the one in All Programs\Accessories on the Start menu in Vista) and choose Run as administrator from the context menu. After confirming you want to run Windows Explorer as an administrator, navigate to the folder containing MSIInfo-Context.js and run it. Since the Windows Explorer instance is running as an administrator, the script will run under those elevated permissions as well.
Windows 7. In Windows 7, it isn't possible to open an elevated Windows Explorer window when UAC is enabled, which appears to be due to a bug (see the forum entry "Unable to open an elevated Windows Explorer window"). If you're using Windows 7 and have UAC enabled, you need to run MSIInfo-Context.js under elevated permissions using a Command Prompt window (i.e., cmd.exe). To do so, right-click a Command Prompt shortcut (e.g., the one in All Programs\Accessories on the Start menu in Windows 7) and select Run as administrator from the context menu. After confirming you want to run cmd.exe as an administrator, enter the pathname of the script, enclosing it in double quotes (") if it contains spaces (e.g., "C:\Admin Scripts\MSIInfo-Context.js"), and press Enter. When MSIInfo-Context.js displays the prompt shown in Figure 1, click Yes.
Windows Server 2008. I don't have a Server 2008 machine for testing, but the steps for Windows 7 should work on Windows Server 2008 as well.
The last step is running MSIInfo.js, which you don't need to run under an administrator account. All you need to do is navigate to the target .msi file in Windows Explorer, right-click that file, and select the Info option. MSIInfo.js will then run and display all five properties for that file in a message box, as Figure 3 shows.
Figure 3: Sample results from the MSIInfo utility
Alternatively, you can run MSIInfo.js from a Command Prompt window. It uses the syntax
MSIInfo.js msifile \\[property\\]
You use the msifile parameter to specify the path and filename of the .msi file you want to check. If the .msi file's pathname contains spaces, you need to enclose the parameter in double quotes. The property parameter is optional and must be one of the following case-sensitive property names: Manufacturer, ProductName, ProductVersion, ProductCode, or UpgradeCode. If you omit the property parameter, MSIInfo.js will display all five properties. If WScript is your default host in WSH, the properties will appear in a message box. If CScript is your default host, the properties will appear in the console window.
A Few Clicks Is All It Takes
The next time you encounter an obscure .msi filename or need to find out the version of a software package that an .msi file will install, try the MSIInfo utility. With just a few clicks, you'll get the information you need.