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

Early Install of Component


10 replies to this topic

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 13 January 2005 - 20:54

To install my system I must first verify a number of differing things with the target system (the largest of them being a database validation). To do this I have a number of executables and data files (in a hierarchical directory structure) that need to be installed on the target system early (at the beginning of the user interface). These same files are later installed as part of a feature (they are components) so they can be used when the system is running. Does anyone know how to install these components early by either listing them as Support Files or programmatically with a custom action?

I have looked through the various MSI tables and it looks like I can extract them by hand but it would be extremely tedious and error prone to write that code. Does anyone know if an exposed method exists or possibly have one already written?


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 14 January 2005 - 18:11

Maybe you could split your setup into two msi packages?

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 17 January 2005 - 12:54

I'm not sure how this would work ... I need to put these files down before the system is installed (to do some work as part of the User GUI sequence). Then these files are formally put down as part of the install in their final defined location (as part of the installation execute sequence). I'm not sure how a separate MSI would benefit me in this case.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 January 2005 - 09:22

You could have these files in a separate .msi which you would install first. Thus you wouldn't ahve to install them twice.

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 18 January 2005 - 12:38

The problem with this is if I install them and then determine that the database is not updatable by these files I need to rollback to the previous version. If I put them into a separate install (MSI) rollback won’t be available anymore when I determine this.

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 18 January 2005 - 12:55

For complete clarity let me reiterate what I am attempting to do.

1. I need to place files (technically these are executable files [database installation tools] and a series of files within an defined directory structure [database staging area]) on the target system prior to the start of the User Interface Sequence.
2. I need to execute commands on the files that I have placed on the system (in step 1) to determine dialog progression and menu choices in the User Interface Sequence.
3. At the proper conclusion of the User Interface Sequence I need to install these files in a permanent location on the target system (for use at application run-time).
4. Finally, I need to remove the initial set of files that were placed on the target system in step 1.

Because the files I need to install in step 1 are components in the install, I am trying to find a way to either install those components early (as a sort of support file setup) or extract those files from the MSI at install-time such that I can place them on the target system.

This whole process is complicated by two factors (customer requirements)
1. All files must be packaged inside of the MSI (internal CABs) or at a minimum external CABs.
2. The defined directory structure listed in step 1 is dynamic (the component includes a dynamic directory/file list). I only know the top level of the directory structure at MSI build-time … I don’t know its contents.

I hope this makes the problem clearer.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 January 2005 - 10:28

In this case I guess your best bet it to temporarily extract the files from the CABs.

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 19 January 2005 - 12:16

That’s what I had figured, however, I am struggling with a clean way to do that. Do you know of any way (other than iterating through the tables by hand) that this can be done? For instance, does some low level MSI API that directly extracts components exist?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 20 January 2005 - 15:08

You can use the CAB API or tools to extract files from the CABs, completely bypassing Windows Installer.

Tifoid

Tifoid
  • Members
  • 27 posts

Posted 24 January 2005 - 13:18

I know I can do that ... but because these files are dynamic I don’t know their names to locate them in the File and Component Tables directly. I could write quite a bit of code to resolve this by:
1. Correlating the top level component with the every directory component in the Components, Directory, and CreateFolder Tables.
2. Then creating the directory structure that was resolved in step 1.
3. Finally locate and extract every entry in the File Table that resides in one of the directories that I created in step 2.
My problem is that this seems like such a fundamental requirement that I figured it should be accessible through some MSI API.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 January 2005 - 14:15

No this is not a fundamental requirement in my opinion. Windows Installer is designed to install files in one transaction. Not in two batches with dialogs in between.