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
Solved

Upgradable Application

Posted on 2003-11-01
9
266 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
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 65
bit defender blocks good applications 2 101
Hide vba in gp 7 104
vbModal 12 57
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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