Hi, warming up this thread I want to add first my request for support at least for some reboot handlings of prerequisites in AI.
1. What could be done quite easily by AI: To add a new option that does not reboot after _each_ prerequisite (this function does not make much sense in fact, to be honest, at least not for setups who consist of a bunch of prereqs or multiple setups), but either after all prerequisites or to automatically set the REBOOT property at the end of the whole setup (Best would be to have both alternatives).
As long as AI does not provide this, with the given .js script in this script, I would recommend the following as a potential workaround:
1. The .js script for the recognition just have to contain the original test if the prereq requires a reboot (e.g. return code 3010 like for .NET, etc.).
2. If so, the script writes at an (own) defined registry place.
3. You read that registry key into your (last) MSI with standard ways into a property
4. You specify a standard custom action on setting the reboot depending on a condition.
Two more tips:
Speaking about .NET setups, AFAIR, normally they behave so, that a first install (e.g. 4.5 on Windows 7 or .NET 3 on XP) does not require a reboot, but an update like 4.x on a Windows 8++ machine will require a reboot.
Most reboots (file based) you can detect if there are registry values in "PendingFileRenameOperations" entry under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager key:
http://blogs.technet.com/b/brad_rutkows ... eboot.aspx
But I would not work with this, but getting the proper return code of the setups by a script. Most setup types (as well as prerequisite setups in special) provide one for reboots.