简体   繁体   中英

Detecting and installing SQL Server Express with UWP app

I have written an UWP app for managing employees, timesheets etc.

How do I detect if SQL Server Express is installed and if not installed how do I setup SQL Server Express on the client computer? Is it possible to do it without running the exe file in 'fulltrust'?

I would also like to include the setup files in my app package with the configuration file to run a silent install on the client computer.

I have looked for a answer on many pages but could not find a real straight forward answer.

Some help here would be much appreciated.

when you have access to your client computer, you can run a check program in your setup process via checking if MS SQL Server Express registry key exists or not. If it exists, then it is installed.

Read this doc from Microsoft, there is a code snippet in the doc you can use:

https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/express-administrator/bb264562(v=sql.90)?redirectedfrom=MSDN

What do you mean by 'auto-detect' MS SQL Server Express installed'? Not sure what's your use case here.

Normally, you can not auto detect database to use since in many cases there could be multiple databases installed in the environment, and you don't know which one is the right one you are going to use. You have to know which database you are going to use first.

However, if you insist to detect database, you can do the port scan in your network which is really not a good idea.

So guess maybe your use case is unique.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM