2

I would like to know if there is any possibility to convert an asp.net mvc 5 web application into an .exe setup file. I tried various links. But i didn't get any output. I received a .msi file and when i tried installing, the installation stops right at the beginning displaying a message = "installation stopped. Please try again". or if i try to install the setup file i get a message = "Invalid.. Please check if package exists...bla bla bla"

Some of the links that i tried are listed below.

https://www.c-sharpcorner.com/article/step-by-step-guide-to-create-a-setup-for-a-web-application/

https://weblogs.asp.net/scottgu/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005

https://www.c-sharpcorner.com/article/creating-setup-and-deployment-projects-in-vs-net/

https://www.codeproject.com/Questions/297343/How-to-create-exe-or-msi-file-setup-file-of-web-ap

And Much More...

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
Thameem
  • 700
  • 1
  • 13
  • 38
  • This may help.. Not sure if its still valid though. https://stackoverflow.com/questions/7229007/compiling-an-asp-net-website-into-an-executable-with-server – Steve Jun 27 '19 at 10:52
  • Thank you mate. I'll get back here after trying out your link. – Thameem Jun 27 '19 at 11:15
  • I just can't do anything. I am wondering whether is it possible to create an exe of web app rather we could create one for windows... these links tell me that the thing i am looking for cannot be done. Link 1 - https://stackoverflow.com/questions/26902184/how-to-create-exe-of-a-web-application-in-asp-net Link - 2 - https://stackoverflow.com/questions/7229007/compiling-an-asp-net-website-into-an-executable-with-server – Thameem Jun 27 '19 at 13:30
  • 1
    You first need to install [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects) extension. – Reza Aghaei Aug 14 '19 at 06:43
  • @RezaAghaei yes . Thankyou so much. I didnt know that there was a feature like this in vs till today. But now i know – Thameem Aug 14 '19 at 06:49
  • A better option is creating web deploy packages and then install the package to IIS. – Reza Aghaei Aug 14 '19 at 07:35
  • is it possible to run a webapp like a complete exe (virtual - which behind the scenes instantly communicates with the iis to interpret the c# code etc..) cuz i have seen this product doing the same thing for php applications named exeoutput. link => https://www.exeoutput.com/ – Thameem Aug 14 '19 at 07:42
  • I've been researching for a solution for this or that i could atleast try to find a solution if exists ! Recently i tried writing my own winforms program to programmatically communicate with the iis server for creating app pools, websites and starting(connecting) the websites and starting them. But always failed in one error which told me that access was denied insufficient permission where i was trying to access the iis\w3wpexe.. something like that which i dont remember right now.. ANY IDEAS..Much appreciated.. – Thameem Aug 14 '19 at 07:48
  • [For converting your asp.net web application to exe using cefsharp and a little c# code](https://stackoverflow.com/a/59113401/9048996) – Thameem Nov 30 '19 at 10:28

2 Answers2

2

You first need to do some preparation:

  1. Set up IIS 6 Management Compatibility (To prevent those "Installation stopped" errors)
  2. Install Microsoft Visual Studio Installer Projects extension. (To add setup project template to VS)

Then you can create and configure and setup project and run the setup.

Details

1 - Set up IIS 6 Management Compatibility

Open Turn Windows features on or offInternet Information ServiceWeb Management Tool and check at least the following items:

  • IIS 6 WMI Compatibility
  • IIS 6 Metabase and IIS 6 configuration compatibility.

This is to fix the following error:

The installer was interrupted before application could be installed. You need to restart the installer to try again

2 - Install Microsoft Visual Studio Installer Projects.

This is to add setup project templates to Visual Studio. Here, we are interested in Web Setup Project.

3 - Create and configure the setup project

  1. Create setup project
  2. Right click setup project → Add → Project output and choose what you need. You need at least primary output and Content Files from your web project.

Then you can build the project and run setup.exe.

Note

  • You can setup other properties like ASPNETVersion, Manufacturere, product Name, ...
  • If after deployment you faced with error complaining about \roslyn\csc.exe, you may want to include roslyn files or remove roslyn compilation at all. For more information take a look at this post.
  • You can add CustomAction to do some custom actions during install/uninstall. You can find a lot of examples around, like this post.
  • You can even customize UI and add some input and use them during installation. You can find a lot of examples around, like this post.
  • In general, if your deployment is a common site deployment having a few files and database, a better option is creating Web Deploy Packages and then install the package to IIS. You can automate that process easily.
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
  • I tried almost the same way all about that setup project the add project output then primary output localised resources..nearly same but didnt know about the IIS 6 Management Compatibility. +1 for IIS 6 Management Compatibility. Thankyou for the answer – Thameem Aug 14 '19 at 09:06
  • 1
    That's the main point. The project template is quite old and belongs to the IIS6 era. That's why you need to enable those compatibility settings. – Reza Aghaei Aug 14 '19 at 09:12
  • 1
    In general, if your deployment is a common site deployment having a few files and database, a better option is creating web deploy packages and then install the package to IIS. You can automate that process easily. – Reza Aghaei Aug 14 '19 at 09:13
0

vs-2017 ---> other project types ---> web setup project Screen shot