I was in a situation in which the installer needs to reboot and then continue the installation after restart.
Basically what we need to do are:
- Ensure you save the state before reboot. In this case I save it to registry
- Save the installer name (as key) and path (as value) to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
- After restart, read the state and continue the installation.
The example is here