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
- :
- Problem writing Custom Dialog value to MSI Properties
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
‎Jun 04, 2008
10:23 AM
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.
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;
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 05, 2008
07:44 AM
I resolved this issue. The fix was to place the MsiSetProperty code in the "setup.rul" file, not in the Custom Dialog rule file.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 08, 2008
05:14 PM
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).