Defining prerequisites on a clickonce application using mage tool - build-process

When publishing a Clickonce application though visual studio, there's a button "Prerequisites..." where you can choose the application prerequisites.
As far as I understand, the publish action creates a Setup.exe that verifies if the prerequistes are installed, install them if they aren't and then run "application_name".application.
Does mage.cmd support the prerequisite feature and how? Or do we have to create something like setup.exe by hand when doing builds outside visual studio?

As far as I know, Mage does not have any support for prereq generation like Visual Studio does. It makes sense, the bootstrapped setup.exe that VS creates doesn't have anything to do with ClickOnce other than launching the app when it's finished.
You should be fine using VS to generate your Setup.exe and using Mage to create your deployments. The Setup.exe should rarely change so it shouldn't be too much of a hassle.

You can use this MSBuild script to generate the setup.exe
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<GenerateBootstrapper ApplicationFile="$(Application).application" ApplicationName="$(ApplicationTitle)" ApplicationUrl="$(ProviderUrl)"
OutputPath="$(DeployFolder)" BootstrapperItems="#(BootStrapperFile)" ComponentsLocation="HomeSite" CopyComponents="true"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
/>

Related

Creating an MSI installer for a C# SCD Deployment (Visual Studio 2019)

I have a .Net Core 3.1 application that I'd like to deploy as a Self Contained (SCD) Deployment using an MSI Installer in Visual Studio 2019...
I have published the project as an SCD Deployment and I can run this on the target machine just fine
However, I've been asked by IT support to provide an MSI installer for the application as .MSI files work well with some of the admin/control applications they have.
So I created a setup project in my solution and selected 'Publish Items' as the Project Output of the setup project and rebuilt it...
The installer seems to run just fine on the target machine but when we try to run the installed application it says that .Net Core is required ...It's as if the installer has ignored the Self Contained aspect and just installed as a regular Framework Dependent Deployment
Is there a way to create an installer that installs an SCD deployment? Have I made a mistake in my thinking?
Many Thanks in advance,
Andy
The VS Setup Project template is quite old. Most likely it was not updated to be "aware" of the SCD support so it resorts to extracting the classic output binaries from your project.
There are other free tools that you can use to create an MSI from VS, which give you more options to customize and correctly configure the package.
If you have time and want to learn a new skill, try WiX Toolset. It is very powerful but you will need some time to get started.
If you wanted to get it done quickly and avoid the hassle, use the free VS Extension from Advanced Installer. Its GUI allows you to easily create your setup package and it has native support for .NET Core packaging too. If you follow the steps from the linked tutorial it should create a working package for your application.
Disclaimer: I work on the team building Advanced Installer.

How to create an exe out of ASP.NET project

I need to create an .exe or find a way to run my project in other computer witch i don't have and i cant install Visual Studio. Is there a way to make this possible? Btw I'm using Visual Studio 2013. Thanks anyway.
You don't need visual studio to simply run an ASP.NET project, you can publish it to any machine that has the .NET runtime and a suitable web server.

How to package and deploy asp.net web application

I am currently working on automating the build and deploy of an asp.net web application which is developed using vb.net in visual studio. Currently, developers are building the solution and projects using visual studio IDE. In the solution, they have deployment/setup projects (vdproj) for each environment (e.g.: app.setup.dev, app.setup.uat, app.setup.prof) which creates msi for the deployment and the web.config is embedded on it.
We are using github for scm, jenkinsfor build/CI and udeploy for deployment.
I am able to build the solution using msbuild cli thru jenkins. However, vdproj cannot be built using msbuild. Alternatively, I installed Visual Studio and MS VS Installer Projects Extensions in my build server, then build the vdproj using devenv. I am not sure if that is a correct way, maybe it is just a workaround.
What is the appropriate way to package the deployment artifacts (contents files, dlls, web.config) and deploy them? And How? If there’s another way to do it rather than creating MSI, it would be great as I don’t have to get a license for the Visual Studio in my build server.
I am currently working on automating the build and deploy of an
asp.net web application which is developed using vb.net in visual
studio.
Maybe you can try publish asp.net web-app by msbuild command-line.
1.As far as I know, we can build and deploy by Visual Studio, see this document.
2.And without VS, you can build and deploy(publish?) by msbuild command-line, there are many resources about this topic.
See:
How to deploy an ASP.NET MVC application on build using MSBuild in Visual Studio 2015?.
How to build and deploy a web deployment package using MSBuild
Using MSBuild.exe to “Publish” a ASP.NET MVC 4 project with the cmd line
In this way, you can get similar function by specifying the parameters and don't need to have VS installed in the server.
What is the appropriate way to package the deployment artifacts
(contents files, dlls, web.config) and deploy them?
Do you have to package them into .msi or .zip and then publish it. If not, simple msbuild command like: msbuild xxx.sln /p:WebPublishMethod=xxx /p:PublishProfile=xxx is enough.
Not certainly sure if it's what you want, hope it helps.

How to run ASP.NET MVC app using MSBuild command line

How do I compile and run an ASP.NET MVC app using nothing other than the MSBuild command line? My Visual Studio is super slow and I just want to be able to run an app quickly for bugfixes and showcasing etc. Is this possible? What's the command line for it?
MSBuild is for building your application. If you want to run your app outside of Visual Studio, you need a web server for it. I'd recommend you to publish your app on local IIS. Just point your IIS website to your Web project folder. After that you will be able to access your application from the browser without running it from Visual Studio.
You can build your project from command line. Use msbuild.exe utility for it:
msbuild.exe projectname
You can find it in one of your .NET Framework folders (I recommend you to use the latest one):
C:\Windows\Microsoft.Net\Framework\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v4.0.30319\MSBuild.exe
When IIS is set up, you can build your app and see changes in your browser. Visual Studio is not necessary at this point.
Instead of IIS you can use IIS Express. Here is an article of how to run application on IIS Express from command line.

Changes in dll on converting web application from vs 2008 to 2012

I want to use an ASP.NET web application which was built using visual studio 2008 to 2013. will keep the .net framework to 3.5.
My concern is: There will be changes to .csproj and .sln after opening the project in 2013 but what about the dll to be deployed. would i need to update the hosting environment to 4.0 or any dependency upgrade?
The csproj and sln files will indeed be upgraded, but that has no bearing on the output of compilation.
As long as you continue to build for .NET 3.5, there shouldn't be any additional requirements to deploy your application. One thing to keep in mind is that VS2008 web deploy projects and database projects have been deprecated, and no upgrade path for those exists. So be careful if you're using either of those.
The safest approach for you will be to test the upgrade. Install VS2013, which runs side-by-side with VS2008. Open up the old solution, let VS update it, then do a test deployment. If there's a problem, just revert the change to whatever your last source controlled version is.

Resources