How to auto update my application which is developed in c#? - c#

I have developed my application in c# which uses SQL Server Express as a database. I want to update my application through internet. What I want is to update only myapplication.exe
Because in the installed folder there is also application.config where configuration of that server is included such as Server name, Instance name. I do not want to touch this file. It is unique for every machine. Is there any ready mechanism or codes to do that? Please show me directions.

There is the Microsoft solution ClickOnce http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.110).aspx
On the open source side, there is Omaha, from Google, powering Google Chrome, Google Earth etc. http://code.google.com/p/omaha/
Also, take a look at Shimmer, by the folks at Gihub https://github.com/github/Shimmer

Sounds like you need ClickOnce installation.
http://weblogs.asp.net/shahar/archive/2008/01/29/how-to-use-clickonce-to-deploy-your-applications.aspx

Related

C# Winform Application With MySql as Database Deployement

I am working on C# Winform application (Visual Studio 2010) with MySql as back-end. Meanwhile I am looking for a suitable solution to a problem about How will I deploy this application along with MySql server. As this will be multiuser application, embedded database is not an option. It need to be a server based.
There should be one server, for which this combine deployment is required, for client, ofcourse only application installation is required.
So what are the options do I have for deployment? If I am offering this application available for download from a website, should I break it into 2 separate downloads? One is MySql itself (I am using XAMPP bundle for MySql because it is easy and portable), Second is the application alongwith it's all dependencies. If this approach is followed, then I've to setup whole database required by application from within the application (which I think is not so difficult). But then end user have to download the whole package of MySql, is there anyway I can reduce the size of whole XAMPP package as I am only using MySql database, As I don't use anything else in XAMPP (PHP/Apache/Mercury Mail etc) can I remove them so that size of bundle will be small enough for end user to download?
I've searching long for the solution, and many forums (Including SO) has many questions about it, but there are no helpful solutions. I am looking for better solution from experts of this forum.
Thanks and best regards
Ahmed

Setting up MySQL server on C# deployment

I have finished developing the first release of my application which uses MySQL (locally under one license and hosted under another).
Connecting the application to the hosted database works fine, i edit the connection details within my application to the hosted server details and it works fine.
However, when I try and use it locally (server:localhost etc..) i get an error stating it can not access the server. In my application, i have included the mysql DLL files, but I would prefer the user not to have to install MySQL server which is about a 100MB download (i know its quite small these days but want the install to be as pain free as possible).
I know it would be an easy fix just to add this install as a prerequisite, but i am sure there is a way to do it without this, or maybe not. Is there a script i can run which will run through and setup the server with users etc?
Any help is appreciated.
Thanks
Shaun
Connecting to a local mysql database implies there's a mysql database service running and was previously installed.
If you want a database you can distribute with your program without having to install a fully fledged database there are quite a few around such as MSSQLCE.
But otherwise, your user is going to have to install mysql on his own machine and keep it running.
Or you could use SQLLite, which is what i have had the best experience with so far.
It should be easy to refactor your Program to use this, and it takes no user setup to use it.
Hope this helps :)

How to genenerate Database backend during Software installation?

I have developed a small application with SQL SERVER back end and I also make an installer for the application with Indigo Rose Setup factory 8.0. What I need is I want to automatically create the database back end with specific user account during the installation of the application.
Before the installer a user is asked to install either SQL server or SQL express as prerequisite, when the database is installed the installation of the software continues. I tried to do using SQL script but I don’t how to do it before installation on the installer software. I though also to embed the database creation program in the main application and it will execute on the user need upon the completion of the installation but I have never tried it before whether it works or not.
Incase if it need I developed the system using C# with SQL SERVER 2005 backend.
So would you please give me some answer to tackle the problem?
Thank you
The simplest way would be to have the installer call sqlcmd.exe to run a sql script. To call that, you will need to know the data source (location) of the sql instance. You will need to get that from the user. For example, machinename, machinename\instancename or typically sqlexpress is machinename\SQLExpress.
http://msdn.microsoft.com/en-us/library/ms165702.aspx
You can also side step the pre-req and install sqlexpress for your customer. There's a cmdline to install it:
http://msdn.microsoft.com/en-us/library/ms144259.aspx
Another option with no sql dependencies is to write your own custom action (command line/API), parse between the GO statements in the script and execute with ADO.net.
Another option outside of setup is to separate setup and configuration. Setup only lays down bits and the database is created at runtime via a configuration phase of the runtime of the product. This has many benefits including being able to update your bits (either with a patch or automatically) after the setup phase and before the configuration phase. You can also give a better interactive experience and handle issues at runtime - with setup, your choices are to fail setup and roll it back which is a bad experience.
Hope that helps.
Bryan already gave you good advice. My recommendation would be to have the application itself be capable of deploying the database by running the deployment script(s). You can use a library like dbutilscmd that parses the .sql scripts and executes the batches from inside the application. I would also advise to have your scripts be capable of upgrading the database, not just deploy it. This will be very handy when you release v. 2.0 of the application. See Version Control and your Database.
One thing to consider is that often the initial database deployment requires an elevated privilege context. There are some options, see Teach Your Apps To Play Nicely With Windows Vista User Account Control.

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

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)

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.

Categories

Resources