fossil
Posts: 13
Joined: Wed Sep 12, 2007 6:55 pm

Small problem with serial validation in UserRegistrationDlg

Running: Advanced Installer 5.2.2
Running: built installation on Windows Installer 3.0, WinXP SP2

Short story: the ProductID property is not deleted before ValidateProductID event is published. If the serial number is validated more than once, and the first attempt succeded, the ProductID property remains set during subsequent validations.

The implications of this behavior are simple: if the end user comes back to the UserRegistrationDlg dialog and changes the serial number, the changes effectively bypass the template validation in ValidateProductID event. The warning message box is displayed, but the stock events in the Next button are authored in such a way that this template validation has no effect. The AI_VALID_SERIAL action is still called, though.
If you author your install to accept any serials that fit the template, you can get invalid serials sneaking in.

Also note, that simply deleting the ProductID property before ValidateProductID event is not sufficient. If you only do that, then the changed serials will even bypass the AI_VALID_SERIAL action.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I am unable to reproduce this behavior on my test machine. Can you please provide more details about this problem? Are you using Advanced Installer's built-in validation method or a custom serial validation dll?
If the serial number is validated more than once, and the first attempt succeded, the ProductID property remains set during subsequent validations.
Please note that the ProductID property is modified to the serial given by the user if that serial is valid. If it's not valid then the "Invalid Serial Number" error will be shown.

If you are using a custom serial validation dll which shows this behavior then you could use a "SetProperty" control event in the "Published events" tab for the "Next" button which looks like this:

Code: Select all

[SERIAL_VALIDATION]     FALSE     AI_INSTALL
Please note that this control event will be above the "DoAction" control and it will initialize the SERIAL_VALIDATION property.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
fossil
Posts: 13
Joined: Wed Sep 12, 2007 6:55 pm

cosmin wrote:Are you using Advanced Installer's built-in validation method or a custom serial validation dll?
My apologies, I did not mention that I am using custom serial validation in a DLL. As I said, the error is shown by the ValidateProductID control event, but the next dialog is displayed right after because the validation custom action in the DLL just accepts anything and sets SERIAL_VALIDATION = "TRUE".

My point really was that the validation done by ValidateProductID can be bypassed. If it can be bypassed, why have it there at all?

To ensure validation at all times, I've initially modified my UserRegistrationDlg Next button to this:

Code: Select all

[ProductID]           {}                1
[SERIAL_VALIDATION]   {}                1
ValidateProductID     0                 1
DoAction              AI_VALID_SERIAL   ProductID
NewDialog             WhateverDlg       ProductID AND SERIAL_VALIDATION="TRUE"
(Copyright disclaimed, you can have it if you wish)

Now, however, I am not using AI's serial validation at all. One of the reasons is that I need to allow end users to install a trial version by not entering a serial (leave it blank), and AI cannot do that because the actions generated in InstallExecuteSequence do not support this. This could actually be a nice feature for AI too.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Thank you very much for bringing this problem to our attention. This feature will be improved in a future version of Advanced Installer.

If you encounter any other problems, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”