When is this ClickOnce installer really necessary? - c#

I'm not a professional programmer yet, I've just started college and I study some things by myself outside of it. I'm doing pretty basic stuff in C#, like console applications and simple stuff for the web in asp.net.
I've noticed that whenever I publish a C# project using Visual Studio 2010, I am obligated to use this "click once" setup wizard for my apps. But I don't really think any of them need a setup program, they are just a executable and maybe a bunch of .dlls which are able to run by just executing them right away.
I fail to see what's the poing of this click once installer? It probably checks if the correct version of the .Net framework is installed and, if not, installs it. But is that all it does? I think this click once is too ugly and if checking the .net version is all it does I'd rather code my own installer using another language which looks better and provides more info about my program.

You don't need to use ClickOnce, that's just an option for how to distribute your app. You could simply build using the Release configuration and then distribute that Release folder (typically bin\Release, configured in the project's settings), or use a post-build command to, e.g., build a zip of the assemblies and config(s) you need:
del /Q $(SolutionDir)MyApp-win.zip
cd $(OutDir)
"C:\Program Files\7-Zip\7z.exe" a $(SolutionDir)MyApp-win.zip MyApp.exe MyApp.exe.config OtherAssembly.dll

I recommend using ClickOnce for smaller apps since it simplifies the distribution of app updates alot.
You don't need to use the ClickOnce installer that is provided by Visual Studio though. You can create your own installer (with a UI that suits you more) that in turn uses ClickOnce under the hood for the heavy lifting.
See https://msdn.microsoft.com/en-us/library/dd997001.aspx.

Related

I want to make installation of my Visual Studio 2017 project , how to achieve that?

I have database,images and text files in my project and i would like to make instalation..
Also I would like to put prerequirements so that people who install this must install version of .net framework i used in my project
What is the best way to achieve that?
UPDATE:
I wanted to use microsoft visual studio installer but it doesnt work .. it doenst create exe file and i cant open app
I've personally used NSIS for making installers. It has an extensible scripting bit to put whatever prerequisites you need(TOS, EULA, ect.) and it can easily create a professional looking installer.
Try using Inno Setup. It has a good scripting language along with a wizard if you don't want to script. It's also free (unless you are deploying commercial applications).

create exe from visual studio 2012 c#

I made a little app with c# which I wanted to send to a friend to get an opinion. Problem is when I selected release configuration and click rebuild I get 7 additional files(3 dll's, 1 exes,...) along with the exe I want. Am I doing something wrong? I used to get single .exe files back when I used c++ with VS 2005.
You are not doing anything wrong. Its just that at release additional files are generated like AppConfig.xml for instange that holds your application settings, or a ClickOnce deployment package so that your friend can install the app. To get more used to c# you can start by googling articles about the differences between debug and release
Have you considered using the Click Once facility built into Visual Studio 2012?
Click Once Deployment - MSDN
Click Once will generate an installer that will that your friend can execute. It will automatcially download and install any dependencies (such as a specific .NET Runtime) if necessary.
To distribute referenced DLLs look at the following URL as it suggests the correct configuration settings:
How to: Specify Which Files Are Published by ClickOnce
It's been an horrible hour. Couldn't get Clickonce working for such a simple app. Moving just the 3 referenced dlls and the exe to another folder worked. Wix on the other hand...is difficult to say the least.
However, this allowed me to create a single setup file if not an exe in 10 mins. I sent a shortcut to the desktop which is more or less what I want.

free windows installer

I have found a lot of programs to make an installation package for .net application but non of them meet my requirements.
I'm looking for a free application which is able to create installation and uninstallation package and is able to check if net framework and sql 2008 Redistributable is installed if not application should be able to install them first and then start application installation process
Take a look at Wix.
It is free, but the initial learning curve may be a little bit harder then other programms. The output of WiX is a *.msi package.
I recommend Inno Setup - I compared it once with NSIS and found it more usable. It suports scripting, and you will find example scripts for installation of .NET and other redistributables through the search engine of your choice.
Did you try installer, that is shipped with visual studio? If it is very simple, try Wix. Aslo, consider NSIS.
Or Windows Installer?
If you have Visual Studio installed then you can simply create a setup project within your solution. If not, then download from the above link (or fine the appropriate version to download) and utilise the set creation application manually.

Visual studio 2008 & nant , msbuild how we use this for automate? Is nant work for vs2008?

I am working on a windows as well as web projects. We currently use Visual Studio to build our solution using visual studio 2008.
I would like to move to a more powerful build system such as Nant or MsBuild for atomate.
What are the ways & how i do this?
Currntly we use Visual source safe & mercurial(hg) as source control
How does this all integrate with Source Control?
Help me all the ways..
Thanks!
Last time I checked, NAnt didn't support VS2008 project files properly.
I personally like using NAnt as the general build controller, but delegating to MSBuild for the core "build the code into assemblies" part. This has worked well for me in Protocol Buffers, for example.
I don't know about using either VSS or Hg from NAnt, but I'd be very surprised if there weren't adapters available. Where do you need to integrate source control with the build, is it for version numbers, continuous integration, or something else? You may find that whatever continuous integration server you're using can handle the source control aspect itself, and that your build file doesn't need to know about it.
This really depends on what you want to automate and how. Visual Studio Solution files can be called directly from MSBuild, so to just build the solution without Visual Studio, nothing has to be done.
NAnt can call msbuild to build Solution files for you, so you can wrap you solution build in a NAnt script and do other useful things around it. This is how I usually do things. That way your build script and your solution files stay in sync.
NAnt has had VSS tasks since the dawn of time, so checking out the code is trivial. If they don't have a Mercurial task, there is always the exec task which will allow you to run any commandline program (I assume there is one for Mercurial).
Normally I have a build server with a working copy of the application/solution. Then, each night, the server calls a NAnt script that updates the working copy to the latest revision, and builds the solution using the msbuild task. Then you can do all kinds of nifty things like creating zips or tars, or even installers.

Stand-alone build system for Visual Studio projects

We use Make to compile our product, which includes, C, C++, Java and a bunch of other bits and pieces. As much as possible we have all tools required to compile the whole thing checked into source control, to eliminate local dependencies and to ensure consistency across dev machines.
Recently we've added some components written in C# using Visual Studio and would like to take a similar approach with Visual Studio solutions. Shelling out to devenv isn't a good option. Calling csc.exe directly (as I've done before using Nant) would require keeping track of file dependencies in the build script, which I'd rather just let the Visual Studio solution do.
MSBuild seems like a good bet, though its default location in %windir%\Microsoft.NET\Framework\[version]\ makes me worried about variability between machines, both with the [version] in the path and the fact that you'll see both "Framework" and "Framework64" directories. I wouldn't mind having a requirement that all developers have whatever .NET framework version installed, but I do worry that your v3.5 might not be the same as mine.
Does anyone have a solution to this that they like? Tried anything that you really didn't like?
MSBuild is the lowest-friction option for sure. Different fx versions aren't that big a deal at build-time- if you're using something important from a fx version higher than what's installed, it won't build. The last place I was at, we built a huge multi-environment build system with NAnt as the base, and it hooked out to MSBuild with NAnt's MSBuild tasks. MSBuild is fine on its own if you're just doing MS stuff, but we had a bunch of things that MSBuild didn't natively support, hence the NAnt wrapper.
I agree with everyone else. To make it easy, just make vsvars.bat (the batch file that is the Visual Studio Command prompt) part of your build script, and then MSBuild will just work.
We use Nant to drive msbuild. If you're worried about different versions of the framework, particularly service packs, use FxCop to check that you're not letting unexpected dependencies creep in. Details are in this answer.
MSBuild is the right tool for this job. Just match your framework version to the version of the framework bundled with the Visual Studio you're using.
32-bit versus 64-bit shouldn't matter, I don't think -- I'm pretty sure both the 32-bit and 64-bit editions of Csc.exe can cross-compile to the other platform. The MSBuild project file (*.*proj XML file) should contain everything MSBuild needs to build your application.

Categories