Publishing C# application with VisualStudio - c#

I have an application written in C# using VisualStudio 2015 and I want to publish it (eg give an exe or installer to somebody to use it on its PC). From VisualStudio there is possibility to click "publish" in solution explorer. The result files are:
-Application files (File folder)
-project.application (Application manifest)
-setup.exe (Application)
As far as I know "manifest" file should be some metadata, but I can execute that file and it gives me an installer (the same as setup.exe). After installing it runs an application (just like setup.exe). It makes me confused - what exactly project.application is? Can I delete it and use only setup.exe? What is the correct way of publishing an app? One last thing: why does the installer run installation on first execution and run an application on any other? I would expect to run installation any time (just like other software).
Thanks

It sounds like a ClickOnce application. See the following link for more information:
ClickOnce security and deployment
In a nutshell:
The installer copies the files to the users AppData and then runs the application.
There are also other options such as checking for updates from a network location or web address. Then when you run the application it checks for updates and uses the manifest to do an incremental update of the application files.

Related

MSIX c# - Update and deploy on server/OneDrive

Goal:
I am trying to make a setup file for my app. Futhermore the app must be able to be updated from a server or OneDrive.
Solution:
I am using windows application packaging project for this.
The issue:
The installer works fine when the installer location is on my local harddrive. But when i try to change the installer location to my online file manager or a public OneDrive folder I am unable to download and install the update or App for that matter.
My question:
Has anyone been able to use windows application packaging project where the app downloads updates from a server / OneDrive by uploading the installation file to a server / OneDrive and entering the path to the location, or am I on the wrong track?
Alternatives
The alternativ is of course to use Setup Project and perhaps AutoUpdaterDotNET (from NuGet) which works fine, but now I am interested in a solution which does not require several different third-party programs, and windows application packaging project seems to be the solution.
Have you tried creating an .appinstaller file? This XML file (which you can write in any code editor - you don't need VS or Advanced Installer to generate it, although that way is easier) should allow the OS to cache all the necessary information to auto-update the app accordingly.

Embed ClickOnce Application

Is it possible to embed a ClickOnce Application in an other Application?
I think there will be problems because a ClickOnce Application is not installed to the same folder every Installation. Is there a solution to embed a ClickOnce Application anyway (So an other Application can run it)?
I managed to find a solution for this problem.
My solution was to create an installer which copies some files to a custom location, the user chooses, on the first run after an update. So the application files will always be in the same direction and can be embedded in other Applications.
Be sure the main Application knows the direction of the ClickOnce Installer Application and checks for updates every Start.

Setup Project and Access Permission

I created a setup project in VS2008. This setup copy some folders/files to the program files folder. Also, it adds some windows environment variables.
During the instalation, I am requested to confirm something in a UAC dialog.
This works fine, and all files are copied.
The problem begins when my program is running and I have to modify the a file´s content.
An exception is thrown, saying that I have no permission. Also, if I try to do the same operation in Windows Explorer => same problem.
My question is:
If I have the permission to install my software in program files folder, shouldn´t I be able to write in this folder as well?
Well, it seems that this is a general permission problem. By default normal users (and applications) cannot write to %PROGRAMFILES%. There are folders specially provided for application data storage such as ApplicationData
The reason the setup does install into program files is because this default behaviour of the Windows Installer. Check this link for more info on the Windows Installer and clickonce setup

How to use ClickOnce to deploy my C#(4.0)Visual studio 2010 windows form based Application?

We are developing C# 4.0 windows based application using visual studio 2010. Now we want to make an installable version of the exe using clickonce to deploy our application. I am new to .NET platform. So, please give me a step by step procedure to use clickonce to deploy my application.
While following steps :What should i need to given in Installation Folder URL Box(2 nd text Box):
Here is the break down of the two paths in this wizard
Publish Folder - Where should the Publish process put the ClickOnce deployment package
Installation Folder - Where will users of the application go to install the application from
Often times these are the same location. For example when I deploy ClickOnce applications internally I publish to a network share. This is the same place where users go to install the application.
One scenario where they would be different is when the users install from a web location. In that scenario you'd often have a publish folder which was a network share or path on the local computer while the installation folder was a web site URL

ClickOnce Deployment online questions

Bit of a strange question, but how do ClickOnce deployments work from a web site? I seem to be having some problems with this. Basically, the setup file will download when you click the "install" button, but then some files are missing.
Do you need to be on a Microsoft server to run ClickOnce deployments? I usually do deployments over a local server with UNC, and as this is the first time I've done one online I'm struggling a bit.
Any newbie tutorials you can point me to would be great, and if I do need a special host for it, could you please recommend some?
Thanks for all the answers everyone :)
Are you going to the setup.exe file or the .application file?
Deployment has to be pointed to the .application file. The ClickOnce file will then be launched directly there, no explicit "Save as" download. Once the manifest is loaded, the application will download what it needs and off it runs.
The first thing you need to do is determine if you want the user installing your app to run locally or launching it from the web only.
Second make sure you are using Internet Explorer to launch your application. The .application is registered in IE, but not other browsers.
I'd recommend server only. (At least to start) You don't have to worry about incremental updates. The user will get the correct version of your program every time.
There is nothing special going on with the server. It's all in the browser/.application.
It works from any file server, for example here is a ClickOnce deployment from an SVN server (i.e. I'm checking in the ClickOnce files after each publish): http://o2platform.googlecode.com/svn/O2_ClickOnce_Installers/O2_XRules_Database
Can you provide more details on what settings you have on the Publish tab of your project?
Regarding missing files, yes it can be a pain since ClickOnce doesn't auto add all dependent files from sub projects (I have found in the past that you need to include the extra (non dlls) files you need in the project you are deploying via ClickOnce)
No special hosting requirements are needed. You just need to make sure all the files required by the published clickonce app are deployed.
Take a look here :
http://msdn.microsoft.com/en-us/library/31kztyey%28VS.80%29.aspx
You can deploy to a webserver using either FTP or HTTP. You need to have the following MIME types set up in order to host the deployment:
.application --> application/x-ms-application
.manifest --> application/x-ms-manifest
.deploy --> application/octet stream
If you are deploying .Net 3.5 as a prerequisite, you need these as well:
.msp --> application/microsoftpatch
.msu --> application/microsoftupdate
If you have vsto apps, you need this one:
.vsto --> application/x-ms-vsto
Check out the Application Files dialog in the Publish tab to see what files are included. You can try running the exe file from your \bin\release folder, but if it's using something in the Global Assembly Cache (GAC), it will work and not tell you you're missing it.
Here are some other helpful links:
ClickOnce Overview
http://msdn2.microsoft.com/en-us/library/142dbbz4(VS.80).aspx
HowTo publish a clickonce app
http://msdn2.microsoft.com/en-us/library/31kztyey(VS.80).aspx
RobinDotNet
Visit my ClickOnce blog!

Categories

Resources