Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Adding files to MSI database


7 replies to this topic

dbcn

dbcn
  • Full Members
  • 4 posts

Posted 05 February 2008 - 06:42

Hi there, I am new to MSI and am facing a few problems.
I did the "Installation Example" tutorial on msdn which wasn't too bad, but it didn't explain too well how to actually add all the file to the .msi database. I am now using msidb.exe to add all the file manually and it seems to work.
My problem is that when I run the msi installer on my target machine it tries to copy all the files from that machine's C: drive. Why doesn't it pick up all the files from the msi database?
Do I have to put all my files into a cab file and include that?

Thanks for your help!

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 05 February 2008 - 10:18

Welcome to hell.

Your life will be made immeasurably easier by using an installation-authoring tool. If your employer doesn't want to spring for one from the two main players Altiris (neé Wise) and InstallShield, there are freeware tools around.

For quick fixes to MSIs or MSTs, most experienced packagers use a tool called Orca which is part of the Windows Installer SDK, a free d/l from Microsoft. I figure you already have that, though, since you're using MSIDB.EXE. You can use Orca to add to the relevant tables, but as I say, a proper tool will pay for itself many times over in terms of your mental health! smile.gif

To troubleshoot installations, your two best friends will be MSI logging and a process monitoring tool. My preference (as many on here are probably bored with hearing) is for ProcMon, a free d/l from SysInternals (now subsumed into the Microsoft behemoth). As for logging, you can either turn that on via Group Policy (not as painful as it sounds - you can set it using a simple .REG file) or, more usefully - because you can control the filename and path - on the command line:

MSIExec /i [path_to_and_name_of_MSI] /L*V [path_to_and_name_of_log_file] [other command-line arguments]

There is yet another free d/l available that analyses MSI log files but eventually, you'll get to know how to read them and get to the nub of a problem.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

dbcn

dbcn
  • Full Members
  • 4 posts

Posted 06 February 2008 - 00:39

Hi VBScab, thanks for your reply. MSIExec seems to be quite a nice tool, but it doesn't help me with my current situation.
I am creating an MSI installer on my development machine and include all the files I want installed into the .msi file with msidb.exe
When I then execute this msi file on my test machine it complains that it can't find the files on C:\[location_of_the_msi_file]\[source_path_specified_in_MSI_directory_table] which makes sense, because the files are not there, but included within the MSI file.

So, my question is how do I set the source path where msi should copy the files from to the actual .msi file?
I probably have to change the SourceDir variable in the msi directory table and point it to the msi file, but how do I do that?

Cheers.

spdygnlz

spdygnlz
  • Full Members
  • 106 posts

Posted 06 February 2008 - 01:45

Files aren't generally stored in the msi itself. (There is the binary table, but that's another story and is not what you're looking for.) The msi is basically a collection of tables that tell Windows Installer how to behave. Most MSI's either store the files uncompressed next to the msi (what you're seeing), compressed into one or more cabs, or packaged into a setup.exe type install. It sounds to me like you're looking for a way to package everything up. If you're not wanting the uncompressed method, I'd agree with VBScab and get a third party tool.

MSIExec is actually the process that runs your msi as msi files aren't executable. If you watch the task manager when you launch an msi, you'll see the MSIExec process. By launching it from the command line, you can pass extra parameters to enable logging and the like.

Hope that helps!

-- spdygnlz --

dbcn

dbcn
  • Full Members
  • 4 posts

Posted 06 February 2008 - 03:52

I'd love to get a third party app to do all the dirty work and they are probably not that expensive, but we are currently on hold for spending _any_ money on anything.
We use InstallShield before, which is really good, but the version we've got doesn't do 64bit Installers, so that's why we are looking into new (free) tools.

To come back to my problem with including the files into the .msi file: Orca.msi is a good example, I guess, because it seems to include all the file in the .msi file.
We do want a neat/clean solution where our customers only have to deal with one file, double-click on it and everything gets done automagically.

I've seen many examples of program installers that consist of only one file and install a whole application consisting of quite a few files. I just can't believe how difficult it is to find any information on doing this; even MSDN doesn't have any info on it.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 06 February 2008 - 13:41

There are a few freeware MSI-authoring tools. Google for 'MSI +freeware'

Spdygnlz, of *course* files can be stored in an MSI - in internal CABs - and I would argue that *this* is how most MSIs are supplied, not with external files or CABs. How else would simple instructions result in databases of tens (sometimes hundreds) of megabytes in size?

Anyway, to answer dbcn's question...

*GREAT* choice to take a look at ORCA.MSI: it's nice to see people trying to work stuff out for themselves by looking at live examples. In that spirit, let me point you in the direction, rather than just tell you. I suspect that your problem will be found by looking at the 'Attributes' column in the 'File' table and at the 'Media' table.

Check out MSI.CHM, Windows Installer/Windows Installer Reference/Installer Database/Installer Database Reference/Database Tables/File Table.

Compare ORCA.MSI with another MSI which references external CAB(s).

Hopefully, you have enough clues now. I think this is a better approach for you since, not only will you find the answer yourself (perhaps posting it here once you do) but will learn a little about how these tables "interact".

Edited by VBScab, 06 February 2008 - 13:42.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

spdygnlz

spdygnlz
  • Full Members
  • 106 posts

Posted 06 February 2008 - 18:11

I stand corrected. smile.gif

-- spdygnlz --

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 February 2008 - 00:25

QUOTE (dbcn @ 2008-02-06 03:52)
we are currently on hold for spending _any_ money on anything.

So they are not paying you for the time you spend on this? Orca and msidb are really low level tools. I'd highly recommend you use some authoring tool, even freeware. Here's a list: http://www.installsi...g/go/msidev.htm