Solved

Automating WinForm Upgrades

Posted on 2011-02-15
7
421 Views
Last Modified: 2012-06-27
I have a WinForms SysTray application that is installed using an InstallShield project downloaded from a web server.  The application itself can communicate with the web server and I want to utilize this communication to notify people of upgrades, download said upgrade and run the new installer automatically.

The upgrade process itself works just fine - but people have to manually log into my site, download and install it,  Is there a way that I can make the Windows application do this for the user?
0
Comment
Question by:ktola
  • 3
  • 2
  • 2
7 Comments
 
LVL 33

Expert Comment

by:Todd Gerbert
Comment Utility
Seems like it shouldn't be too difficult...

Create a page on your web server that serves a simple text file that includes the most current version number, the URL to download the current version, and optionally a URL clients should use in the future to check for updates.

You could use a WebClient or HttpWebRequests in your forms application to get the text file, determine if a newer version is available, and download it.

Then use Process.Start to run the installer.
0
 
LVL 16

Expert Comment

by:ToddBeaulieu
Comment Utility
ClickOnce was developed exactly for this purpose. Instead of using a third party installer, you'd create your project as a CO project. There are, of course, requirements that you have to configure and meet, but once set up, when you push a new version to a public URL, previously installed instances will automatically see the update. You can also control whether they must take updates, etc. It's quite powerful and simple ... once you get through the requirements. I haven't tried wrapping a system tray application in CO, so I'm not sure whether it's possible or not.
0
 
LVL 33

Expert Comment

by:Todd Gerbert
Comment Utility
I have a sys tray app I've deployed with ClickOnce, so it definately works - but that's internal to my company, on our intranet - I'm not sure ClickOnce necessarily lends itself well to deploying anything other than a very simple application.  Certainly something to consider though.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:ktola
Comment Utility
I was looking for some automated hooks through InstallShield but that does not appear to be an option.  The access permissions I need preclude using ClickOnce so that is not an option.  I had already written out the manual process but it does not allow for a smooth restart of the application and getting the application to shutdown before the installer kicks in is tricky at best...
0
 
LVL 16

Expert Comment

by:ToddBeaulieu
Comment Utility
In that case, I suspect the first response is your best option ... some mechanism so have the app look at a simple "flag" in a public place and then let the user know. At least it's a good start.
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
Comment Utility
>>does not allow for a smooth restart of the application and getting the application to shutdown before the installer kicks in is tricky at best...

How so?  I assume there's a menu of some sort on your application, and probably with an "Exit" option, so your download routine could just use Process.Start to launch the installer for the update and then immediately run whatever code you already have in place to handle a a request for exiting the application.

Alternatively, you could store the update in a "special" folder and just advise the user they need to restart the application for the update to run - then modify your application to check for the presence of an MSI in this folder on startup and run it if present.
0
 

Author Closing Comment

by:ktola
Comment Utility
What I wanted to do does not exist and, since I have to run in admin mode, auto-starting does not work either.  I ended up writing a routine that performs a binary download of the new installer, launches said installer and then closes the main application.  While not ideal, this appears to be sufficient for the current requirements.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now