PDA

View Full Version : Dialog Design



builder_will
07-05-2006, 07:32 AM
Our application uses a formula for generating license keys based on a system id which we construct from a MAC address. To license our product, a user starts the installer and is given their System ID. The users is then pointed to our website where they register and are issued a corresponding license key. This is an entrenched system that I must work with.

There are basically two steps to making this work, but I'm seeing nothing in the Help Library, the forums, or google about how to accomplish either.

1. I want a dialog with an un-editable, pre-populated text field that I can write the System ID to before showing the dialog.

2. Our code for System Id - Key matching is a Java class. I want to use our existing key matching code to test the key users type into a dialog field.

Are either of these possible? How might I go about doing or learning to do them?

RobertDickau
07-05-2006, 08:48 AM
First, which type of project do you want to use (InstallScript or Basic MSI)?

builder_will
07-05-2006, 09:10 AM
I'm using an InstallScript project. It sounds like the most flexible for custom UI's and nested setups (we install PostgreSQL along with our app).

If you think another project type is better suited, now is a good time to adjust since I'm starting from scratch to translate a 10.5 Universal project to IS 12.

RobertDickau
07-05-2006, 09:37 AM
You're right, that InstallScript has a somewhat more flexible UI. (For other advantages and drawbacks to the different project types, you can look at the help topic "Determining Which Installation Project Is Right for You"...)

For (1), you could presumably borrow the SdShowDlgEdit1 dialog box, use the dialog editor to disable the edit field, and add the function call to your script.

For (2) it's not as straightforward, since there's not a direct way to call Java code. Can you compile the Java code as an application, and have it return an exit code that specifies success or failure matching?

builder_will
07-05-2006, 10:21 AM
Good idea for (1), I tried something similar; modifying SdCustomerInformationEx by changing the Company Name label to System ID. Passing a pre-populated string to the constructor didn't seem to work before, but now it does! Great.


As for (2), I could do what you described, but the obstacle is running the java app before installing any files; if there's no jvm installed, we can't get our key-checker to run (we bundle our own jvm, so an existing one isn't a requirement). Plus, the System ID also comes from the java code. It includes a hyphen so returning it during termination seems difficult (impossible?). Sounds like the only way to do what I want is to translate our java code into something more native. Time to learn about dll's?

Thanks for the help.

builder_will
07-05-2006, 10:32 AM
...but disabled text fields aren't selectable. That's a crucial convenience for users who are shuffling System ID's and License Keys to the web and back. I'll have to leave it enabled (thus, I presume, editable) and isolate the System ID in a different variable (from that passed to the constructor) to thwart user modifications.

Too bad there's not an 'editable' property in addition to 'enabled.'

RobertDickau
07-05-2006, 11:17 AM
Actually, it seems you can leave the edit field enabled, and in Other Windows Styles select "ES_READONLY".

builder_will
07-06-2006, 01:34 PM
Cool :). One drawback to editing the standard dialogs is that they cease to be skinnable. Is there any way to allow edited dialogs to continue to work with skins?