?
Solved

Automating WinForm Upgrades

Posted on 2011-02-15
7
Medium Priority
?
427 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
Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

 

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 1500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

741 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