Install Sql Server Express Conditionally during Window Application setup process - installation

I have 2 queries..
Can I include one of my own interfaces, not the custom dialog the setup project provides, in the setup project? The interface will help user to choose an option for installing Sql Server Express during setup or not.
If the user select to install it, what are the steps do I need to follow

See Embedding SQL Server Express into Custom Applications.
Run setup.exe of Express with a Templete.ini parameter, from within your application installer. This ini file is easily created by first running the installer of Express separately, but cancel at the last step. That step mentions the location and name of the ini file.

Related

Run a condition check after user selects installation folder

I have created a winforms app and a setup and deployment project for that app (VS 2010).
All I need is this:
When a user runs the msi, right after he selects the installation folder I want to check if the main executable of the application already exists in that folder. In that case I want to break the installation and prompt the user to either uninstall the existing application or choose a different folder.
I would like, if possible, to not use any custom installer action. At first, a launch condition (with a file search) seemed to be the right way, but it seems launch conditions (since they are 'launch') run at the beginning of the msi execution and not after folder picking.
Visual Studio Setup and Deployment Projects don't support this type of authoring. It's one of the many reasons that Microsoft removed that project type from Visual Studio 2012.
The only way to do it using this tool would be to build an MSI and then use ORCA to create a transform authoring the validation custom action and scheduling it into the UI as a gating control event. You could then write a postbuild script to apply the transform to the MSI every time it gets built.
Very advanced stuff and frankly not worth the effort. It would be far more beneficial to switch to a tool that supports doing this such as Windows Installer XML (FOSS) or InstallShield 2012 Professional. ($$)

Creating a standalone .exe for a windows application in visual studio 2008?

I have created a windows based application in C# using visual studio 2008 which basically scans for the registry and then fixes the resulting errors. Now using the msi installer i have made a setup and it works fine. However i have met with a new requirement.
Usually after providing the setup to the user/client has to install the setup and when installed, in the installed folder there are lots of .dlls that i had used to create the project. But my requirememt is to create a single standalone .exe using which i wouldnt have to provide my users with the setup file. All i need to do is that using this single .exe file my whole project should execute and perform the same process of scanning and fixing the registry.
I also tried "ClickOnce Deployment in .NET Framework 2.0" and got the error "ClickOnce does not support the request execution level 'requireAdministrator'". and also have gone through the link
"ClickOnce does not support the request execution level 'requireAdministrator.'"
But still i feel that i would be comfortable if i can get a single standalone exe which can execute my windows forms application.
Is there any way to do it?
Any hint with this thing will be really helpful to me.
Thanks in advance
~Viknesh

Install sql server express database engine only

I am deploying a wpf application that requires sql server 2008 as a prerequisite. As a result I am embedding the sql server installer in my application. When that launches the SQL Server Installation window shows up:
I don't want the user to have to go through out this installation. That program will install SQL Express and many other things like SQL Management Studio.
Is there a place where I can download SQL Express 2008 the database engine only? so that the user will just have to click next, Agree, Ok... etc... without having to make complicated decisions. Or maybe is it possible to install sql server express throughout the command line?
I am including the installer in my application because my application is supposed to be able to be installed without having an interenet connection. Also I cannto seem to find a place where I can download SQL Server express the database engine only.
Go here and download the appropriate version of SQL Express. Then see the How to: Install SQL Server 2008 R2 Using a Configuration File article on MSDN. Note that after you generate the config file for the installation, changing the following keys in the config will probably be of particular interest to you:
; Setup will not display any user interface.
QUIET="False"
; Setup will display progress only without any user interaction.
QUIETSIMPLE="True"
; Automatically accept the license terms
IAcceptSQLServerLicenseTerms="True"

Customize deploy scripts for Visual Studio 2010 Database project

The deployment scripts generated by a visual Studio 2010 Database project won't work for me. I need to include them in an MSI that will be shipped to many different customers to both upgrade and create new databases.
Looking through the Microsoft.Data.Schema... namespaces I see many possibilities for customizing the generation of the deployment scripts, DeploymentScriptGenerator, ExtensionManager etc. etc. It really looks like it was designed to be extensible and to support any database.
What I can't find is any sort of "getting started" documentation or samples. Has anyone done something like this?
Visual Studio Data Projects use two phases of deployment.
The deployment files created by building the database project is really just a package of metadata that describes the desired final state of of the database, but with no knowledge of where is going to be deployed or whether it is a new database or existing database.
The second part is actually executing the deployment package against a specific database, either existing or new. To do that, Visual Studio has to run a diff against the database and the deployment package, and determine which changes need to be applied, and generate the script necessary to apply those changes.
So the problem you have is that if you include the first part in your MSI, you need something running on the end user's machine to apply those changes to an unknown number of unknown databases out in the field, and you can't really ship them Visual Studio.
Luckily MS includes a command line too (VSDBCMD.exe) which allows you to take that single deployment package and use it to apply changes to any database. This tool will do the same diff as Visual Studio and generate the SQL script necessary to create/upgrade that database (any actually run the script, if you so choose, based on command line parmaeters). See http://msdn.microsoft.com/en-us/library/dd193283.aspx for information about how to call it from the command line.
So I'd saw you ship that command line tool with your application (just make sure to double check the redistribution license to make sure this is OK) and have a custom action in your MSI (or some other utility) that executes it to apply the database changes. And also check the dependencies for the command line tool, I know it requires the SQL SMO objects, SQL Native Client, and probably a few other things. You'll want to make sure you MSI includes those as prerequisites.

Deploying and setting up SQL Express 2008

Looking into installing an instance of SQL Express for an app. I want to have a separate installer. (I need to run some Transact-SQL stuff afterwards)
I've been referencing this article.
It is recommended that you ship the Express package extracted on your media and then launch Setup.exe directly. To extract the Express package, run the following command.
So far I tried bundling the unpackaged SQL Setup in an MSI (using a Setup and Deployment project). The user installs, which just puts the extracted files in a folder, then in OnAfterInstall I'm the setup process. This doesn't work since SQL's Setup.exe runs some .msi files.
Was able to make my own executable to bootstrap the installation and use FreeExtractor to create a self-extracting zip of the setup and my bootstrapper and then run my executable at the end.

Resources