Hi,
in a .NET 4.5 Application I can check / install SQLExpress 2008 R2 with AI.
But my situation is a bit more complex and I don't know how to solve it.
First - nothing is installed - SQLExpress gets installed and I can use my (contained in XXX.exe.config) connection string ...connectionString="Data Source=.\sqlexpress;Initial Catalog...
Second - SQLExpress "older" is installed - so 2008 R2 gets installed with a different instance name so I have to change my XXX.exe.config to something like connectionString="Data Source=.\sqlexpr2;Initial Catalog
Third SQLExpress 2012 is installed -- can I change the Prerequisites form SQLExpress 2008 R2 to "SQLExpress => 2008 R2"?
What if the customer has installed a 2008 R2 Desktop edition (I guess this doesn't solve the SQLExpress ... prerequisite)?
Last not least (maybe needed) I can think of a situation where the customer has access to a "real SQL sever" either somewhere in the corporate network...
So my "idea" -- check for SQL Server 2008 R2 or larger native client.
If not found - install SQLExpress 2008 R2.
Else ask the user If he has access to a central server.
--If this is so - goto Step "Server select".
--else check for SQLExpress 2008 R2 and install if needed.
After this -
Server select - provide the SQL Native Client Server select and get the server / instance name from it.
--This must be run "as logged on user" to enable trusted connections.
Change the information in XXX.exe.config if needed.
A "simplier" way would also be OK - (no central server)
Install SQLExpress 2008 R2 if needed - where needed means - no desktop / express edition of SQL Server 2008 R" or newer.
Obtain the correct instance / server name and change XXX.exe.config if needed.
Can this be done with AI?
Manfred
FOLLOW US
Get the latest news in Application Packaging