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

Temporary files


3 replies to this topic

SkipSailors

SkipSailors
  • Members
  • 34 posts

Posted 21 February 2001 - 00:23

I need to use a transient file in my isntallation.  It is not an executable, rather, a file used as input by an executable.  I have been successful at placing executables in the binary table, but I don't see how it is I am supposed to put other kinds of files in the binary table, and then use them.

Helpful RTFM pointers greatfully accepted.


SteveP

SteveP
  • Members
  • 126 posts

Posted 22 February 2001 - 00:56

Depending on when you are going to use your data file(before or after files are installed) you may want to include the file as a component using NULL as the ComponentID in the Component Table.  According to the documentation:

"If this column is null the installer does not register the component and the component cannot be removed or repaired by the installer. This might be intentionally done if the component is only needed during the installation, such as a custom action that cleans up temporary files or removes an old product. It may also be useful when copying data files to a user's computer that do not need to be registered. "

Despite the earlier comments in the article on the Component Table, the ComponentID *is not* the primary key for the table.  It is not even included in the key.

With regard to the Binary Table, I have been able to insert text files into the Binary Stream as readily as EXE files.  Once they are in there, you can use the MsiDB.exe tool to dump them back out to known locations.  I have not yet tried this from a custom action, but it may be possible to enumerate through the _Streams Table to locate your data and then use MsiRecordReadStream to put the contents into a buffer.

Also, depending on the structure of your table, you can design your own custom tables and import them directly into the MSI database.  So long as you follow the standard method of defining columns and have the format lines of the IDT file correct, you should be able to put virtually *any* tab delimited text file into a table that you can import to the MSI database.  Then, if you want to, you can edit the column entries with ORCA.  The table won't relate to others in the scheme of things, but your data will be there.  If you do this, you can use the MsiDatabaseExport to dump the table back out to an IDT file, strip off the format lines, and have your data available for use.  You will have to be a little careful about how you name your columns so that you don't run afoul of the referential integrity checks.

I imagine you have already thought about passing the data as command line arguments.

Please let me know if you have any questions about these methods.  I have not tested all of them exhausively.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 February 2001 - 13:48

Quote
use MsiRecordReadStream to put the contents into a buffer.

If you are using InstallShield, an InstallScript function StreamFileFromBinary can be found somewhere in the samples folder.