cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jeffyee
Level 3

Displaying configuration status

Hi,

I was wondering how I would display a configuration status to the user. I don't want them to think the installer has frozen, so as the installer is configuring components, I want to display the current action.

To that end, I created a custom dialog composed of a list box. As I perform a configuration task, I want to update the list box. So I have the following code


while( !bDone )
nId = WaitOnDialog( sDialog );

switch( nId )
case DLG_INIT:
hwndDlg = CmdGetHwndDlg( sDialog );
SdGeneralInit( sDialog, hwndDlg, STYLE_BOLD, szSdProduct );
SdSetDlgTitle( sDialog, hwndDlg, sTitle );

nStatusText = ListCreate( STRINGLIST );

CtrlSetList( sDialog, _SDCONFIGSTATUS_STATUSLIST, nStatusText );

ListAddString( nStatusText, "Configuring Componet 1", AFTER );
CtrlSetList( sDialog, _SDCONFIGSTATUS_STATUSLIST, nStatusText );
//perform task1 here;

ListAddString( nStatusText, "Configuring Componet 2", AFTER );
CtrlSetList( sDialog, _SDCONFIGSTATUS_STATUSLIST, nStatusText );
//perform task2 here;

case _SDCONFIGSTATUS_STATUSLIST:
nMessage = CtrlGetSubCommand( sDialog );

case NEXT:
bDone = TRUE;

default:
if ( SdIsStdButton( nId ) && SdDoStdButton( nId )) then
bDone = TRUE;
endif;
endswitch;
endwhile;


However, the dialog does not appear until all the configuration tasks has completed.

Does anyone have any suggestions?

Thanks
Jeff
Labels (1)
0 Kudos
(1) Reply
jeffyee
Level 3

Its not quite what i wanted, but it has the same effect.

You can display a small dialog with a progress bar and using SetStatusWindow( nPercent, sMsg ). Here's an example


Enable( STATUSDLG );

SetStatusWindow( 0, "Performing Task1" );
// do Task 1

SetStatusWindow( 33, "Performing Task2" );
// do Task 2

SetStatusWindow( 66, "Performing Task3" );
// do Task 3

SetStatusWindow( 100, "All done" );

Disable( STATUSDLG );
0 Kudos