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

wrapping another projects in msi


7 replies to this topic

robert.china

robert.china
  • Members
  • 13 posts

Posted 10 June 2003 - 11:22

1. I plan to insert 3 files into a msi's binary table.

2. during the msi installation process, msi extracts the 3 files to a temp directory, and runs the command: systemcommand.exe file1.txt (when this runs, file2.txt and file3.txt should be in the same directory with file1.txt), then delete these files.

3. I want this msi is a pure msi database, no installscripts interfered, just use custom action or modify tables.

4. Can this be feasible?
can you give me some hints on how to extracts the 3 files into a temp directory(just modify the tables, no scripts)?

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 10 June 2003 - 16:15

It's all feasible. You'll need a custom action that extracts the file from the binary table. This CA must be scheduled in the InstallExecute sequence. The CA type can be a DLL function, also residing in the binary table, or a script.

Note that you don't need to modify the tables, just reading it is enough. Example code to extract a file from the binary table is available on this site, section Windows Installer / Custom Action, item "Streaming a file from the binary table".
The sample is InstallScript, but you should have no problems converting it to VBScript or DLL.



robert.china

robert.china
  • Members
  • 13 posts

Posted 25 June 2003 - 09:57

thanks, I have seen the script, what a pity to have a limit of 4k

To make it clear:
I have an existing installable project, including setup.exe and other files.

I want to wrap it in msi, can you tell me the most convenient way.


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 25 June 2003 - 13:49

I see, it is "improved", meaning that you can extract the file, then append formatting to it, replacing property names with property values. That's only usable for text files and configuration files.

Anyway, go for the classic version, which does not attempt to modify the file after extracting. The limit is 2 Gb per file.

robert.china

robert.china
  • Members
  • 13 posts

Posted 09 July 2003 - 04:04

Great, I can do it.

I wonder where this CA should be in InstallSequence.
Since my function in dll works silently, I'd like to insert it into InstallExecuteSequence table(right?), and where is appropriate(after copyfiles or elsewhere)?

BTW, my msi just launch this CA and do nothing else. While if I don't install any file, when i launch MSI file. msi complains about that and stop running. Are there any workaround?

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 09 July 2003 - 08:16

You better sequence it before InstallInitialize, or after InstallFinalize. Note that you cannot make it a deferred CA - you have no access to the install database at that time, so you cannot extract a file from the Binary table.
When in doubt, schedule it after InstallFinalize, so you don't have to worry about Rollback scenarios (however - uninstall may become another issue).

No idea about your second remark - how does MSI complain? Maybe your CA should wait until the exe is finished.

robert.china

robert.china
  • Members
  • 13 posts

Posted 09 July 2003 - 10:46

1 I just put my CA after InstallFinalize. Now at the end of installation, MSI complains
"The wizard was interrrupted before program could be completely installed"
"Your system has not been modified. To complete installation at another time, please run
setup again."
My CA just 1) extracts a zip file from another item of binary table into a temp dir
2) call unzip.exe to unzip the zip file
3) execute a.exe (unzipped from zip file)
4) delete all the files(including the zip file and the unzipped files)
what is the problem?

2. typically msi installs several files into programfiles dir, while my msi only execute the CA, and
doesn't installs any files directly by msi. So MSI complains that some error.






luke_s

luke_s
  • Full Members
  • 532 posts

Posted 09 July 2003 - 23:55

With an error like that, something in wrong with your custom action.

If you are using a DLL maybe the function has not been exported correctly?

Try checking the Window Event Viewer, this may help.