cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fmshafiq
Level 3

BASIC MSI project : SQL Authentication error in Silent Mode

In my installer i am saving all user inputs in to an encrypted registry key including SQL credentials that user provided when user installing product first time.
Therefore, when user installing a major upgrade version for this product my installer get saved user inputs from registry and fill all installer property respectively along with SQL credentials with a custom action that I write in VBScript.

I have created a system search the read a specific registry key value and store values in a Property "REG_DATA"

Then I have wrote a Custom Action in VB Script that read Property "REG_DATA", Decrypt it and split it into array and then store values into respective Properties. See this,


preserveParam = Session.Property("REG_DATA")

preserveParam = Decrypt(preserveParam)

'MsgBox preserveParam

PropArray = Split(preserveParam, "|")

server = PropArray(0)
auth = PropArray(1)
user = PropArray(2)
pass = PropArray(3)

If (Len(server)>0) Then
Session.Property("IS_SQLSERVER_SERVER") = server
End if
If (Len(auth)>0) Then
Session.Property("IS_SQLSERVER_AUTHENTICATION") = auth
End if
If (Len(user)>0) Then
Session.Property("IS_SQLSERVER_USERNAME") = user
End if
If (Len( pass)>0) Then
Session.Property("IS_SQLSERVER_PASSWORD") = pass
End if

This is working fine when i am running application without silent mode but i am getting following error when i am running setup in Silent Mode




1: Attempting to establish the SQL connection... Server: , Database: Test1DB
1: ADO Error: Number: -2147467259 Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Source: Microsoft OLE DB Provider for SQL Server SQL State: 08001 Native Error: 17
MSI (s) (58!78) [14:36:29:104]: Product: VIDIZMO -- Error 27502. Could not connect to Microsoft SQL Server ''. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (17)

MSI (c) (D0:C8) [14:36:10:139]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 27502. Could not connect to Microsoft SQL Server ''. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (17)
CustomAction ISSQLServerInstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)





I am running my installer in Silent Mode using command

setup.exe /s /v"/l*v \"C:\setup\4.5.5.1\setup.log\" /qb"
Labels (1)
0 Kudos
(4) Replies
hidenori
Level 17

Please make sure that the custom action that sets the SQL login credentials is sequenced in the InstallExecuteSequence table. Custom actions in the InstallUISequence table are not executed in silent installations.
0 Kudos
fmshafiq
Level 3

Yes custom action is sequenced in the InstallExecuteSequence table. even I placed a vbscript custom action just before ISSQLServerInstall in InstallExecutionSequence that popup alerts to check that values stored into properties (see custom action script bellow), which is showing correct values stored into desired properties but I am facing same issue and getting error "Error 27502. Could not connect to Microsoft SQL Server ''. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (17)"



MsgBox "IS_SQLSERVER_SERVER :" & Session.Property("IS_SQLSERVER_SERVER")

MsgBox "IS_SQLSERVER_AUTHENTICATION :" & Session.Property("IS_SQLSERVER_AUTHENTICATION")

MsgBox "IS_SQLSERVER_USERNAME :" & Session.Property("IS_SQLSERVER_USERNAME")

MsgBox "IS_SQLSERVER_PASSWORD :" &Session.Property("IS_SQLSERVER_PASSWORD")
0 Kudos
hidenori
Level 17

Your custom action must be sequenced before the ISSQLServerCosting action where extracts operations to a temporary file for SQL scripts.
0 Kudos
fmshafiq
Level 3

Thanks this issue has been resolved
0 Kudos