Automatically update a C# Windows Forms application - c#

I want my application to automatically check for updates and update the application if needed. I installed InstallShield Limited edition, but when I went to the update section I found out that I need to install FlexNet which requires me to purchase it.
I found out that Windows has stopped supporting Windows Installer which is why in Visual Studio 2013 it's not listed in the setup and deployment section.
I also read about ClickOnce, but there is a small issue when I tried to deploy my application to the FTP server. It asked for the username and password, but it added a warning that these values will be in plain text! So, what should I do? Is there another third-party way of creating an installer and setting up automatic updates?

I've used ClickOnce with dozens of applications and have never seen the username/password prompt. My process is:
Declare the application is downloaded from "http://www.yourSite.com/yourApp/"
Publish to folder "yourApp" in whatever location you want
Drag and drop that whole folder into your WWW space on your server
Email your users the link "http://www.yourSite.com/yourApp/yourApp.application"
For updates, just repeat this same process (except emailing users), and everything else takes care of itself. Be sure check the box in your application settings that tells it to check for updates of course.

The prompt about the username and password only applies during the deployment. So I wouldn't deploy the app using FTP in a Starbucks using their Wi-Fi, but it should be fine at work or on your private network at home.

Consider looking:
How to: Manage Updates for a ClickOnce Application
How to: Check for Application Updates Programmatically Using the ClickOnce Deployment API
You can distribute your application using a webserver, even your application can run from a link in a web page.
And also you can check for update using code.

Related

C# Winforms autoupdate check

I am trying to make autoupdate check and upgrade procedure (now from location on shared drive, in future maybe from server).
I have created "Visual Studio Installer" project that creates setup and it is possible to install the app. Also I have created another binary that searches for updates - if there are updates and user wants it, it runs the setup and app ends - if no updates, it runs main program. I have selected 2 binaries system in order to have possibility to run app without updates checking.
But If I confirm the update I am getting "Another version of this product is already installed. error code..." dialog.
I am not sure if my approach is right, probably not. But I found only commerce solutions and ClickOnce which seems to be for updating from network.
Thank you in advices for your answers.
It seems you are looking for something that allow you to have folder in your disk or a shared drive that can be used as local server to help you make updates without using internet connection , I introduce you to Squirrel.Windows its an open source installation and update framework for Windows desktop apps.
Here is link for Getting Started With Squirrel.
And here is a Youtube Video by Tim Corey where he explain Squirrel practically with demo windows forms project.
Happy Codding...

Setup.exe not working or slow to open install dialog for a ClickOnce application

I am trying to use ClickOnce to automatically update a C# software.
I can publish my application, the setup.exe is created, but when I download/run it, windows tells me that application can be dangerous, the publisher cannot be verified. And if I choose to run it anyway, or as administrator, the install dialog sometimes appear after 10 min but in general nothing happen.
I tried to find a way to make my application trustful but even if :
I enable ClickOnce security settings
Select "This is a full trust application" in "Security"
Add a certificate in "Signing"
It is still not working, so I have no more idea about how to fix this.
I can install it with the ".application" file but I think that is not the correct way to do it.
Thanks by advance !
You are pretty close. Much of the slowness is probably because of anti-virus. Signing it will make things better. The client machines will complain about how trustworthy the app is, unless you install your key (the one used for signing) on each of their machines.
Installing with the ".application" is just fine, especially if you are installing from a network share (instead of a web site or intranet site). That should put an app (icon) in the users' start menu.

How do I secure my C# app's updates?

I'm planning to have my C# app update automatically by comparing version numbers and downloading a package with the new files from my server over HTTPS.
Is this enough? Can I somehow validate that the file I downloaded is indeed the one I wanted? Is there something in .NET 4.5.1 that resembles iOS's App Transport Security?
Perhaps not exactly what you, but you can use the ClickOnce installer, which is available in Visual Studio. It will check for updates automatically and hashes the files downloaded and verifies the checksum with the one on the server to ensure it is the correct one.
To enable automatic updates go to the Properties of the projects, then go to the Publish tab, click Updates, and then check The application should check for updates
To create the installer go to the build menu and click Publish application_name

ClickOnce update with Apache server

I have been working on a C# application which needs bug fixes and updates once i deliver it to clients. I am currently trying clickOnce method of microsoft to provide updates.
For that i need to publish my application to server with frontpage server extension (If i am not wrong!). We are using windows server 2008 enabled machine, with Apache running, i googled regarding "Publish c sharp application on Apache server" and i found this workaround.
It edits .htaccess file to allow access to VS to publish application. But it doesn't seem working. I guess the page is out dated, written in 2006.
So my questions are:
How do i publish c sharp app on apache box?
How do we publish app? Using VS or any other method?
The manifest and payload (files) just need to be generated and then copied en masse to your server, it doesn't have to be a Windows machine.
Publish to a local folder/share and then replace the entire ClickOnce folder so that the code security values remain intact. I'd suggest you always rename your current folder and then copy your latest bits into a "new" folder that is your install location.
i managed to give updates with this workaround (i dont know how feasible is this! Need inputs!)
I used database to track version numbers and (link for) latest copy of software. Then i check for updates on startup. If new update is available it downloads exe (in app itself), closes app and run the setup.
I am using install-shield to generate setup. But when i run setup in machine which is already having older version of software, it doesn't update it, even though it displays its updating.
I know visual studio also provides option to create installation, but it isn't working either!

Need suggestion for how to manage the web application

I have developed a web application also that has been deployed in many client area.
I have created a installer to install this application at client area for first time.
If i done any bug fix or add any new functionality to this site, should i create new installer for site? or How to update the existing site without creating new installer with latest bug fix?
Or, Is there any other option to update existing application?
Or, we can create a installer only install the latest updates?
Please guide me
You can start your journey using the built in web installer (part of Visual Studio).
Important thing is it will only install to a Virtual Directory of an existing web site.
If virtual directories are fine, you then need to worry about bug fixing and updates.
here is a solution...
If you are at the client or have easy access to the web sites via FTP.
You can map drives on your development / test environment to the production FTP sites, then just create a batch to copy stuff over.... best part is - if you're hosting on IIS, if you make any changes to the web.config or any assembly in \Bin you'll trigger an IIS Reset, so this means you shouldn't need to have remote access to their servers.
Make sure that batch updates all web applications in the farm.
You can also fully rely on the application installer - IF YOU'VE FULLY TESTED THAT IT DOES INFACT UPDATE YOUR FILES, LIKE IT SAYS IT SHOULD. Don't just assume it will, test that installer, and retest it... because I have had lots of problems with upgrading a web site, and you can't expect your client to uninstall, reinstall every time.
I wouldn't worry about creating a "patch installer" Web apps are relatively small anyways - and copying unchanged files won't make a huge differance.
Just be sure when you create the installer, you add project outputs to the installer file... and work with project outputs, rather than having to copy stuff in manually to the installer every time you make a change.
Hope this is at least a good starting point.

Categories