Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New to MSI...How do you embed files into MSI package?

487 views
Skip to first unread message

Chris Melnick

unread,
Mar 31, 2005, 9:58:18 AM3/31/05
to
Sorry if this is a simple question, but I have been searching for
information about how to do this, with little success. I am used to
using the Java self extracting JAR files for installation, but am
starting to develop .NET apps, and need to deploy them. I am not using
Vis Studio. I have gone through the MSI tutorials on MSDN, but was
unable to figure out how to embed the files you are installing into the
MSI database. Distributing one installation file instead of an MSI
with external file structure is very desirable. I would prefer
instruction using freely available tools, such as the Microsoft SDK,
but really, any help would be...well...helpful...

Thanks in advance,
Chris

Claude Henchoz

unread,
Mar 31, 2005, 11:41:27 AM3/31/05
to
Chris, I don't really know how to (manually) put files into an MSI
package, but reading your post, I think you might be interested in the
Windows Installer XML (WiX) toolset:

http://sourceforge.net/projects/wix/

There's also a very helpful tutorial on:

http://www.tramontana.co.hu/wix/

This lets you create MSI installers from a relatively simple XML
definition, and the toolset will do the rest.

Hope that helps,

Claude

Chris Melnick

unread,
Mar 31, 2005, 3:22:41 PM3/31/05
to
Holy Cow, I finally got it to work. For anyone who is interested, here
is how to create a CAB file, and embed it manually into your MSI
package. I can say nothing about the accuracy of this, but it worked
for me.

1.) Create your MSI and test it so it runs and installs as "normal",
installing files from the hard drive.
2.) Change the sequence numbers in the File table to be the order
(1...n) you wish the files to appear in the CAB file
3.) Run the script from the MS SDK package: >cscript WiMakCab.vbs /R /C
/U /E <YourMSI>.msi <FileName> (for <FilenName>, use no extension, the
script will add the CAB extension)
Whenever I ran it the first time, I got the error "Warning, cabinet
stream not found in package: <FileName>.CAB". This happens because the
script first tries to delete the old embedded CAB file from the MSI
package, which of course doesn't exist because it is the first run.
Subsequent runs on the same MSI package will not display this message.

Thanks for the help...I will definently look into WiX for future
use...seems like there should be a GUI frontend for WiX, but I could
only find "In Progress" projects.

Chris

Dennis Bareis

unread,
Mar 31, 2005, 9:01:17 PM3/31/05
to
"Chris Melnick" <newsgro...@gmail.com> wrote in message news:<1112281098....@z14g2000cwz.googlegroups.com>...

You can use my (free) MAKEMSI tool or many others listed at the
InstallSite (http://www.installsite.org/pages/en/msi/authoring.htm).

Bye,
Dennis Bareis

Michael Murray

unread,
Apr 3, 2008, 8:37:41 PM4/3/08
to
Chris,

I ran the script as you said, but it did not put the CAB file into my MSI
installer; all it did was create a .ddd file that you can use to make a CAB.


What do I do now?

Thanks.

Mike

url:http://www.ureader.com/msg/165392.aspx

mayayana

unread,
Apr 4, 2008, 2:00:04 PM4/4/08
to
I don't see the original post for this, and it
doesn't seem to be addressed to any newsgroup. ??
In any case, if you need a script to put the CAB inside,
here's a VBScript version:

'-- parameters are MSI file path, path to CAB file, name of CAB file
'-- stream in MSI database. If the stream already exists it will be
'-- overwritten.

Sub ReplaceCAB(MSIFile, CabPath, StreamName)
Dim WI, DB, View, Rec
Set WI = CreateObject("WindowsInstaller.Installer")
Set DB = WI.OpenDatabase(MSIFile, 1)
Set View = DB.OpenView("SELECT `Name`,`Data` FROM _Streams")
View.execute
Set Rec = WI.CreateRecord(2)
Rec.StringData(1) = StreamName
Rec.SetStream 2, CabPath
View.Modify 3, Rec
DB.Commit
Set Rec = Nothing
Set View = Nothing
Set DB = Nothing
Set WI = Nothing
End Sub

0 new messages