Where's Msi.lib?

Where's Msi.lib?

Rate This
  • Comments 4

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 Files\Microsoft Platform SDK\Lib to \Program Files\Microsoft Visual Studio 2005\VC\PlatfromSDK\Lib 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 SDK\bin
  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 SDK\include
  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 SDK\lib

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.

Leave a Comment
  • Please add 2 and 5 and type the answer here:
  • Post
  • Excellent and unambiguous write up.

    Rather than just stopping with MSI.lib, Heaths has given the complete picture about installing the platform sdk, relevance of the variable $VCInstallDir, how the new installation of Platform SDK will be used along side the existing one etc.

    Tremendous proactive thinking by Heaths. Heaths, you are a BRILLIANT guy.

    Many many thanks for clearing ALL my doubts in just 2 mins.
  • I wonder whether the Platform SDK directories should be added  in the Visual Studio 2005 options as PREFERRED directories.My program threw out errors when I did so,while the errors dispeared when I added to the END of the list.
  • Forest, are you referring to the Platform SDK that ships with Visual Studio or the Platform SDK you can download separately from http://msdn.microsoft.com/platformsdk? In the latter case, it most certainly should be listed as preferred directories because it would be more up to date (assuming you didn't install an older Platform SDK).

    In the former case, I encourage you to gather the errors and put your paths in a text file in order and submit them and your problem to http://connect.microsoft.com/site/sitehome.aspx?SiteID=210.
  • PingBack from http://blog.m-ri.de/index.php/2007/05/10/msilib-fehlt-in-vc-2005-installation/

Page 1 of 1 (4 items)