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
- :
- Re: Hide Current Dialog (Basic MSI)
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
‎Sep 15, 2008
04:19 AM
Hide Current Dialog (Basic MSI)
hi,
I need to hide current dialog (below example) and show SdShowMsg using Basic MSI project:
[FONT="Courier New"]function MyFunction(hMSI)
begin
It never works .. Can anyone help me ? Thanks
I need to hide current dialog (below example) and show SdShowMsg using Basic MSI project:
[FONT="Courier New"]function MyFunction(hMSI)
STRING szMsg;
begin
szMsg = "Please wait ...";
SdShowMsg (szMsg, TRUE);
//Attempt to hide current dialog in 3 possible ways but failed ???
Disable(DIALOGCACHE);
EndDialog("SQLLogin");
ShowWindow(hMSI, FALSE);
LaunchAppAndWait("xxx.exe", "", LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
SdShowMsg (szMsg, FALSE);
end;[/FONT]SdShowMsg (szMsg, TRUE);
//Attempt to hide current dialog in 3 possible ways but failed ???
Disable(DIALOGCACHE);
EndDialog("SQLLogin");
ShowWindow(hMSI, FALSE);
LaunchAppAndWait("xxx.exe", "", LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
SdShowMsg (szMsg, FALSE);
It never works .. Can anyone help me ? Thanks
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 15, 2008
12:14 PM
Wasted more than half day just try to solve this problem. Look through most related posts in this forum but without success.
I urgently need to solve this problem. So far, still cannot hide or disable current dialog after it fired some custom action (with installscript).
Getting disappointed. Can someone advise if this is doable in basic msi ?
I urgently need to solve this problem. So far, still cannot hide or disable current dialog after it fired some custom action (with installscript).
Getting disappointed. Can someone advise if this is doable in basic msi ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 15, 2008
01:57 PM
Unfortunately, there's not a good way to do that when mixing InstallScript and MSI dialog boxes. Disable(DIALOGCACHE) and EndDialog are only for InstallScript dialog boxes; in ShowWindow, hMSI is the MSI handle and not a window handle.
One option might be to call FindWindow to get the MSI window handle (Spy++ will give the MSI window class name to use in FindWindow), and then use that window handle in Windows APIs or SendMessage to minimize the window or something.
If skipping InstallScript is an option, you could look into the SpawnWaitDialog control event to pop up a temporary status window that covers the awhile the asynchronous action is taking place.
One option might be to call FindWindow to get the MSI window handle (Spy++ will give the MSI window class name to use in FindWindow), and then use that window handle in Windows APIs or SendMessage to minimize the window or something.
If skipping InstallScript is an option, you could look into the SpawnWaitDialog control event to pop up a temporary status window that covers the awhile the asynchronous action is taking place.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 15, 2008
06:31 PM
Is it possible that the 'SdShowMsg (szMsg, FALSE)' has not been called because the LaunchAppAndWait still has not finished?
Consider putting a Delay(10) and then the second SdShowMsg before the call to LaunchAppAndWait.
Consider putting a Delay(10) and then the second SdShowMsg before the call to LaunchAppAndWait.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 16, 2008
07:21 AM
Thank you very much, hidenori, I try your first option and the problem is solved in less than 10 minutes.
To share it out, this is what I do:
Step 1:
I got the SPY tool to get current dialog window handle. So, I get hwnd: "MsiDialogCloseClass".
Step 2:
I modified the code as below:
[FONT="Courier New"]function MyFunction(hMSI)
begin
end;[/FONT]
Now, installscript can intercept the basic msi dialog and works in sync happily. 🙂
p/s: brianthegood: Hidenori has pointed out the main reason. Thanks for your kindness to help too.
To share it out, this is what I do:
Step 1:
I got the SPY tool to get current dialog window handle. So, I get hwnd: "MsiDialogCloseClass".
Step 2:
I modified the code as below:
[FONT="Courier New"]function MyFunction(hMSI)
STRING szMsg;
HWND hwnd;
HWND hwnd;
begin
szMsg = "Please wait ...";
hwnd = FindWindow("MsiDialogCloseClass","");
SdShowMsg (szMsg, TRUE);
EnableWindow(hwnd,FALSE);
ShowWindow(hwnd, FALSE);
//do whatever you want with installscript
LaunchAppAndWait("xxx.exe", "", LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
SdShowMsg (szMsg, FALSE);
//Optional line if not stay in current dialog
ShowWindow(hwnd, TRUE);
hwnd = FindWindow("MsiDialogCloseClass","");
SdShowMsg (szMsg, TRUE);
EnableWindow(hwnd,FALSE);
ShowWindow(hwnd, FALSE);
//do whatever you want with installscript
LaunchAppAndWait("xxx.exe", "", LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);
SdShowMsg (szMsg, FALSE);
//Optional line if not stay in current dialog
ShowWindow(hwnd, TRUE);
end;[/FONT]
Now, installscript can intercept the basic msi dialog and works in sync happily. 🙂
p/s: brianthegood: Hidenori has pointed out the main reason. Thanks for your kindness to help too.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)