how to reboot from custom action?
Posted 01 March 2004 - 21:03
I am giving myself an aneurism trying to work out how to signal that a reboot should occur at the end of my install.
It is a question answered many times on this board, and I understand that I must either place a REBOOT property in the msi database or add a ScheduleReboot action to the sequence table.
Having created my installer using a VS.NET setup project I don't want to have to edit the .msi file manually with orca in any way after compilation. However I don't see how I can modify the database tables as part of the setup project.
If there are no project options, then perhaps it can be achieved programatically? I have written a custom action class in c# which takes care of my special requirements post install. Is there a way to flag the need for a reboot from Install(), or possibly at Commit() time?
If anyone can tell me how I can achieve this, I'll be eternally grateful!
Many thanks in advance,
Posted 02 March 2004 - 02:40
Posted 02 March 2004 - 10:57
The installer is for an XP only consumer product and will be distributed as the .msi file only, so commandlines are out.
Could you point me towards more information about type51 cusom actions please?
The MsiXyz... calls are only available to c++ language .dll type cusom actions so I'm thinking that perhaps I might rewrite my CA in this way... watch this space!
Posted 02 March 2004 - 17:43
// signal that the installer should reboot at end of install
MsiSetMode( hInstall, MSIRUNMODE_REBOOTATEND, TRUE );
Still no reboot.
To recap, my CA is being called after install. Is this too late to be setting the reboot flag?
Posted 02 March 2004 - 23:51
I think you will need your custom action before this action.
Posted 04 March 2004 - 22:50
Maybe you could edit the package with Orca?
Have you tried using code to set - REBOOT=Force?
Posted 05 March 2004 - 11:19
The buildprocess needs to be a single step, hence I can't edit the .MSI with orca (even if I knew how.. that's some confusing shit!)
I will try setting REBOOT=Force, though I think the reason the MsiSetMode call isn't performing its duty is that the CA is being deferred, instead of immediate.
As far as I can tell, deferred CAs are allowed no interaction with the installer, and this might be the reason, though how I can tell if this is the case is anyone's guess.. There is no obvious way of either choosing nor telling the type of the CA in the VS IDE.
Would examining the CA type in orca tell me?
Posted 08 March 2004 - 23:15
Maybe you should look at using another type of installation creator (instead of Visual Studio?) since the visual studio one to me looks like it is not meeting your needs.
There are a few 'free' setup creators out there (makemsi) try looking on Install site, or a google search.
Posted 09 March 2004 - 11:33
I'll have a look around thanks.