This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- MsiSetProperty in OnFirstUIAfter() doesn't work
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2008
10:11 PM
MsiSetProperty in OnFirstUIAfter() doesn't work
I create a new InstallShield MSI project and added MsiSetProperty(ISMSI_HANDLE, "REBOOT", "Force") in OnFirstUIAfter() event handler. But it doesn't work. However it works on my custom action which is the last custom action in Execute subitem (i.e. it is placed after ISSelfRegisterFinalize).
Code:
After completing installation (SdFinish), I would like to prompt the user to reboot. When the prompt message is appeared and I press the Yes button, reboot action doesn't happen. However, from my log file, I see the REBOOT property is indeed changed from Suppress to Force. It's very weird.
As I know, OnFirstUIAfter is deferred execution.
This problem bothers me over one month. Any help is appreciated.
Code:
function OnFirstUIAfter()
STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
NUMBER bOpt1, bOpt2;
begin
Disable(STATUSEX);
bOpt1 = FALSE;
bOpt2 = FALSE;
if ( BATCH_INSTALL ) then
SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
else
SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bOpt1 , bOpt2 );
endif;
MsiSetProperty(ISMSI_HANDLE, "REBOOT", "Force");
end;
After completing installation (SdFinish), I would like to prompt the user to reboot. When the prompt message is appeared and I press the Yes button, reboot action doesn't happen. However, from my log file, I see the REBOOT property is indeed changed from Suppress to Force. It's very weird.
As I know, OnFirstUIAfter is deferred execution.
This problem bothers me over one month. Any help is appreciated.
(7) Replies
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 05, 2008
12:52 PM
By this point, the Windows Installer process has relinquished its control and the InstallScript engine owns the installation, so you want to use InstallScript to trigger the reboot.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 05, 2008
07:52 PM
Hi, bryanwolf:
Thanks for your reply. I know Installscript would trigger the reboot action when BATCH_INSTALL is set to true. However, I want to create another dialog to prompt users to reboot. That would make users know rebooting their PC is essential. This idea is from some software installations. I'm very curious how they could do it.
Thanks for your reply. I know Installscript would trigger the reboot action when BATCH_INSTALL is set to true. However, I want to create another dialog to prompt users to reboot. That would make users know rebooting their PC is essential. This idea is from some software installations. I'm very curious how they could do it.
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2008
10:47 AM
Is there a reason the SdFinishReboot can't deliver that information and functionality for you?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 09, 2008
07:50 AM
SdFinishReboot with BATCH_INSTALL=FALSE could inform users the setup process has been completed. SdFinishReboot with BATCH_INSTALL=TRUE could inform users the setup completion and reboot their PCs in one dialog.
Now, My requirement is:
step 1: Use SdFinishReboot with BATCH_INSTALL=FALSE to inform users the setup process has been completion.
step 2: After the above dialog, I want to create "another dialog" to prompt users to reboot their PCs, just like the above attached image.
I couldn't find a solution for step 2. Is it clear? Thanks for your help.
Now, My requirement is:
step 1: Use SdFinishReboot with BATCH_INSTALL=FALSE to inform users the setup process has been completion.
step 2: After the above dialog, I want to create "another dialog" to prompt users to reboot their PCs, just like the above attached image.
I couldn't find a solution for step 2. Is it clear? Thanks for your help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2008
03:14 AM
Anyone could help me?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2008
02:44 PM
You could try using the standard SdFinish dialog instead of SdFinishEx, and then call AskYesNo to determine if the user wants to reboot. If yes, then call the System function passing SYS_BOOTMACHINE (this is basically what SdFinishReboot does). Note that you will also want to set BATCH_INSTALL to TRUE if the OnRebooted event needs to run after the reboot.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 19, 2008
10:08 PM
Thanks a lot. 🙂 It works...