How to make software developed in WinForms .NET 3.5 with SQL Express portable
i found that its really pain to create setup and deployment packages for windows xp/vista/7 so my question is can i make my application portable with any third party tool such as thin app ?
my application requires dot net 3.5 framework and sql express 05 installed i want to put it on usb drive and user can execute it directly from usb drive without any setup and deploymen开发者_运维知识库t, if there any other ways to achieve portability for software please let me know?
thanks !
In order to check if .Net 3.5 and sql express is installed you can check if they are registred in the registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion - CurrentVersion
But you cannot check this with your 3.5 compiled assembly, so you need a non-dotnet application to do it, like a setup program.
Either you have to create a launcher in something like c++, or you could create a vb script launcher which checks the prerequisites before launching your .net app.
Neither SQL Express nor the .NET Framework will not run without being installed on the local hard disk.
Source for SQL Express: http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/fc729d31-8a0b-4156-ab75-4fec652a438b.
@Mikael already told the trick for .NET detection which you should take a look at.
I just want to add that for portable applications, you should use SQL Server Compact edition instead of Express,
Link
精彩评论