During installation I need to install additional roles in Windows that may require a reboot to complete. Installation mustn't continue until Windows has been rebooted.

What is the best way to cancel installation, reboot and restart the installation?

asked 24 Sep '13, 12:37

Matthew%20Steed's gravatar image

Matthew Steed
16668
accept rate: 100%


Unfortunately it is not trivial to perform the process of rebooting a machine and automatically resuming installation after the reboot.

As for restarting itself, it is enough to run shutdown /r /t 0 command to reboot a machine. The <runProgram> action can be used for this - such as:

<runProgram> <program>shutdown</program> <programArguments>/r /t 0</programArguments> <ruleList> <isFalse> <value>${reboot_already_performed}</value> </isFalse> </ruleList> </runProgram>

The action is documented in Run Program section of InstallBuilder user guide.

You can check early in the installation process if the role exists - and if not, show information that installer will add it and reboot system, then add the role and reboot the machine if the user accepts this.

It is also possible to add installer to Run or RunOnce (i.e. to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce) so it is started automatically at next system startup - however, that may not be that simple if the installer requires UAC elevation.

This may require creating a helper .bat script that will be run without elevation and use start command to run the actual installer, which will require elevation.

link

answered 24 Sep '13, 17:25

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×9

Asked: 24 Sep '13, 12:37

Seen: 941 times

Last updated: 24 Sep '13, 17:25