Visual Studio Publish Project into One Simple Installer

Visual Studio Publish Project Into One Simple Installer


The Ancients: If the below is TL;DR (too long, didn't read), please skim these two links:

  • Troubleshooting Setup and Deployment Projects
  • Why use Windows Installer XML (WiX) over VDPROJ?

UPDATE: September 2018 - Since this "answer" was recently downvoted, let me try to add some more links to see if the intent of
the answer can be made more clear. Not to be overly dramatic, but:

As deployment specialists we have to warn people when they commit to using a tool that is bound to fall apart for them down the line when more advanced deployment requirements invariably surface.

The installer projects have several times been pulled back and then
re-introduced in Visual Studio. Always based on the problems seen
with these project types (just the bigger ones):

1) No MSBuild support (not tested extensively by me, but by others), 2) only deferred mode custom actions running in system context (not insertable in GUI), 3) highly limited control overall (always advertised shortcuts, no ability to configure certain things, etc...), 4) no support for proper service installation - requires custom actions instead, 5) very few available prerequisites to bundle, 6) rudimentary GUI with little flexibility, 7) appears to not be possible to define MSI features (as in features and components), 8) problems with 32 / 64 bitness issues for custom actions, etc...

An old MSDN page on this project types and its problems: Troubleshooting Setup and Deployment Projects.

MSI Expert Chris Painter and others:

  • Are Visual Studio Setup projects suitable for complex setups?
  • Why use Windows Installer XML (WiX) over VDPROJ? (recommended)

In my opinion the project type can only work for simple.NET applications. Any complexity of caliber and you are in trouble. SQL Scripts, IIS, proper COM / COM+, Users & Groups, Shares, Firewall Rules, Custom GUI, etc... Commercial tools and WiX have advanced support for these things. The internals of the compiled MSI files are also sub-standard (use of self-registration, custom actions for services, etc...). I often experience that the tool stops working for "some unknown reason" as well. Suddenly it won't compile. Concrete Example (with fix).

Alternatives:

  • Simple List View of Deployment Tools
  • WiX Quick-Start Hints (if the tool needs to be free)

  • How to create windows installer
    (links to all kinds of deployment tools, summary of MSI advantages and
    some brief descriptions of trending deployment technologies)


The open source WiX toolkit features a component called
Burn to create such setup.exe launchers / downloaders
/ bootstrappers - used to run several installations in sequence and /
or install prerequisites (a very common task - Visual Studio projects
only support a few prerequisites).

Writing WiX XML markup code is necessary to use this Burn feature.
Commercial tools Installshield and Advanced Installer
provide GUI-features to build such setup.exe files.


The Visual Studio installer is very limited, I never use it. WiX (link to an answer trying to provide some links for a WiX crash course) is a full blown, open source deployment solution. It will take you a while to master, but it is very good and flexible. A commercial solution such as Installshield or Advanced Installer will allow you to deliver a setup faster and easier, but they can be very pricey.

Given the limitations of Visual Studio Installer projects (and bugs), I do believe the right solution is to use a different tool:
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc. If you need anything advanced at all, you will struggle otherwise. With a more advanced tool it is at least possible to do what you need, even if it might be more involved at times.

Let me know what you want to know about such a process, and I will try to help. I am not sure what software you are delivering, what the target user group is, what budget you have, etc... Windows Installer is highly desirable for a number of corporate benefits, but other deployment technologies exist (see the description above of various tools to use).

How to publish/deploy visual studio project as an installer

First of all install this.left

https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9

Once you have this installed,

go to Solution Explorer and right click "Solution "YOUR PROGRAMS NAME" go down to "Add" and select "New Project" on the right hand side scroll down to "Other Project Type" and expend it and click on "Visual Studio Installer" and select "Setup Project" and Name your setup exe.

A new window will pop up. On the left hand side you will see "Application Folder" Right click on it and select "Add" > "Project output" and click on "Primary Output" and press "ok"

Once you have done that, on the right hand side you should see two or more files, right click on the one that should say "Primary output From "YOUR PROGRAMS NAME" and select "create Shortcut - "YOUR PROGRAMS NAME"

Once that is done, rename your shortcut to your programs name. eg "my first program" after that click and drag it to "Users Desktop Folder on the left hand side.

Then right click "User's Program Menu" and add a Folder and name it to your programs company name "eg Microsoft" this will make a folder in the start menu.

After that select the folder you have just renamed and right click on the right hand side and select "Create new Shortcut" a window will pop up for you, select the "Application Folder" and then "Primary output from YOUR PROGRAMS NAME" and press "ok"

Once all of this is done close out of it and go to "Solution Explorer" and press F4, here you will have the options to add details about your program eg who it is and even an icon.

I may have missed somethings, but after reading this you will have a basic idea of what is required and you will be able to add your own things.

Also i cant remember but you might have to also add your programs Icon to the "Application Folder"

once you have done everything, open "solution explorer" and right click on the new project you have created and press "build" you will be able to find the files where you main project is located.

Good Luck!

How do I turn my release project into an installer in Visual Studio 2019 Community Edition?

The best way is to create a setup package, it can be an MSI, EXE or MSIX. You can do this directly from Visual Studio, without using any third party software.

You can create an MSI or EXE using Microsoft's Installer Project template. This is recommended if you are targeting users running on olders OSes like Windows 7/8, etc... or if your application has deep system integrations, like services, shell menu extensions, etc... or it simply needs to be installed per machine (for all users)

If you are targeting only Windows 10 users (1709 or newer) and your application dos not require administrative APIs (resources like services, shell, etcc or sharing files with other applications) you could use Microsoft's support to build MSIX packages.

Deploying and updating and MSIX is much simpler both for you and for the end-users, but it comes with some limitations, as mentioned above, for security reasons.

Also, MSIX requires all setup packages to be digitally signed. You can use a code signing certificate purchased from a certified vendor or your can generate your own certificate (but this needs to be accepted by the end-user machines, so you need a way to deploy this certificate to their machines before giving them the MSIX. If you are inside an enterprise network, this can be easily done, for home users is not recommended).

If you are interested in MSIX, let me know and I can give you more details about digital signing or other questions you might have.

Visual Studio publish as EXE or MSI installer

(I'm not a fan of it either...)

Just go to New Project -> Other Project Types -> Setup and Deployment -> Visual Studio Installer.

You might also like the Windows Installer XML (WiX) Toolset.

Has anyone conquered the Visual Studio installer project in VS2019?

For all the people finding this in the future, here's the final word:

The build project can be inconsistent, this is well documented all over the internet as I have above. You're not doing anything wrong - it is just inconsistent.

Stop trying to solve it if it's affecting your project and move on (I've had a dozen projects before this one work just fine). The consensus seems to be to use WiX, but I'm not here to discuss the alternatives. Personally I am going to embark on the WiX learning curve though.

Create Visual Studio Setup Project using self-contained deployment mode for .NET 5

Finally figured it out. The mistake I made was using the wrong path (the "Target location" from the publishing profile):

target location

So the correct way to do this is as follows:

  1. Create a publish profile which is automatically named like this:
    FolderProfile.pubxml

  2. Make the following entry in "PublishProfilePath" (don't forget to prepend "Properties\PublishProfiles"):
    PublishProfilePath entry

Then it is possible to build a self-contained installer.

How to publish an application in Visual Studio?

build the exec program, make sure you include all the needed libraries.
Then you can use installcreator and create simple setup program.

How to deploy multiple projects in a single MSI?

I think you probably want merge modules. Accrding to MSDN:

A merge module is a standard feature of Microsoft Windows Installer that packages components together with any related files, resources, registry entries, and setup logic. You can use merge modules to install components that multiple applications share. You cannot install merge modules directly. You must merge them into deployment projects.

http://support.microsoft.com/kb/827025

In your case, each application would be a merge module and you would need to provide some UI to select which applications you would like to install. You could modify one of the default page templates to do that.



Related Topics



Leave a reply



Submit