cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DWillis
Level 5

Dual Reboot on uninstall. How do I stop/control it?

I have added installscript to schedule a reboot at the end of the installation.

I added the SdFinishReboot call to the OnEnd handler. This works great for installations.

When uninstalling, I need to removed a couple of Windows Services. It seems that either IS or the Windows Installer recognizes this and schedules a reboot.

This is fine, with the exception that my OnEnd handler is still being called, and scheduling another reboot, so at the end of my uninstall, I am prompted for a scheduled reboot twice.

How can I check in the installscript to verify that it is an installation or an uninstallation? Or, where can I disable that reboot check?

On the same issue, Is there a way I can force the user to reboot instead of giving them the option to reboot later, sort of like the force reboot that it supposed to be used in the middle of an install?

Thanks in advance,
D
Labels (1)
0 Kudos
(4) Replies
SMadden
Level 6

Look at the source code of the On...UIAfter() functions. They already include calls to SDFinish and SDFinishReboot. The latter is used if the BATCH_INSTALL is set to true.

You get your double reboot by adding another SDFinishReboot in OnEnd, which is called after OnFirstUIAfter() for example. I'd suggest to set BATCH_INSTALL to true if you need it instead of adding the additional SDFinishReboot.

Sandra
0 Kudos
DWillis
Level 5

SMadden wrote:
Look at the source code of the On...UIAfter() functions. They already include calls to SDFinish and SDFinishReboot. The latter is used if the BATCH_INSTALL is set to true.

You get your double reboot by adding another SDFinishReboot in OnEnd, which is called after OnFirstUIAfter() for example. I'd suggest to set BATCH_INSTALL to true if you need it instead of adding the additional SDFinishReboot.

Sandra

Ah. That makes sense. Sure beats writing some installscript to use a property value I set based on a feature event. lol

Where is the BATCH_INSTALL located? And where can I located the source code of the On...UIAfter() functions?

Thanks again!
0 Kudos
SMadden
Level 6

to force the reboot dialog to come up in the end just add

BATCH_INSTALL=TRUE;

somewhere to your InstallScript code.

You get to the OnFirstUIAfter(), OnMaintUIAfter() and OnUpdateUIAfter() code this way:

- Installation Designer View / Behaviour and Logic / InstallScript
- click on Setup.rul to open the code view in the right window
- select "After Move Data" in the left drop down list and OnFirstUIAfter in the right dropdown list.

That should copy the default code for the event handler into your setup.rul file.

Sandra
0 Kudos
DWillis
Level 5

SMadden wrote:
to force the reboot dialog to come up in the end just add

BATCH_INSTALL=TRUE;

somewhere to your InstallScript code.

You get to the OnFirstUIAfter(), OnMaintUIAfter() and OnUpdateUIAfter() code this way:

- Installation Designer View / Behaviour and Logic / InstallScript
- click on Setup.rul to open the code view in the right window
- select "After Move Data" in the left drop down list and OnFirstUIAfter in the right dropdown list.

That should copy the default code for the event handler into your setup.rul file.

Sandra

Oh man. Thanks for this Sandra. 😄 bty, nice name. (My wife has the same name)

Now to figure out how to edit registry keys instead of destroying them. 😄
0 Kudos