PDA

View Full Version : Accepting a product key code



ColoradoCJG
03-10-2008, 04:00 PM
Has anyone had any experience creating a custom .msi dialog that will accept a user-entered product key code, and then validate that it's correct?

Our installs have been created using Installscripts, and we currently have a dialog during the interview process that does indeed accept a users key code, then installs certain components based on the key code entered.

I'd like to be able to do this sort of thing in the .msi world too, but I don't have a ton of .msi experience and am not sure how to go about pulling this off.

If anyone has any help with this I'd appreciate it!

joshstechnij
03-11-2008, 10:32 AM
The simplest method of doing this is through a custom action launched from the Next button of the dialog (available through the Behavior node for the dialog in the Dialogs view) that accepts the product key:

- If the custom action determines that the key is valid, set a property in the custom action to indicate the key is valid.
- On the Next button behavior, add a condition to the NewDialog event which allows the next dialog to be displayed; use the property set by the custom action as the condition:
IS_VALID_KEY="1"
- Make sure the NewDialog event is listed after the DoAction event that launches the custom action.

Note that this method can be circumvented by running the MSI package without a user interface (/qb or /qn on the command line), and as such, we would typically recommend that you also provide validation in the execute sequence or in the application itself (anyone with knowledge of MSI packages and Orca can also remove the custom actions that perform the validation).