I'm trying to put a check in at the end of installers for any reboot condition: checking WININIT.INI or PendingFileRenameOperations and all combinations of [HKLM|HKCU]\...\RunOnce(Ex). I'm using an MSI DLL written in VC++.
I'm not sure how to do it.
If I put the CA before InstallFinalize, it has to be deferred or the CAs that might cause the conditions may not have run.
If I just run MsiDoAction("ScheduleReboot") then nothing happened.
But if I return ERROR_SUCCESS_REBOOT_REQUIRED then it rolls back the installation.
Should I run a custom action after InstallFinalize? Can I schedule a reboot at this time by returning ERROR_SUCCESS_SCHEDULE_REBOOT? Can I access properties or do I have to use the Windows API to figure out (a) which Windows version I'm in and (b) where the Windows folder is?
Or am I doing something wrong? Is it possible to schedule a reboot from within a deferred CA?
Help! Someone must have done this before?