December 15th, 2005

Where's Msi.lib?

Heath Stewart
Principal Software Engineer

If you’re developing custom actions for Windows Installer or a bootstrapper in Visual Studio 2005, or utilizing the resiliency and install-on-demand features of Windows Installer in your product developed in Visual Studio 2005, you might get link errors for Windows Installer functions. Msi.lib was not included for x86 in the Platform SDK lib directory if you installed Visual C++. It is present for x64 in the AMD64 sub-directory and the IA64 sub-directory, however. See Visual Studio 2005 Product Line Overview for what editions are affected.

In order to get msi.lib for x86 you need to install at least the Windows Installer SDK feature of the Platform SDK. The libraries in the AMD64 and IA64 sub-directories of Visual Studio 2005 RTM have the same date stamp as msi.lib in the Windows Server 2003 SP1 Platform SDK. Once installed you can either copy msi.lib from Program FilesMicrosoft Platform SDKLib to Program FilesMicrosoft Visual Studio 2005VCPlatfromSDKLib or what I recommend is adding the Platform SDK directories in the Visual Studio 2005 options as preferred directories.

  1. Start Visual Studio 2005
  2. Click on the Tools -> Options menu
  3. Expand Projects and Solutions, and select VC++ Directories
  4. Make sure “Executable files” is selected in the drop-down selection box entitled “Show directories for:”
  5. Add the path to the bin folder under the Platform SDK installation root, such as $(ProgramFiles)Microsoft Platform SDKbin
  6. Select “Include files” in the drop-down selection box entitled “Show directories for:”
  7. Add the path to the include folder under the Platform SDK installation root, such as $(ProgramFiles)Microsoft Platform SDKinclude
  8. Select “Library files” in the drop-down selection box entitled “Show directories for:”
  9. Add the path to the lib folder under the Platform SDK installation root, such as $(ProgramFiles)Microsoft Platform SDKlib

You can choose to move these directories up past their corresponding directories that begin with $(VCInstallDir)PlatformSDK. These are the directories for the Platform SDK that ships with Visual Studio 2005. If you don’t, they will take precedence and msi.lib will be found eventually using the new directories you just added anyway.

Author

Heath Stewart
Principal Software Engineer

Heath is an application architect and developer, looking to help educate others to learn professional development. Besides designing and developing applications he enjoys writing about intermediate and advanced topics. Heath also consults for deployment packages and scenarios within Microsoft and for external customers.

0 comments

Discussion are closed.