ClickOnce Deployment online questions - c#

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!

Related

Publishing C# application with VisualStudio

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.

How do I publish a .NET application with OneClick publish through Visual Studio 2015?

I've been trying to research this the last couple of days and it doesn't seem like there is very good support for beginners. All video tutorials I find don't answer the questions I'm asking.
What I want:
I have an application I've written with .NET 4.6.1 in Visual Studio 2015 and I want to distribute an .exe that automatically checks if there are updates. It seems like this is exactly what OneClick is intended to do.
Where I'm at right now:
I want to publish to a shared drive among multiple people. It seems like I put that file path in the "Publishing Folder Location" which produces Setup.exe, MyApp.application, publish.htm, and Application Files. When you go to publish.htm there is an install button that downloads Setup.exe.
Where I'm stuck:
When you download the Setup.exe file onto your local machine and try running it gives an error. The details say it wasn't able to find the MyApp.application file. It seems that file is responsible for knowing what version of MyApp is currently installed on the users machine so that it can be compared to the download location (in my case the shared drive) to see if updates are available.
What am I missing? Do I misunderstand the purpose of OneClick publishing? Shouldn't users be able to visit the publish.htm once to get an .exe and that .exe is used to launch my application and look for updates first? I really appreciate any insight on this topic!
PS I've read over all the MSDN documentation, but it isn't user friendly to beginners in my opinion. Or maybe I'm just slow : )
You understand it exactly right, but when a user navigates to the html page, it downloads multiple files. The .exe, the .application and other supporting files.
You are correct in assuming ClickOnce is what you want. What I've found is the .net dependencies are very particular when using click once. You have to make sure each machine has the correct version of the framework and then they can use the htm site.
What I prefer doing is distributing the .application file to the users machine and just letting them run that. It will check for updates on the server every time it is ran and copy all the necessary decencies to the users Local directory.
You have to direct the users to the .application-File.
That one is responible for versioning (Updating) and executing your Application.
If you execute the .exe it will look for the .application-file to find the infos about the version, which should be installed/downloaded.
NOTE
Not all Browsers (in case of internet/intranet-deployment) support ClickOnce. But there are extensions for almost every browser

Publish Winforms Application to a website

I've built a Winforms Application, and I want to publish it. I'd like to have a link on a website https://sites.google.com/site/satsavvyboardgame/home where I can have the user download the application and have it install on their computer. So far, I haven't found any way to wrap everything up in one package, or successfully publish to the web. What are the specifications for the URL to publish to the web?
Is there any way to package everything into one item (the site won't allow me to upload/download folders), so that the user could download one item, then run that or something in it?
Is there another way to do this that I haven't seen?
I'm using C# Visual Studio 2010 Express, and my application has the code and a couple of XML files that I need to run. All are part of the project, and run fine when I install from a file using the CD publish settings.
I've never published an application before, so any help would be much appreciated. Thanks!
You have 2 general options:
use "ClickOnce" which will enable automatic updates each time the user click to install and have several other benefits such as less problems with priviliges.
Use "Windows-Installer", which allows you more control of how to do and what to do during the installtion phase. However, shamefully, Package & Deployment project types do not exist anymore in vs2012. there are several 3rd party packages you can work with to create your setup-project.
The ClickOnce is preferable if what the user download is a just a simple standalone game application for example.. the MSI is for the more "rich" applications that should make extensive usage in the machine registry and etc..
The table in this link will give you the data you need to make a decision:
http://msdn.microsoft.com/en-us/library/142dbbz4(v=vs.80).aspx

ClickOnce installation folder URL relative

When deploying a ClickOnce application, the installation folder URL, is there a way to make it relative to the web application directory hosting it?
For instance, for local testing I publish to http://localhost:54592. However, when this web application is deployed, it could be anything from http://www.foo.com to http://www.foo.com/MyVirtualDirectory
I would like the path to find the installer in its current location, and the application after installer has completed to reference the web app host, not the development URL.
Platform: Visual Studio 2010, .NET 4.0, and C#.
This works out of the box if you stick with *.application as your application source. You just need to pick a folder inside your web application to publish your ClickOnce application, and the application is available from this address under your application.
For example, if copy your site to C:\inetpub\wwwroot\mysite and copy the ClickOnce to C:\inetpub\wwwroot\mysite\myapp with MyClickOnce.application inside the ClickOnce folder.
Then you expose your website as http://example.com and the ClickOnce application is available under http://example.com/myapp/MyClickOnce.application.
In case of setup.exe you need to recreate the manifest after you publish it to the destination location. This is done with mage.exe.
In the Options dialog, the Manifests tab, you can check the box that says "Exclude deployment provider URL".
Then provide the URL to your user for the installation based on where you put it. When they run it, it will create and save the URL where they got it from, and always look there for updates.

How do I unpublish a .Net application

I published a C# .net application to the wrong folder. I am using VS 2005. How do I unpublish the app to be able to republish in the correct folder.
I tried simply publishing to another folder and now the app will not run from either location.
You will need to manually delete all the published files from the wrong folder.
There is no "recall"/"unpublish" function in VS. All "publish" does is compile and copy compiled files and other included files and folders (images, css, js etc) to the specified directory.
Publishing is essentially just a copy of the built application to the destination folder, as far as I aware. This points to a different problem in your application as being the source of your error.
More than likely your app isn't working from either folder because it's configured to use asp.net 1.1 or doesn't have asp.net installed at all on the server. If it is installed, and both 1.1 and 2.0+ are installed, it will default to 1.1, and the folder needs to be configured to use 2.0+.
But other than that, you just delete the files from the server by hand.
Publishing function also creates "Application" on the IIS, so I would probably start by opening the IIS server with "Internet information services manager", and remove the application with the wrong folder.

Categories

Resources