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!

clsmith66
Posts: 4
Joined: Fri Mar 02, 2007 5:52 pm

Noob needs help

I'm evaluating the enterprise version of AI and I'm trying to create a custom dialog. I got the controls I wanted on the screen and I got the basic installer application built easily (thank you), but I'm having a little trouble getting a little "fluff" functionality to work. I'm trying enable/disable a radio button group based on a checkbox selection. I tried doing a script inline ui costom action, but I think I've been writing .NET for too long, and can not figure out the syntax to do what I want. Can some one please help me with this or give me some good places to start looking at how to do it?

Any help will be greatly appreciated.

Chris
clsmith66
Posts: 4
Joined: Fri Mar 02, 2007 5:52 pm

I finally muddled my way through my previous post, but have a new question. Is it possible to test the information entered from the SQL Connection Dialog before allowing the user to continue to the next page?

Thanks again for any insight

Chris
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Chris,

Regarding on how to show/hide a control depending on the state of a check box you can do like this:

Select the control you want to show/hide. Under "Control Conditions" tab add two events like this:

Condition: CHECK_PROP = 1
Action: Hide

Condition: CHECK_PROP <> 1
Action: Show

Were CHECK_PROP is the property of the "CheckBox" control and 1 its value, both defined in the "Properties" list of the control.
Is it possible to test the information entered from the SQL Connection Dialog before allowing the user to continue to the next page?
Select the "Next" button on the "SQLConnectionDlg" and edit the existing "Published Event" with the following condition: PORT_PROP = 1. In this way the the installation will continue only if you type 1 in the "Port" field.

Now you need to display a meesage box informing the user what is happening. To that like this: In the "Custom Actions" page add a new "Script In Line" custom action under "UI Custom Actions" section with this "Script Text": MsgBox "The port number must be 1"

Switch back to "Dialogs" page and under the "Next" button of the "SQLConnectionDlg" add a new published event like this:

Event: DoAction
Argument: ScriptInLine
Condition: PORT_PROP <> 1

This is an example on how to validate the port number. You need to do something similar for all fields.

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
clsmith66
Posts: 4
Joined: Fri Mar 02, 2007 5:52 pm

Thanks for your help Gigi, and I'm sorry for the time between post but I got side tracked on another project.

I think there was a little confusion as to what I'm trying to do with SQLConnectionDlg. I put a "Test Connection" button on the page that only enables once the user has filed in all the fields. What I would like to do is attempt to actually connect to the database using the information entered by the user before enabling the "Next" button. I've add a property named TEST_CONNECTION and set it to "No" and I created a VBScript file to attempt to connect to the database. It seems no matter what I do in the script file, I either get an error that stop execution of the installation or I can not change the TEST_CONNECTION value. As I'm really new at this scripting, I was hoping you could take a look at what I'm using and tell me what I'm missing.

Code: Select all

Function Test_Connection()
	Dim strConnString
	Dim strSQL

	strConnString = "Provider=SQLOLEDB;"
	strConnString = strConnString & ";Server=" & Session.Property("SERVER_PROP")
	strConnString = strConnString & ";Database=" & Session.Property("DATABASE_PROP")
	strConnString = strConnString & ";User Id=" & Session.Property("USERNAME_PROP")
	strConnString = strConnString & ";Password=" & Session.Property("PASSWORD_PROP") & ";"

	strSQL = "SELECT CompanyID FROM Company"

	Dim myConn
	Dim myRecordset
	Dim intCount

	Set myConn = CreateObject("ADODB.Connection")
	Set myRecordset = CreateObject("ADODB.Recordset")
	myConn.Open strConnString
	myRecordset.Open strSQL, myConn
	
	intCount = myRecordset.RecordCount
	myRecordset.Close
	myConn.Close
	
	Test_Connection = intCount
End Function

intConn = Test_Connection

if (intConn > 0) then
	Session.Property("TEST_CONNECTION") = "Yes"
end if
Once again, any help would be greatly appreciated.

Chris
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Chris,

I'm afraid that I'm not a VBScript expert either. My suggestion is to try the script (using a constant text as input) from Windows Explorer to see if it works. Also you can take look at the log file to see what error you get (use "Run and log" main menu option).

How exactly you schedule the custom action? Also make sure you have the "Function Name" field empty for the custom action.

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”