PDA

View Full Version : Mid-install reboot : How to resume?



pdriley
12-18-2003, 04:10 PM
I give up! I need help.

I need to be able to uninstall a legacy ISPro installation at the beginning of the Windows Installer installation, retaining certain setup files and such, rebooting if necessary and then automatically continuing the installation.

I have this all working EXCEPT that I can't find a reliable way of resuming the installation with all the user settings after the reboot (I'm using ERROR_INSTALL_SUSPEND after setting the REBOOTNOW mode).

I'm currently building a big /qb commandline based on the original commandline and putting that into the RunOnce key. That works fine on Win 9X, less so on NT-series (because GetCommandLine doesn't return the original commandline, it returns "C:\...\msiexec.exe -Embedded " and then a string of seemingly hex characters.

It works and looks great on Win 9X, except that I keep thinking of things the user can change that I need to pass back to the resumed installation. I don't think I can even do that if they select specific features rather than using INSTALLLEVEL.

There must be a better way. There must be a commandline switch that says "resume after reboot". Mustn't there?

Can anyone help me?

Paul M.
12-18-2003, 05:10 PM
Actually MSI has a more eloquant way of handling this. Attached is a sample project that demonstrates how to do this.

pdriley
12-18-2003, 05:53 PM
Hi, and thanks for the quick reply, but I think one of us is missing something [I'm almost sure it's me :o]

This seems to force a reboot at the end of the installation. I need to force one in the immediate context before the generated script is run and THEN ideally run whatever was scripted for action, even if I have to rebuild that.

As a side note, I'm trying to avoid InstallScript if humanly possible and write all CustomActions in C++. It's a policy decision that was agreed some time ago. Basic MSI, no InstallScript.

I have no problem reading InstallScript, but if the solution relies on it then it may be a problem.

Paul M.
12-18-2003, 06:07 PM
You will want to use the ForceReboot action, after using this the installation will reboot and start back up again from the beginning. The way to make it work in the manner that you would like is to condition the actions so that they do not rerun. This can be done with the AFTERREBOOT property. The installer sets this to be a value of 1 when the forcereboot action is fired.

hsong1
12-18-2003, 06:15 PM
hello,,,
i have a question about this AFTERREBOOT property and the method to give a condition.

if i want to use forcereboot after copy files to local machine, in execute sequence, do i give condition (such as AFTERREBOOT <>1) to each action in the sequence (before copy file action)???

thank you