The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Extracting files from installer EXEs and MSIs

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brendan Tompkins

Posts: 158
Nickname: brendant
Registered: Apr, 2005

Brendan Tompkins is .NET Developer and founder of CodeBetter.Com
Extracting files from installer EXEs and MSIs Posted: Mar 27, 2006 11:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Brendan Tompkins.
Original Post: Extracting files from installer EXEs and MSIs
Feed Title: Brendan Tompkins
Feed URL: /error.htm?aspxerrorpath=/blogs/brendan.tompkins/Rss.aspx
Feed Description: Blog First. Ask Questions Later.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Brendan Tompkins
Latest Posts From Brendan Tompkins

Advertisement

I had an interesting case today where I needed to strip all that ugly Office HTML out of an html document. I found this tool for Office 2000 that supposedly did just that – strip all that ugly “MSO” stuff from the file.  There was a problem though, this .exe installer wouldn’t open on my machine, because I don’t have Office 2000 installed, only Office 2003. 

I found that this installer supposedly contains a utility called “MSFilter.exe” that will run as a stand alone .exe, and would batch convert html files, stripping the office XML.   Some sites mentioned that if you install this tool on a machine with Office 2000, you could just copy the MSFilter.exe file to the computer without office 2000, and use the utility. 

I don’t have such a system, but I figured out a way to extract these files from an installer.  I’m not sure how often this will work, but the method I used here worked great to extract just the utility I needed from this installer.

Here’s what I did after downloading the MsoHtmf.exe file from MS.

Step 1: Extract CAB files from the .EXE installer file

I opened the .exe file in Visual Studio and peeked at the files resources.  I noticed a binary node called “CABINET.” Right-Clicking on this node allowed me to export the contents to disk as a “BIN” file.  I changed the extension to  to “.CAB” and was able to open the file with WinZip

.

When I did this, I was left with two files inside of this CAB file, “Luncher2.exe” and “msohtmf2.msi”.  Running this .MSI file gives the same “Cannot Install” error as before, since I didn’t have Office 2000 installed.  I was sortof back at square 1. I needed to open an MSI file and extract the contents. 

Step 2: Extract the CAB contents from the MSI file.

It turns out that there’s a little utility deep inside the Windows Installer SDK that will allow you to extract files from MSI installers called “Orcas.” I opened Orcas.exe and extract the “Cabs” item in the msi file by selecting the proper item and choosing “Tables..Export Tables”

This exported the contents of the cab file to disk.  In this case the Cabs node contained all the files I needed to run this utility.

 

I extracted these files to disk, and could run the batch remove all that ugly code from my office HTML documents.  I wanted to blog about this, because it’s useful to sometimes just extract one tool from an entire installer. I don’t recommend that you go around hacking installer files, but it’s nice to know how to do it, when you need to. Wink [;)]

-Brendan

Read: Extracting files from installer EXEs and MSIs

Topic: Vista 5308: VS 2005 can't deal with composition? Previous Topic   Next Topic Topic: WPF: Always remember rebuilding the solution

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use