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

Bootstrapper/Self Extractor


5 replies to this topic

rgraham

rgraham
  • Members
  • 16 posts

Posted 23 January 2005 - 10:50

Hi All,

I am writing my own bootstrapper for MSI.

I work for a small startup company and our resources are very limited at this point, so I cannot afford IS just yet.

But I want to be able to create self-extracting setups to be downloaded from the web. This is a topic that has been discussed on these forums but I've seen no real solutions.

Here is my basic architecture for creating a dependency free self-extracting download:

1) My bootstrapper is written in C++ and it uses only core APIs - no MFC, so there should be no problem with initial dependencies.

2) There is no requirement for Winzip, etc.

Instead, what I am doing is I create a resource file that contains:

InstMSIA.exe
InstMSIW.exe
My application msi package.

3) The bootstrapper is compiled with the resource so everything comes in a single "Setup.exe" file.

When the "Setup.exe" is run, the following actions are performed:

1) Display a simple form created from API calls only (no MFC) that will display simple bootstrapping actions.

2) Check OS using APIs.

3) Load the resource corresponding to the appropriate InstMSI executable, and then save it to the target machine.

4) Load the resource corresponding to the application msi and save it to the target machine.

5) Launch the InstMSI exe using CreateProcess and wait for it to terminate.

6) Launch the application msi using CreateProcess and then terminate the bootstrapping Setup.exe immediately, allowing the msi to continue running.

After that, the msi runs in the usual fashion.

Comments? Critiques? I think it is a pretty cool approach, and I welcome any input.

Now, for questions:

I have read the Microsoft docs extensively, and there is just not much info on bootstrapping, etc. So my questions are:

1) Does anyone know if the InstMSI.exe return any sort of useful exit codes?

2) One concern I have is that there does not seem to be any obvious way to repair a Windows Installer install itself. If files are missing or corrupt, as far as I can tell the InstMSI.exe will still just return a message that says "Service already installed" and do nothing. Does anyone have any info on repairing the Windows Installer itself, or how to manually install the files which can be extracted from the exe file?

Thanks

Robert

PS: If there is an interest, I will make the code available when it is finished ...

Edited by rgraham, 23 January 2005 - 10:52.


BourqueJ

BourqueJ
  • Full Members
  • 10 posts

Posted 23 January 2005 - 17:05

Hi,

you can start by checking the setup.exe code available from the Microsoft SDK. It allows you to build the setup.exe bootstrapper or to inspire yourself from it. The file is written in C++.

As for me, the project is available in the directory "C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Samples\SysMgmt\Msi\setup.exe" (setup.exe is a directory)

Good luck!

Jacques Bourque.

rgraham

rgraham
  • Members
  • 16 posts

Posted 23 January 2005 - 22:56

Hi,

Thanks for the suggestion.

I did manage to find some useful exit code information from the sample project.

The problem I have with using this sort of bootstrapping is it requires a couple of possibilities that I want to avoid:

1) Everyone who wants to use the application must have access to the internet.

2) Or, one person has to download the application and then set it up for an administrative install on a central server.

The application in question is for use in the medical field.

Doctor's offices generally will not have Internet access on all their computers because of privacy concerns. So thet rules out possibility number 1.

For possibility 2, someone would have to not only set up the application as an admin install on a central server, but they would also have to make sure that the required bootstrappers were available in case a workstation does not have the required Installer version.

While this may not seem like a big deal to people who write setups every day, most doctor's offices do not have a sys admin, and most doctors are not particularly interested in figuring out how to configure a software application.

The target audience wants something they can download, click an icon and have it work. And they also want something that they can move around their office by the simple technique of saying to their employees "I downloaded this file and put it on my computer (or I put it on this CD, etc.). Copy this file from my computer and run setup".

Microsoft clearly emphasizes the "install on demand" approach (and it does have it's advantages). But there are still many scenarios where the old fashioned simple one file contains all and does all approach is still what people want and understand.

That is basically what I am trying to accomplish.

Robert

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 January 2005 - 11:09

You need to handle or suppress (delay) a reboot that might be required after installing/updating the MSI runtime.

BourqueJ

BourqueJ
  • Full Members
  • 10 posts

Posted 24 January 2005 - 16:01

Hi!

I understand your concerns. But be carefull if you will be managing updates. (new package to be installed over the old one) In that case, you need to call the install in a different way.

You can find more info about updates here: http://msdn.microsof....asp?frame=true

You can look in the sub-topics for information on specific type of update.

Hope this help!

Jacques Bourque.

rgraham

rgraham
  • Members
  • 16 posts

Posted 24 January 2005 - 21:30

I am handling the reboot possibility of the InstMSI exe by running it in delay reboot mode.

Thanks to BourqueJ for pointing out the sample setup project - it provided me with the essential exit codes of InstMSI I need to monitor if bootstrapping is required.

I'm not really sure how this approach impacts upgrades and patches. I would not think that it would make any difference, because the self-extractor is really nothing more than a convenient single file vehicle to get the application msi on the target machine. Once the self-extractor loads the msi it saves the image on the target, same as any other method of delivering the msi to the target machine. If the user downloaded a patch using the same approach the original msi would still be available.

Not sure I understand the implications of how a patch download would be affected.????


Robert