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.
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
So I just performed the coup de gras on my project by accidentally clicking on Exclude From Project instead of Add on my controllers folder.
When trying to add a folder named Controllers I get the error "this folder exists". However, If I try to click on the project -> Add Existing... I cannot select a folder, but only the controllers.
Kind of at a loss here, has anyone had experience with this, or does anyone know how to get the folders back into the solution?
Click on the Show All Files icon in the solution explorer and then simply include the folder:
Visual Studio Express 2012
Select Your Project Folder Click On "Show All Files" icon to show all Excluded Folders And Files
Then Right Click on Excluded Folder or File and Click on "Include In Project"
In my ASP.Net Webforms project after excluding the file I could't find it even under 'Show all files', but they were at project folder so I had to right click on project in Visula Studio then add existing item.
For anyone wanting a different solution, you can also browse to your project in a File Explorer and delete the offending folder (Be sure to copy it somewhere safe first!). Restart Visual Studio and proceed to add the folder as you regularly would.
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 an existing directory structure that is all nicely checked into SVN, so I don't really want to mess with it.
The website code lives in a folder called C:\Projects\TheProject\Website. I want to bring the website files into a new Web Application Project without changing the directory structure.
Ideally the resulting file structure would look like this:
C:\Projects\TheProject\TheProject.sln
C:\Projects\TheProjects\Website\Website.csproj
No matter what I try I dont get what I want. There is no option to create a web application from existing code. This is very frustrating. Does anyone know if it is possible?
OK I figured it out. It's weird, but the following steps will work:
Open fresh copy of Visual Studio
File->New Project, select Web Application
Use the following settings:
Name: Website (this is the name of the existing folder with the website files in it)
Location: C:\Temp\ (anywhere will do for now)
Solution Name: TheProject (name of the existing project's root folder)
Check "Create directory for solution"
Delete the auto-created Default, Global and Web.config files
Save All and close Visual Studio
In Windows Explorer, copy the new folder on top of the existing folder so that the files are merged.
Double click on the sln file to open Visual Studio again.
Select "Show all files" (at the top of Solution Explorer)
Right click on any files or folders you want to add and select Include in Project.
Have you tried something like this?
Create a new Visual Studio Blank Solution from File-->New Project-->Other Project Types-->Blank Solution, making sure to specify c:\Projects\TheProject as your solution directory.
Copy the folder with all of the existing website stuff into c:\Projects\TheProject\WebSite.
Back in Visual Studio, right-click your solution in Solution Explorer and select "Add Existing Website." Then, pick your c:\Projects\TheProject\WebSite folder.
Good luck, HTH.
Create a new web project with a .csproj file. Delete all the files it comes with. Drag everything into the project.
In the File menu, click Open, and then click Web Site. Choose the root folder where your Web Site is located
On top of #cbp answer I would like to add that if you would like to keep the Version control history of those files - in step 6 - instead of copy do:
git mv original-website/* new-web-application-directory/.
What have you tried? I normally create a blank solution and add existing folders (drag and drop on solution explorer works best), and have not had a problem.
in VS 2008 File->New->Project From Existing Code