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

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

Related

Automatic update from clickonce application

I want an C# application which can be installed on someones computer and updates it self if a newer version is available. (The conection is only for this application is within one company)
If I install the application, change something in the code, publish it again it won't check if there is an new application available.
This are my settings: Assembly Information | Publish | Publish - Update
The easiest way is to publish to an intranet website within the company. If they have multiple servers (e.g. load-balanced or standby), publish to one IIS site and copy/paste to the other servers - don't publish to each server individually as the application versions won't match. By default, IIS will stop the install setup EXE running so remove the EXE handler from the site's handlers - simply delete it.
Using this scenario, when a user runs the application it will check the website for a newer version (if they have access) and run with the old version if not, or install your newer version, if available.
You'll also find the published folders contain all previous versions - you might want to remove all previous versions before copying around the IIS sites
Are you looking for updating clickOnce automatically when any new version is available in server? If yes, setting Minmum required Version to your latest version might help. Below link may help you
Making ClickOnce Updates Mandatory?

Automatically update a C# Windows Forms application

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.

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!

Creating a "sure to run" app / installer in VS2010

I need to create a simple installer of sorts for a different application. That other application already has it's own simplistic installer, and I don't want to meddle with it.
The reason for my own installer is to allow the user to install SQL Express if (s)he so chooses, and also to pre-install any other basic requirements for such a procedure.
At the moment, here's where I'm at:
I've created a single Windows form application, with big buttons (this is for a user which likely won't be very good with computers) to install SQL Server Express (using silent install with a predefined set of arguments) or the actual application, along with some helpful text to let the user know what's going on. Something along the lines of Visual Studio autorun window.
I've also added the standard set of pre-requirements to the application (.NET, Windows Installer).
Everything works OK if I run the app by using the executable. HOWEVER, if I publish it to create a ClickOnce application (so the pre-requisites are installed when needed) and run it, it stops running other installers.
EDIT: Apparently the problem with not being able to run other application from a ClickOnce application is only on my end, and probably deserves a new question, not necessarily here on StackOverflow (perhaps on MSDN forums?).
In your program before launching the installer you can check if .NET is installed. Its pretty easy to check if a particular s/w or a version of s/w is installed. Write a program that will check HKEY/LocalMachine/Microsoft/Windows/CurrentVersion/Uninstall and in that there will be list of programs that have been installed on that machine. If you find then go ahead with your install else suggest user that he needs to install pre req.
When you create a setup project you can right click on the setup project, go to properties, and click on pre requisites. In that you can mention which version of .NET framework is needed and then give the location of the framework. In this link look for Huggy Bears response eggheadcafe.com/community/aspnet/2/10131905/setup-project.aspx
I've settled for a "Click Once" application. It can install all required .NET components needed for it to run, thus becoming an "sure-to-run-non-native-C++-code-splash-screen".
Granted, there ARE issues with Click Once, but this is far better than nothing. It's also better than running C++ or unmanaged code applications. ;)

Unattended Install for Setup & Deployment project, VS 2005

I have a setup & deployment project which includes a large C# project that i have created.
I also have some prerequisites that i bootstrapped to the exe, although the MSI file is, as usual, just the project itself.
I would like to create a complete unattended install, not just removing the User interface forms via the UI tab in the Setup project, but to install completely unattended.
In other words the end user will click on the msi and the installation will run by itself (maybe one form for showing progress...)
I read quite a bit about the issue but haven't found anything that suits my needs. I read about IExpress but I havent used it, I also read about commands that you can give the msi, but I would have to insert them into the EXE which is a bit of a problem...
Looking for help on the problem.
Thx in advance

Categories