We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Installation continues even with blank or wrong serial number

I have added your default UserRegistrationDlg to perform a sever-side validation. It works as expected if I enter the correct serial number. It's when the serial number is incorrect or the PIDKEY edit box is empty I encounter issues with two scenarios:

If I enter the wrong serial number in the PIDKEY edit box I do get the "Invalid serial number" message as expected. I press OK and the installer takes me to the next Dialog instead of remaining on the UsrRegistrationDlg to input the correct serial number.

If the PIDKEY Edit Box is empty and I press the Next button, I also get the "Invalid serial number" message which I would expect. I press OK and the installer takes me to the next Dialog instead of remaining on the UsrRegistrationDlg to add the correct serial number.

I have created a spawned Dlg to inform the user there are blank fields but the message appears after the installer has proceeded to the next dialog. Changing the events order appears to have no impact either? Is the Execute custom action - AI_VALID_SERIAL in the Published Events a hard-coded action?

How can I remain on the UserRegistrationDlg until the PIDKEY is not empty and is correct before continuing to the next dialog?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Installation continues even with blank or wrong serial number

Hello,

You can do so by using the following condition:

Code: Select all

SERIAL_VALIDATION="TRUE"
on the display a specific dialog - NextDialog event. The "SERIAL_VALIDATION" property is set to TRUE by our "AI_VALID_SERIAL" custom action when the serial number is correct.

If you are using spawned dialogs to inform the user about empty fields please make sure they are added as the last events (from top to bottom) in the "Published Events" list.

Let us know is this helped, otherwise please give us more details about your scenario/requirements. Or maybe you can isolate the behavior in a small sample you could share with us.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Re: Installation continues even with blank or wrong serial number

Thank you for replying Daniel.

I have read your reply and as far as I can see that is how it is set up. For this testing I am trying to keep everything as AI defaults in your tutorials. So I took some screenshots.

I added AI’s default UserRegistrationDlg. I ran the build as it is shown and tested it with my remote server to test the connection and serial validation. It validated correctly. I did this to ensure it was not introducing some other issue.

AI UserReg.jpg
AI UserReg.jpg (243.14 KiB) Viewed 5849 times

This next screenshot shows the AI default published events for the Next button. On the Next Dialog event you can see it is to the ReadmeDlg. I’ve opened the Control Event to show the condition is set to SERIAL_VALIDATION=”TRUE”.

AI UserReg002.jpg
AI UserReg002.jpg (289.33 KiB) Viewed 5849 times

I compile and run again this time with the Serial Number field left blank. I get a window saying “Invalid serial number” (Not sure where that error message is coming from? Hard-coded from your custom action AI_VALID_SERIAL?)

Then when I click OK the ReadMeDlg is bypassed, the LicenseAgreementDlg is bypassed and I arrive at my custom FSversionSelect dialog. The same process happens if I enter an incorrect serial number as well.

Adding a spawned dialog at the bottom of the published events did not make any difference. It does appear but AI has already proceeded to the FSversionSelect dialog by then.

Just noticed something… do dialogs must have “Dlg” at the end of their name or is that at user’s discretion? I noticed I was not adding that to my names.
Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Re: Installation continues even with blank or wrong serial number

Catalin, maybe you can take a look at this?
Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Re: Installation continues even with blank or wrong serial number

As an update, I was able to stop AI from progressing to the next Dialog with a little powershell script checking to ensure the Serial Number Edit Box was not empty. So that's half of the battle. But once the custom action AI_VALID_SERIAL is invoked I cannot find a way to stay on the UserRegistrationDlg if the serial validation check is false.

For example, on the event Display a specific dialog, I have the argument FSversionSelect (which is the next dialog), and I as a condition I have: AI_INSTALL AND (SERIAL_VALIDATION="TRUE"). But AI "blows" right past it?!?! :D
Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Re: Installation continues even with blank or wrong serial number

After several more hours of testing I have something that works (more of a work around). I moved the UserRegistrationDlg past the ReadmeDlg and the LicenseAgreementDlg. In the UserRegistrationDlg's published events it now shows FSversionSelect as the 'Display a specific dialog' which would now be the next dialog. I then added another 'Display a specific dialog' with the Argument being LicenseAgreementDlg and the condition is set as 'AI_INSTALL AND ( SERIAL_VALIDATION="FALSE" )'

This way if I have a blank or wrong serial number AI still takes it to the FSversionSelect dialog but an error message appears. When click 'OK" it reverts back to the LicenseAgreementDlg, one dialog before the UserRegistrationDialog. The user then has to click OK to get back to the UserRegistrationDialog to re-enter the serial number.

Again, not great but I can't see another way to do this unless you have some way to remain on the UserRegistrationDialog if the Serial Number is blank of FALSE? :?
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Installation continues even with blank or wrong serial number

Hello Marcus,

First of all, sorry for the delayed reply but we had our Orthodox Easter holiday here and I had to do some catching up from that. Also, I have seen that my colleague Daniel has answered you and I did not click on this thread, thus I did not see that you have been asking me to answer.
:)
Just noticed something… do dialogs must have “Dlg” at the end of their name or is that at user’s discretion? I noticed I was not adding that to my names.
No, it is not a must for dialogs to have "Dlg" at the end of their names. You can name your dialogs as per your needs.

In what regards your main issue, this is indeed pretty strange. I have tried to test this now but I was not able to replicate the behavior. In order for me to further investigate & test this, could you please send me a copy of the .AIP file by e-mail at support at advancedinstaller dot com?

Looking forward to hearing from you.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Clutch
Posts: 12
Joined: Sat Oct 20, 2018 4:23 am

Re: Installation continues even with blank or wrong serial number

Thanks for the reply Catalin. After reading your reply I took a long look at the project and through all my testing I must have ended up corrupting the install. So I started from scratch and now it is working! :) Thanks again.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Installation continues even with blank or wrong serial number

You are always welcome, Marcus.

I am really glad you got this working.
:D

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”