Tuesday, November 23, 2010

Extract files from a MSI package

Usually it is possible to use ones favorite compression utility to treat a Microsoft Installer Package (MSI) like it was a normal archive. Though sometimes it doesn't work, but then one can use the Windows Installer Tool (Msiexec.exe) to extract the files from the MSI package. It can open a MSI package in "Administrator" installation mode, where it can extract the files without performing the install.

Runs setup where one can select where to extract the files without actually installing the application:

Msiexec /a mypackage.msi

Extracts the files to the specified location without user interaction:

msiexec /a mypackage.msi /qb TARGETDIR="C:\MyFolder"

Note this can also be useful in case an MSI package has been configured to block install, when used on certain versions of Microsoft Windows.

Could not load file or assembly 'Microsoft.SqlServer.BatchParser'

Sirs:

I've seen several posts on this forum about this issue, and several have been resolved, but I'm not seeing the answer.

On my Windows 7 machine with SQL Server 2008 R2, I have a Visual Studio 2010 project that uses SQL SMO.

The app runs fine on my machine, but when I publish to another server, I get Could not load file or assembly 'Microsoft.SqlServer.BatchParserClient'

If I go to http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en

and install Microsoft SQL Server 2008 Native Client , Microsoft SQL Server System CLR Types , and Microsoft SQL Server 2008 Management Objects I stop getting the error.

It seems to me that I should just be able to properly reference what I need and deploy my project...

So- how do I deploy my project without needing these installs?

In you project you need to include all the dll of Microsoft SQL Server 2008 Management Objects and ( Microsoft SQL Server System CLR Types not sure if it is required ) but you still need to install the Microsoft SQL Server 2008 Native Client on the system where the application is going to be installed.