Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

PC Wont Reboot


4 replies to this topic

shaun

shaun
  • Members
  • 11 posts

Posted 18 January 2002 - 23:12

I'm trying to create  a merge module to install DCOM95 now while this would be easy if used Install Shield unfortunately I dont own the product so I have to use Orca.

I want to Check for DCOM and then install it after AppSearch has taken place. The checking etc works fine and my custom action that calls my dll to cause the reboot runs fine but it doesn't cause Installer to do the right thing. In my custom action I use MsiSetMode passing it MSIRUNMODE_REBOOTNOW to force an immediate reboot. However this doesn't happen and the install proceeds to the normal dialogs. If the user cancels some other running programs attempt to shutdown as if they were given the command to end (This also happens if I send the MSIRUNMODE_REBOOTATEND). But if I let the Install continue the dialog boxing telling the user that he needs to reboot pops up ... it seems as tho REBOOTNOW does the same as REBOOTATEND.

How can I force a reboot to occur at this time before any installs are done. I looked at an install by InstallShield and they have a CA that does this .. and it works .. why would theirs work and not mine what am I doing wrong or is there some extra undocumented calls that I need to make.
Please help !!!

Shaun


shaun

shaun
  • Members
  • 11 posts

Posted 21 January 2002 - 08:47

OK, I figured out the behaviour of the installer after setting the internal run mode to REBOOTNOW if it is not between InstallInialize and InstallFinalize then the installer is set to do a scheduled reboot even tho the internal mode is REBOOTNOW. If it is set while you are between the above two sections then it functions as per normal and does an immediate reboot. But ... InstallShield still manage to get a reboot to happen outside this section... I think I know how but need to see if I can get it to work ... If anyone has any ideas I'd appreciate them.

(Edited by shaun at 7:53 am on Jan. 21, 2002)


shaun

shaun
  • Members
  • 11 posts

Posted 21 January 2002 - 12:06

what I have tried to do is to return the error code ERROR_NO_MORE_ITEMS so that the installer tries to end and reboot system - this works fine but it shows the dialog box "FinishedForm" .. How would I stop this from coming up from with in my custom action? I've tried setting the InternalUI to INSTALLUILEVEL_NONE but that does seem to stop it from popping up.

shaun

shaun
  • Members
  • 11 posts

Posted 21 January 2002 - 16:13

I eventually figured out how to get this working turns out .. as per usual ... there are undocumented return codes for a custom action ... surprise surprise Microsoft never told us about them and yet it appears Installshield was using them (well at least i think so)! Anyway what I have figured out is that to do the reboot before the installation sections ... what I need to do is to return ERROR_INSTALL_SUSPEND then no user dialogs pop up about install being cancelled / terminated / complete .. all that pops up is the prompt about rebooting the PC.  You still need to set the RunOnce key up under HKLM with the commandline parameters (use GetCommandLine) and save them to the registry yourself - so that installation continues after reboot.


shaun

shaun
  • Members
  • 11 posts

Posted 22 January 2002 - 12:12

Found something very interesting:

return ERROR_INSTALL_SUSPEND;

indicates that a reboot is required - this is what the Installer returns if  ForceReboot Action was used.
If in UI excexcute mode take note that returning this error tells the installer to run any actions/dialog in the InstallUI table with a sequence number of -4.