How can I add the reboot action to a vdproj? I need an MSI which restart the pc at the end of the installation. Thank you.
If you need to reboot, Windows Installer should detect it automatically. If you want to reboot as you are too lazy to start services manually, you will need to find some other way (I do not know of any easy way).
Just add the "REBOOT" property with the value "Force" which will prompt the user to reboot once setup is complete, or automatically reboot if there is no user interface.
If you cannot do this in the vdjproj then just use Orca to edit the Property table of the MSI once the setup is built.
If you want to force a reboot, you can set REBOOT=Force and REBOOTPROMPT=Suppress so that the user is not prompted.
Alternatively you can use the ForceReboot
action to reboot during the middle of installation or ScheduleReboot
to schedule a reboot once the installation is complete. Again either of these actions can be added using Orca if you cannot do so in the vdjproj.
You can do something like this using the following VBS
Dim installer, database, view, result
Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase ("setup.msi", 1)
Set view = database.OpenView ("INSERT INTO Property (Property, Value) VALUES ('REBOOT', 'Force')")
view.Execute
database.Commit
Set database = nothing