PDA

View Full Version : Save inputted password as a variable and then email it



LiquidIce
09-23-2014, 05:51 AM
Hello Friedrich,

I would like to add a custom dialog that has 3 fields:
1- Your email, can I add a regex to verify the emails on the fly? And if the domain inserted in the email is incorrect, the "Next" button gets disabled?
2- Password: Insert a password and save it as a variable to use it later on
3- Repeat password: Like many apps, I want to verify if the passwords are the same and if not, the "Next" button has to be disabled.

After all of this is done, I see that the installer has the ability to "Connect to the internet", how does this work? Can I tell it to connect to an URL with the value of the custom variables that I used before?

Thanks in advance.

Regards,

Alejandro.

linder
09-23-2014, 06:08 AM
Alejandro,

Absolutely no problem. I would suggest to verify the passwords with the NEXT button event. If the passwords do not match, display a message and select the 1st password entry field. Of course, you can store the passwords in runtime variables. I would use the same method with the email address verification.

BTW, you can send information from your installer to your web site via the "Post to HTTP Server..." script function. You can even send results back from the server to the installer. For example, to check the status of a serial number or license, etc.

Friedrich

LiquidIce
09-23-2014, 06:27 AM
Hello Friedrich,

I have gone ahead and made my own wizard dialog and edited it with the visual dialog editor. How can I give the text fields(edit control) names/ids so that I can later check their value? Because when I set a Variable or Control Name, when I compile it tells me that it has not previously been defined. How do I control the action when clicked on the Next button?

Here is a screenshot of how I have it set up, can you let me know if its correct or no?
http://cl.ly/image/0O3j2W2I0U1l/Screen%20Shot%202014-09-23%20at%2014.32.02.png

Alejandro.

linder
09-23-2014, 06:32 AM
Alejandro,

I would suggest to follow the steps from the "Learning SetupBuilder" manual (see attached screenshot).

Do you have installed this Learning SetupBuilder help and the Examples Package (comes with quite a few interesting custom dialog projects).

Friedrich

LiquidIce
09-23-2014, 06:46 AM
Friedrich,

I don't have the Learning SetupBuilder Part I help document, all I have is what I get when I press F1 in the application, the "SetupBuilder 8.1 Help" and I don't see much information about the custom wizard dialog nor the screenshot you sent.

Alejandro

linder
09-23-2014, 07:05 AM
Alejandro,

Please see the attached screenshots. Just click the "Learning SetupBuilder" link and this will download and install the "Learning SetupBuilder Part I" help. You can download the latest Examples Package from our web site. Of course, you can also download the "Learning SetupBuilder Part I" directly from the web site and install it. No need to do it from within the IDE.

Does this help?

Friedrich

LiquidIce
09-23-2014, 07:32 AM
I'll try it out and let you know. Thanks!

LiquidIce
09-29-2014, 04:08 AM
Friedrich,

How can i add an event or modify the event of clicking on the Next button in my custom wizard dialog? Here are some screenshots of how I have it set up:
Dialogs Structure:
http://cl.ly/image/2c0G3J3E1D3f/Screen%20Shot%202014-09-29%20at%2012.04.50.png

The dialog setup and an input text configuration
http://cl.ly/image/1P1X0r1k0U3m/Screen%20Shot%202014-09-29%20at%2012.04.23.png

The Script
http://cl.ly/image/0A1q3S0e1F2h/Screen%20Shot%202014-09-29%20at%2012.03.21.png

I don't know if i've placed it right in the Dialogs menu or i'm missing something... I checked the documentation you sent me but couldn't find anything on monitoring the Next button event.

Thanks,

Alejandro

linder
09-29-2014, 04:42 AM
Alejandro,

Did you download the Examples Package? There are quite a few custom dialog source code projects that demonstrate exactly this.

BTW, in your screenshot you are not using any of the custom dialog techniques nor do you execute the custom code inside the "Loop Wizard".

I have developed a quick-and-dirty demo for you:

http://www.lindersoft.com/projects/ValidatePassword.zip

Does this help?

Friedrich

LiquidIce
09-29-2014, 05:43 AM
Friedrich,

That worked, I tried something similar in the past but it was doing the checks in every step of the installation.
A question I had on the first post was: Does the application accept regular expressions? Because in the email field, i want to check if the @ domain inserted is the correct one and the passwords to at least have 1 uppercase letter.

Alejandro.

linder
09-29-2014, 05:53 AM
Hi Alejandro,

Yes, SetupBuilder can handle regular expressions (see attached screenshot).

Friedrich

linder
09-29-2014, 06:37 AM
Hi Alejandro,

If you are interested, please re-download:

http://www.lindersoft.com/projects/ValidatePassword.zip

I have added a very simple regex to validate an email address.

Friedrich

LiquidIce
09-29-2014, 07:59 AM
Friedrich,

I did what you mentioned and it worked, I added a 3step password verification, where uppercase+lowercase+number mix must be met in order to accept it.
Can the application send email on its own? I looked through the SetupBuilder 8.1 Help and found nothing about it. So, an alternative that I found was: Post to HTTP Server where a Mail Server is installed and that server is the one in charge of sending the mail. What do you think?

Alejandro.

linder
09-29-2014, 08:09 AM
Alejandro,

Yes, "Post to HTTP Server..." is the correct way to handle it (it's not an alternative! it's the only valid solution!!). For example, you send the information to your web server (formmail.pl or another cgi or sendmail system) and this sends the email via your mail server.

Friedrich

LiquidIce
09-29-2014, 08:15 AM
Friedrich,

Is .php also viable? Because I would like to do a test.com/index.php?mail=%MAIL%&pass=%PW%. The way of doing this is: Destination url: test.com/index.php and text to post: mail=%MAIL%&pass=%PW%. Is that correct? Or do I have to add the ? at the end of the destination URL or does the text to post automatically add it?

Alejandro.

linder
09-29-2014, 08:28 AM
Alejandro,

That is something you have to check with your server administrator. The installer only posts the HTTP stream (in whatever format you need). The server side has to process it. The screenshot you see for "Post to HTTP Server..." has the valid commands for a standard formmail.pl script. But you can use whatever you want (no need to use formmail.pl).

Friedrich

LiquidIce
10-02-2014, 04:56 AM
Friedrich,

I wish to know if there's a way to make the installer open a webpage after the installation is complete, because I have been trying to make it "Post to HTTP Server" to connect to my domain in order to execute the email script but it doesn't seem to be doing anything. If I run that URL manually, it works fine, but not from the installer.

Alejandro.

linder
10-02-2014, 05:50 AM
Alejandro,

If it does not work, then you are doing something wrong (perhaps wrong expected format, etc.). Post to HTTP is a standard function.

For example:

http://www.lindersoft.com/forums/showthread.php?p=76564#post76564

You can even retrieve the HTTP contents back from the server. We are using this in most Consulting projects (e.g. serial number verification, etc.).

BTW, to open a web site, just use the "Run Program" script function and enter the web address and mark the "Open Web Page" checkbox.

Friedrich

LiquidIce
10-02-2014, 07:49 AM
Friedrich,

I approached this in another manner:

I downloaded WGET from GnuWin32 and all its dependancies, I then made a wget command sending post values to my website and that worked.

Alejandro.

linder
10-02-2014, 09:19 AM
Alejandro,

Glad it's working fine!

BTW, if you can do it with wget then you can do the same with "Post to HTTP...".

Friedrich