Solved

Automating WinForm Upgrades

Posted on 2011-02-15
7
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34898545
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
ID: 34898883
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
ID: 34899407
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ktola
ID: 34899517
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
ID: 34899536
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
ID: 34899706
>>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
ID: 34943534
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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