I want to create setup file for my project with all prerequisites like framework,sqlserver and .log file/db script.
I want to run DB script during the installation of my setup. On single click i want to install all this .
In your Project solution Right click
Add-> New Project-> Other Project Types-> Setup and Deployment Project -> Visual Studio Installer -> Setup project.
Then Name your setup Project. Right click on setup project Add-> primary Output and select your project displayed.
Again Right Click the setup project and select View-> File System -> Application Folder. Now copy what you want to be in installation folder.
Here is the example tutorial for creation of setup file.
To run your DBscript on installation you should assign Custom Actions. View-> Custom Actions.
Here is the step by step tutorial for opening the web page after installation. In the same way you can assign your own custom action during installation, Roll back, commit and uninstall.
Here is the example tutorial for creation of setup file: http://dataerror.blogspot.com.br/2010/06/creating-web-setup-project-for-aspnet.html
Related
I ran into some troubles when creating an installer for my Visual Studio 2010 solution (which has multiple projects) so I thought I'd make a quick guide to how I got it working...
Here is how I did it:
Create a new Visual Studio Installer project which is located under
Installed Templates/Other Project Types/Setup and Deployment/Visual Studio Installer.
Make sure you add it to you current solution, you can do this by right clicking on the solution name in the solution explorer and clicking Add>New Project
From there select Setup Wizard, give it a name and click OK
A wizard will open, click Next
then select Create a setup for a Windows application
then click Next again. Select all of the groups you want to include, namely: Content Files, Source Files, Primary Output
Then click Finish
In the solution explorer you will see a bunch of buttons find the one that's tool tip says File System Editor and click it. You will see three folders in the file system editor, the only one we really care about is the Application Folder. That folder is where your projects build output should be.
To add files to it if they are not already there right click > Add > File...
Note: You cannot add entire folders (which sucks) and the folder structure in the Application Folder should be identical to that in your projects build.
You should create each folder and then add the files to it.
If you have multiple projects you should set the build directory to the same folder under the release build settings. To do this, open your solution, and for each project, right click/Properties go to the Compile tab, set it's configuration to Releaseand its Build output path to some folder (same for each project) (If you have an XNA project make sure its Content Build/Configuration is also set to Release).
Now select Release from the drop down menu on the tool bar (it most likely says Debug now)
Right click on your solution on the solution explorer and click Build Solution
Now all of your solutions built files will appear in the folder you chose in the compile tab. All of these files are what needs to be added to the Setup Projects Application Folder (in the same structure)
Customise the installer: click on the project name in the solution explorer and look through it's properties, change what you want (i.e Author, Manufacturer, Title - these make a difference to the installers output directory and text)
Build the installer project (same way as mentioned above) and you are done.
Feel free to comment with questions
I am trying to create a installer project, so that when it installs, I want the installer to create a folder called "App_Data" in the installation folder. Basically, this is a winforms application and I have log4net configured to write the logs in this folder called "App_Data" in the executing assembly's parent folder. I have tried options like Installation Project --> File System --> Create Custom Folder as some people advice but when I run the installation I don't see the folder created on the Install location. Has anybody faced a requirement like this?
Thanks,
Venky
If your installation project is of type InstallShield, try this:
Go to the Project Assistant file under your project in solution explorer
Then, click in Application Files
After that, click in "Add folders" button at right bottom of screen
and select your folder.
You must create the folder that you need in your pc, and then select it from "Add folders" button.
If you want some files inside this folder, put it before add the folder in project.
Hope helps.
I have created a Windows setup file for my Windows project in Visual Studio 2010. This setup file is running properly and installed the software in the computer. But for running this software I need another exe file to run. I want to add this external exe file into my setup project so that when my software will install the other software will be installed too.
If you just want to add another file that will be deployed on the target machine when installing you can go to your project, File Setup tab, right click on the folder that you want to add the file to (eg. Application Folder), in the context menu click Add - File and browse to the file that you want to add. It can be any external file from your computer.
That file will get installed along with your application.
Edit - To get to the File Setup tab right click on your project in the solution explorer and select View - File System.
Edit 2 - In order to add a custom prerequisite to your setup project have a look at this question.
I presume you're using a "Setup Project" (vs. InstallShield, for example).
It sounds like you want a "custom action":
http://msdn.microsoft.com/en-us/library/bbd7cck3.aspx
http://www.simple-talk.com/dotnet/visual-studio/visual-studio-setup---projects-and-custom-actions/
<= Look for "calling an executable as a custom action"
In VS2010, I had 3 Projects outputting 2 DLLs & 1 EXE, and a 4th Project as Setup Project. To add the DLLs & EXE in setup.exe file, this is how I did it,
Right Click on your Setup Project,
Right Click->View->File System->Application Folder
In the Application Folder pane, Right Click->Add->Project Output
Select the required project from the drop down Project list and select "Primary Output".
That should be it.
I am creating an MSI from inside visual studio 2008.
This is what I am doing:
(With the project I am creating this for open in Visual Studio) right click Add new project
Setup and Deployment > Setup Project
Give it a name
Right click Application Folder > Add > Project Output: Primary Output
Question: does this contain all I need to run the project?
I want to create the .msi to put a shortcut to it on the Users desktop, so
Create shortcut to Primary output from Project
Move this to the users desktop folder
Question: how do I get this to keep the icon from the project!! conveniently doing this seems to have lost the app icon and picked some random generic one instead.
Thanks,
edit 0: Oh and also, can I set so when running the .msi the user cannot change where it is installed to?
Nobody knows how to do this?
It should unless you are referencing mixed mode assemblies in which case you may have to manually add files to the installer as the dependency resolution is very poor in this case.
You need to set the icon manually in the properties of the setup project.
To Remove the option to select the installation folder try opening the user interface view of the project and deleting the 'Installation Folder' screen.
I have a Visual Studio 2008 Setup Project that when compiled in the past would generate a Setup.exe in the output directory along with the .msi output file. Now it no longer generates the Setup.exe which I actually do need.
Did I change a project setting without realizing? How do I get it to generate it again?
Try opening project properties, click Prerequisites button there and check "Create setup program to install prerequisite components".
This is for Visual Studio 2005, not sure if it works for Visual Studio 2008.
1, Go to file menu > click Add > new project >now “Add New Project” Dialog appear.
2.Select “Other Project Types” and click “Setup and Deployment” projects,Choose “Setup Project”give name project name in name text box finally click OK.
3.New project appear in solution explorer,for example you give the name “MyEXE”..it will display with this name.
4.right click the MyEXE > go View > click “File System”
5.You can see the “File System on TargetMachine”under three folders
Application Folder
User’s Desktop
User’s Program Menu
6.Select Application Folder and right click Add>Project Output>select Primary output
select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE
next >>
same procedure follows the user’s program menu also
8.If you want to change the Manufactures name for exe,just right click the project go to properties
change the properties as per you requirement
9.Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)
EXE available # this location
When you want to install the EXE on the client machine,you should be installed .NET Framework on that mc because,Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs.