Solved

Upgradable Application

Posted on 2003-11-01
9
236 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 69

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 69

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 69

Expert Comment

by:Éric Moreau
ID: 10163594
Points to emoreau
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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

11 Experts available now in Live!

Get 1:1 Help Now