altis10
Level 3

SQL Server name change issue

HI, I'm working with Install Shield 2013 basic msi project and I hit a problem for which couldn't find a solution yet.
My problem is that I have an installer which runs an SQL script let's say "Install.sql" when installing and another SQL script "UnInstall.sql" when un-installing the application.
All worked ok until some client changed the SQL Server name after installing our application. At this point when we tried to upgrade the application with a major upgrade an error "Error 27502.Could not connect to Microsoft SQL Server 'YYYYYY\SQLEXPRESS'. [DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found. (6)".

To thoroughly explain what happened I should add the below info:
- the application stores in registries all the information related to the SQL Server connection string (IS_SQLSERVER_SERVER, ... , etc) so when upgrading the SQLLogin dialog would not be displayed and the SQL related properties are read from those registries.
- when the client changed the SQL Serve name he changed also the SQL Server name from those registries so the registry information would be correct.

The problem appear when the installer is trying to run the ISSQLServerUninstall (deferred CA) where it is trying to use the initial SQLServer name, which it is retrieved by the "ISSQLServerInitialize" CA.
I read some more about and I think I've found a solution to this by using the IS_SQLSERVER_DO_NOT_USE_REG property set to 1 to not use for SQL operations the SQL registry information but the information delivered in SQLLogin dialog. Since, as I told you, I've hidden the SQLLogin dialog I wrote some CA's to set all the properties (IS_SQLSERVER_SERVER, etc) from SQLLogin dialog with the correct information stored by my application in registries on the fresh install time.
Apparently the properties are set correctly until the "ISSQLServerInitialize" CA from the "Execute" section is executed and the "IS_SQLSERVER_SERVER" property value is changed to old SQL Server name.

So, can anyone help understand why IS_SQLSERVER_DO_NOT_USE_REG property is not working as expected? Or I was doing some other error?
Labels (1)
0 Kudos
3 Replies
DLee65
Level 13

I do not know if this will help you or not, but why not detect the instance name in the registry to see if it exists? If the 'normative' name is present then set a Property like DEFAULTDBFOUND. Then set a condition on the component that handles the sql scripts you have now. Hopefully they are self-contained within their own component.

Also detect for a different instance name, as long as that list is limited, then you should be able set properties and setup additional sql scripts to handle the alternate scenario.

As an aside, I am surprised that your application would work with a non-default sql instance name. That can only lead to problems if a client tries to setup a system using a full version of SQL server.

Hopefully this puts you on the path for resolving the issue.
0 Kudos
hidenori
Level 17

Essentially, the IS_SQLSERVER_DO_NOT_USE_REG property needs to be set for the old installation that removes your existing product. However, major upgrades do not have the ability to pass a property to product removal in the RemoveExistingProducts action. You might want to consider uninstalling the old product manually from command line.

Setup.exe /v"IS_SQLSERVER_DO_NOT_USE_REG=1"

Hope that helps.
0 Kudos
altis10
Level 3

DLee65 wrote:
I do not know if this will help you or not, but why not detect the instance name in the registry to see if it exists? If the 'normative' name is present then set a Property like DEFAULTDBFOUND. Then set a condition on the component that handles the sql scripts you have now. Hopefully they are self-contained within their own component.

Also detect for a different instance name, as long as that list is limited, then you should be able set properties and setup additional sql scripts to handle the alternate scenario.

As an aside, I am surprised that your application would work with a non-default sql instance name. That can only lead to problems if a client tries to setup a system using a full version of SQL server.

Hopefully this puts you on the path for resolving the issue.



I checked this already but this is not the case because we have an utility which changes all that name occurrences in the registries.
However the Install Shield SQL stores the SQL Server name in some hidden or encrypted registry which is not being accessible directly.
Thank you anyway.
0 Kudos