How do i update an application after pusblishing it in visual studio - c#

I published an application,when publishing it i checked that the application should check for updates-now how do i make it realy check for updates-where should i put the new files and in which format?

You'll need it on some kind of Web server.
I would imigine that you also want some authentication so that only the application it self can gain access to the new version of the software.

I'm going to assume you mean you are using CLickOnce as the installer. If you want the app to check for updates every time it is ran you need to publish to a location all the apps can see. If this is an internal app I believe a network share will do. If not then you need to publish to a web server or ftp server.

You can use ClickOnce as nportelli mentioned above, or you can use a 3rd party utility to do the heavy lifting for you.
I wrote an open-source library to do just that transparently - including an external update application to do the actual cold update. See http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/
The code is at http://github.com/synhershko/NAppUpdate (Licensed under the Apache 2.0 license)

Related

How to test and deploy distributed applications?

I've written a client-server application. There is one computer running the server application, and several computers running the client application.
So far, every time I had a new version / patch of my application, I copied the binaries first through VNC to the server application, and then start a script, that performs a script on client-side, that is copying the binaries to a local folder (network execution is not working!)... Then the client application is started on every client computer...
So what are good opportunities that can replace my old-style method?
I tried creating a click-once application that is updating over http/ftp... but without success ^^
We use an open source app called Presto: http://presto.codeplex.com/
After doing the initial setup, there are only two manual steps with each deployment:
1. Copy the binaries to a network location
2. Press the button in Presto to initiate a new deployment
The big win with Presto is that you use it to initially set up your apps and servers, and specify the appropriate config settings for each environment. Once you initiate a deployment, the installation happens automatically, and the correct values are written to the config files (QA gets QA values, production gets production values, etc...).
With Presto, you can stop services, delete folders, copy new binaries, update config files, etc... and it's all automated.
That's why web front-end is so popular :)
Try to implement good auto-update mechanism and versioning. Client has hard coded server version, with first call all with each call server includes own version. When version mismatch - time to auto update. On server - it's just endpoint to download client application installation, which is standard across versions.
So client has external updater process, that is initiated after client knows that new version exists. Goal of updater process is to download new installation/package and that either to run installation that will update/re-install client either unpack and copy new/modified files.
When not using some external libraries. Process looks like this.
Click-once is another approach and also should work.
Similr question is here
Auto update .NET applications
Anyway probably your client apps need a good installer. When you have installer just left to implement simple downloader/updater and versioning on service.
It is not that hard to do this with less code.
Set up a http service in your application.
Create a File where the current version is listed.
Set up a ftp service in your application to provide the new binaries.
Add a Updater.exe application to the client, this will check for new updates via http and download the new version via ftp. Also a client version file should be made.
So you just have to do your old-style method just one more time and you are done!
Now I don't know if the client application can run the server, if that case is so, I would advice to seperate the services (http, ftp) from your server app.

One Click Installer for Console Application .NET

I have a simple console application written in .NET. I need to make an installer for the console application and put it in the server directory. This can be achieved by using the Setup Project in MS Visual Studio. I also want the ability that whenever I open the app it checks for a new version. If the new version exists then it installs it. Any recommendations on how to achieve this in .NET?
ClickOnce handles versioning for you. Simply publish new versions to the same place as previous versions, and when the user starts the app they will receive notice of the new version. That's part of the whole point of ClickOnce. The downside is, you lose control over the location of your application in the user's filesystem (for a simple console app like yours, that's probably not a huge deal, but I'll leave that decision to you). We've also had difficulty with certificates; if you sign your ClickOnce manifests (strongly recommended) you have to keep exactly the same certificate, strongly identifiable from a major CA, to keep the ClickOnce process strictly "click once".
Pretty much the only other way to handle versioning is to implement some web service that will report the most current version, and have your app call that service on startup to notify the user of upgrades. The upside is that your users still control where the app goes, and you can control where the app is published (if the next version needs to go on a different server, no problem; just point the user there using some information returned by the web service). The downside is more work for you to develop and deploy.

An alternative to iis/asp.net/asp while still being able to code in C#

Is there any alternative to IIS/ASP.Net/ASP while still being able to code in C# (for web back end development) ? Is there any light weight open source alternative to IIS,ASP.Net combo ?
Mono is the open source alternative Mono project
Have you tried the new IIS Express? It provides you with a configurable IIS 7.5 style platform per website solution. It's really useful when developing on XP for instance where previously you would have been limited to 1 website per development machine.
It's now available as part of the Visual Studio 2010 SP 1 download.
Check it out here;
IIS Express Overview
Although I'm a bit unclear as to your actual project requirements there is nothing stopping you from creating a C# based application and then exposing a web service which your application could connect to written in any web based language of your choice. However you will still have to host the web service in IIS.
You can use Cassini:
http://ultidev.com/products/Cassini/index.htm
Cassini is very reliable but not designed for heavy usage which is why UltiDev have built UWS Ultidev Web Server Pro based on the original Cassini Server:
http://ultidev.com/products/UWS/

Web-Update class in WinForms application

I have build an C# Winforms application which will need regular updates and patches in the future. To ease the update process for the users of my app I'd like to build an web-update class that looks for an update on my site.
What would be the most secure and reliable way to implement such a class, considering:
The site is build in PHP / Joomla
I haven't the foggiest idea how to program in PHP
All webserver directories are read-only by default (and only writeable by an FTP account I own)
The first and so far only idea that comes up to me is to create a file on my webserver that'll never be renamed, and in it I'll define the location of the latest version and number of it. The app will then be able to download the update from that path using the WebClient class.
However, if there's anyone with a better update-class idea that doesn't require an asp.net webserver nor webservices (already tried and failed on that one), I'll be grateful.
Edit:
I've tried the ClickOnce solution suggested by Gabriel McAdams, but on application startup I experience a "ClickOnce launch utility has stopped working" crash. So I'm again looking for a solution to update an application. For the moment, the answer of Kristian Damian is the most suitable.
I would look into ClickOnce Deployment.
Here is some of the text from that page:
ClickOnce deployment allows you to publish Windows-based applications to a Web server or network file share for simplified installation. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce.
Maybe this link can help you:
http://themech.net/2008/05/adding-check-for-update-option-in-csharp/
I developed a Windows application in C# that does updates automatically over the Internet. After much grief, mainly because at that time I had very little experinece with Web development, I purchased a product that made it easy to update the application. If it is OK with StackOverFlow and you are interested, I can give you the URL.

securing a clickonce update location

I've got an app that publishes and updates from an http update location (I publish to the ftp site of the host, and update from the website).
The publish.htm page is very handy as I can install the app on any machine, anywhere without needing media. The problem is, so can anyone else. How can I secure the update location so that only authorized users can install the app without buggering the auto-update feature of clickonce?
Is this an internal application? If so you could just exclude the publish.htm page from your deployment. Then to install you would then just use the application manifest link http://yoursite/YourApplication.application which should kick the install off, this would not affect automatic updates. This may be just enough obfuscation to for your purposes.
Failing that you can dynamically generate the application manifest using a little bit of asp.net which would only produce the manifest for the users you want. The other benefit this has is that you can isolate a small group of users when rolling out a new version.
Just a thought.
If you're still transferring over HTTP, it's as easy as running a traffic sniffing program like Wireshark to see where the application is downloading from. To evade this you'll need to make sure to transfer over HTTPS, on top of whatever obfuscation you do to hide the update location.

Categories

Resources