Solved

Upgradable Application

Posted on 2003-11-01
9
272 Views
Last Modified: 2010-05-03
Hello.  I'm about to start a project.  I'd like it to be able to have the application check for an update and download appropiately.  I can handle the queries to a server and the downloading part, I'm just unsure how to impliment it.

Here's what I have.  

User hits "upgrade" (or app does it automatically).
App sends request to my server, or loads a simple webpage (ie www.bla.com?ver=1)
Server sends back a 0 if no updates, or the location to download the upgrade if it is out of date.
App downloads the file.
Then what?

How can an application upgrade itself while it is running?  Do I need to use DLL's?

If someone could point me in the right direction or give me an idea of how to do this, I'd be very grateful.
0
Comment
Question by:samsonite1023
[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
9 Comments
 
LVL 2

Expert Comment

by:dmarco
ID: 9665463
Hi samsonite1023,

To open a webpage from a VB application you have to add a Wbebrowser control to your project : click on project > components and add "Microsoft Internet Controls" (shdocvw.dll) to your program.
Add also "Microsoft Internet Transfer Control 6.0 " (MSInet.ocx).

To load a webpage :

WebBrowser1.Navigate "http:\\www.bla.com"

>>Server sends back a 0 if no updates, or the location to download the upgrade if it is out of date.<<

What do you mean exactly ? Can you explain better what do you want to do.

However to load a file from your vb program :

Dim b() As Byte  ' download a file in binary format ( e.g. an .exe file, .zip, .mdb, etc.....)'
Dim strURL As String
' Imposta strURL su un indirizzo valido.
strURL = "http://www.bla.com/myfile.exe"
b() = Inet1.OpenURL(strURL, icByteArray)

Open "C:\Temp\myfile.exe" For Binary Access _ Write As #1   ' write the file on your hard disk'
Put #1, , b()
Close #1

If you want to dowload a text file or a simple text webpage :

Text1.Text = Inet1.OpenURL("http://www.bla.com")  'this code fills your text box with the html code + the text of your webpage. Then you can parse and save the text in a text file'

Text1.Text = Inet1.OpenURL("http://www.bla.com/disclaimer.txt")  'the text box is filled with your file text and you can save it '

0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9665780
0
 
LVL 1

Author Comment

by:samsonite1023
ID: 9666517
I think you misunderstood the question.

I already know how to do all of that.  But I need to know how to upgrade the application to a newer version.

Basically, I want to know how to have a live update feature for whatever programs I make.  

I know how to check for the update and download it (if its necessary), but I *DO NOT* know what to do after that.  Nor do I know what to code in the actual update.

I hope you can understand my question.
0
Independent Software Vendors: 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!

 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 9666530
You need to stop the current application, update it, and restart it.

Another way that is much simpler is to have another application that looks if updates exist, and update if required before launching the so wanted application.
0
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9668215
After download the new version exe, you call the setup of the new exe with shellexecute, and also exit your upgrade form/session at the same time, the installation will continue to finish.

fyi: shellexecute is an API that run another application.
   : you may need to exit current running instance of same program before installation

Regards,
~ fantasy ~
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 10163594
Points to emoreau
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

733 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