I have project with MSSQL perquisites. Until now sql was installing with hardcoded name of instance. Now I want to create functionality with customize this name by user during the installation process.
This is what I’ve done:
I created new dialog window with Edit control to get name of sql instance from user. When user click on “next” button than I going to start installation process (download sql installation from internet and starting silent installation). Because I want to put some feedback to user I should probably update some text control with eg “SQL is installing”. I tried to find the way how to update UI from my action but without success.
Here is my solution:
I’ve put Text control with empty Text property. In subscription tab (on this Text control) I’ve selected event ActionData and Attribute Text. In my action I tried to send a text like this:
hRecActionData = MsiCreateRecord(1);
if( hRecActionData = NULL )then
MessageBox( "Failed to create record.", SEVERE);
endif;
nRes = MsiRecordSetString( hRecActionData, 1,"Instaling SQL..." );
if( nRes != ERROR_SUCCESS )then
MessageBox( "SetString failed", SEVERE );
endif;
nRes = MsiProcessMessage( hMSI, INSTALLMESSAGE_ACTIONDATA, hRecActionData );
if( nRes != ERROR_SUCCESS )then
MessageBox( "ProcessMessage failed", SEVERE );
endif;
Code was run without any errors but Text was not updated.
Is my way good or should I use other approach in my scenario? Why my code won’t works?