Creating msi in vs08 - few questions - visual-studio

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.

Related

Create msi installer using visual studio installer

I tried to create a MSI installer for a simple windows project with basic set up. When I ran the built msi file it is not installing anything in the target location neither creating a desktop icon. Though I can find an entry in control panel. I am using VS 2013, not able to understand why it is not creating anything.
Thanks for help.
You should say what you actually did. It won't install anything to the target system unless you put files (or project output) in the Application Folder in the setup project, and it won't create a desktop shortcut unless you right-click the executable in the Application Folder view, create shortcut, then drag and drop the shortcut to the Desktop folder, again this is in the setup project's File System view.
Start here, old but still they way they work:
https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/

Creating an installer for Visual Studio 2010 solutions (one or more projects)

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

Add another exe file in my setup file in Visual Studio

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.

Visual Studio: How to protect file from removal on uninstall

Folks,
I am creating an installer project in Visual Studio. This is done using a project of type "Setup and Deployment".
I lay out the file structure of my final install in the "File System" View of the project.
Now, some of the files I create as part of my install are updated while my application is used. I would like these files to not be removed during an uninstall of my application. Is there any way in Visual Studio to designate a file as "protected from uninstall"?
Thanks for your help.
In the Solution Explorer window, in the Setup project, click the file. Then in the Properties window, set the Permanent property to True.
I'm not sure how to do it in the installer, but any file that you create from the application will be preserved in the event of an uninstall.
If you can stand it, maybe you could create these files as a first-time initialization in your application.
Of course, this can lead to other problems (permissions to create a file), but it might be easier than fighting with the cryptic installer setup.

Visual Studio 2008 Setup Project is not generating Setup.exe anymore

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.

Resources