cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ggrewe
Level 5

Problem writing Custom Dialog value to MSI Properties

In my Installscript MSI project I have created a custom dialog box and I am able to display the dialog box properly during the UI. However I have six text boxes on the dialog box and need to populate six different properties in the MSI so that these values can later be written to the registry and used in other Custom Actions.

The code below is from my "CustomDialog.rul" script file. It does not appears that the "CtrlGetText" is retrieving the data correctly. It also appears that the "MsiSetProperty" is not writing anything to the corresponding MSI Properties. Any help would be appreciated.



prototype NUMBER CustomDialog();

function NUMBER CustomDialog()

// control identifiers

#define BUTTON_NEXT 1
#define BUTTON_BACK 12
/// #define BUTTON_CANCEL 9
#define edtServername 1303
#define edtSharename 1305
#define edtDSNName 1309
#define edtDBUsername 1306
#define edtDatabaseServer 1313
#define edtDatabase 1310

BOOL bDone;
NUMBER nControl, nReturn, hwndDlg ;
STRING svServerName, svServerShare, svDBUserName ;
STRING svDBServer, svDBName ;

begin

EzDefineDialog("CustomDialog", ISUSER, "cusServerInformation", 0);

while (!bDone)
nControl = WaitOnDialog("CustomDialog");
switch (nControl)
case BUTTON_BACK:
// user clicked Back
nReturn = BUTTON_BACK;
bDone = TRUE;
case BUTTON_NEXT:
// user clicked Next
hwndDlg = CmdGetHwndDlg( "CustomDialog" );

CtrlGetText( "CustomDialog", edtServername, svServerName );
MsiSetProperty(hwndDlg,"IS_SQLSERVER_SERVER", svServerName ) ;

CtrlGetText( "CustomDialog", edtSharename, svServerShare );
MsiSetProperty(hwndDlg,"IS_SQLSERVER_SERVER1", svServerShare ) ;

CtrlGetText( "CustomDialog", edtDBUsername, svDBUserName );
MsiSetProperty(hwndDlg,"IS_SQLSERVER_USERNAME", svDBUserName ) ;

CtrlGetText( "CustomDialog", edtDatabaseServer, svDBServer );
MsiSetProperty(hwndDlg,"IS_SQLSERVER_DATABASE", svDBServer ) ;

CtrlGetText( "CustomDialog", edtDatabase, svDBName );
MsiSetProperty(hwndDlg,"IS_SQLSERVER_DATABASE1", svDBName ) ;

nReturn = BUTTON_NEXT;
bDone = TRUE;
case BUTTON_CANCEL:
// user clicked Cancel; ask user to verify cancellation
Do(EXIT);
endswitch;
endwhile;

EndDialog("CustomDialog");
ReleaseDialog("CustomDialog");

end;
Labels (1)
0 Kudos
(2) Replies
ggrewe
Level 5

I resolved this issue. The fix was to place the MsiSetProperty code in the "setup.rul" file, not in the Custom Dialog rule file.
0 Kudos
jbryant
Level 3

Just some more information (as I spent about 4 hours wrestling with this as well), use all uppercase letters for your property names to set public properties, otherwise they get reset when it moves from the UI stuff to executing the rest of the install (or something like that).
0 Kudos