This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- How to Reboot System after installation completes in Chained MSI also known as Multi-package Transac...
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
How to Reboot System after installation completes in Chained MSI also known as Multi-package Transaction
How to Reboot System after installation completes in Chained MSI also known as Multi-package Transaction
Summary
Discussion and code snippet to facilitate reboot in a Chained MSISynopsis
Calling ScheduleReboot from a multi-package transaction is not supported. Therefore you will have to use custom code to facilitate a system reboot after the Chained MSI runs. One way to accomplish this is to create a custom action and associate the custom code to the "OK" or "Finish" button on the setup complete success dialog. In this situation the code is executed when the dialog is presented (which implies successful install) and is based on the button click.Discussion
A couple of programmatic approaches to author a reboot are below. These are InstallScript and VBScript examples:InstallScript
#include "ifx.h" export prototype RebootCA(HWND); function RebootCA(hMSI) begin MsiSetMode( hMSI, MSIRUNMODE_REBOOTNOW, TRUE ); end;
VBScript from - The System Administration Scripting Guide, part of the Windows .NET Server Resource Kit.
strComputer = "atl-dc-01" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems ObjOperatingSystem.Reboot() Next
Additional Information
Microsoft documentation references for Multi-Package transactions:Multiple-Package Installations
Windows Installer 4.5 Transaction Enhancements: Multi Package Transaction
No ratings