Updating my application

Hello,

I am close to compiling my program, and distributing it.

how can I make an update program to enhance the program later, almost like a service pack.

If I tell my program to look at a certain file each time it loads, could i enter code into that file to change the program?

This would probabley include bug fixes, different menue options, colour ect...........

Cheers
Chris
LVL 1
RickardcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:
See my own PAQ here: http:Q_21080409.html
I think it should help you.
0
DextroSoftCommented:

The only important thing to keep in mind while "updating" a program is that the program itself  can't be running, otherwise you won't be able to overwrite the executable as it will be locked by the operating system. There are sure ways to "override" these file-lockings but I prefer some other more simplistic solutions.

Mostly of the time I use 1 of these 2 solutions :

(Let's say we have a program called "A.exe" version 1  we want to upgrade to version 2 )

First Solution :

- I create a seperate executable, something like upgrade_A_to_version2.exe which will perform following tasks: check if "a.exe" is not running and  overwrite the old exe with the new version.

Sounds simple enough but we do have 2 problems with that approach:
-Where is a.exe located on the computer ?
-How do I distribute in an easy way all the files which will be copied by the program ?

For the first problem: I make sure that every time A.exe was runned, it wrote a key in the registry indicating the App.path of the executable. This way my upgrade_A_to_version2.exe can easely read in which directory the file is located which it must overwrite.

For the second problem : I create a self-extracting zip-file which contains all the new files required  and the update program itself. So when the user opens the zip (exe) file all the files are copied to a tempory location and the upgrade_A_to_version2.exe is launched automatically.

Second Solution :

Even if it is program A.exe which must be runned, make a good habit of referring all the icons of the programs to  "perform_some_tasks_before_running_a.exe". This program will check if there is a new version available ( e.g. trough an ftp connection or by means of an update directory, etc...) and overwrite the old exe with the new version. Once the copying is done it will launch the application and close itselfs. For the user this is all transparant...The user clicks on an icon titles "a" and it is "a.exe" which will open independently from the fact that some other programs were opended first.

If you have any question in how performing 1 of the steps above, please let me now. But they are all standard manipulations

Regards,

PS: it doesn't really matter if your program is subdivided in several dll's or not. The same logic can be applied...
 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sirbountyCommented:
I just simply use pskill from sysinternals.
If my versions don't match, I use my vb app to create a batch file and run it.
Within the batch file, I
a) kill the running vb app with pskill
b) copy the new exe down.
c) restart the app.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

RickardcAuthor Commented:
Right, so you would just install a new version of the program?

I was thinking of using a file containing machine code that my app would read.

Your idea is good. Would you know how to do my idea?

Cheers
chris
0
DextroSoftCommented:
I'm always interested in new ways...but what do you mean with "machine code"  ?
0
RickardcAuthor Commented:
Perhaps not machine code but somthing the app will recognise.

On  the app's startup it looks at a file, if it finds nothing it carries on, but if it finds something, it reads it and adds the code to the application.
I understand that you'd need a compiler to use a language but something that is allready compiled?!?

As you can guess, I'm not a very good programmer!
Thanks
Chris
0
Erick37Commented:
Service Packs do not fix bugs by replacing bits of code within an exe or DLL, it replaces the entire file with the new version.

Use the version number of your application (Project Properties->[Make]->Version Number to set a version number.  Your application can read its own version by app.major, app.minor, app.revision.  This number is also viewable in explorer in Properties->[Version].

When you need to issue a service pack, the replacement file's version should be different.

Good Luck!
0
RickardcAuthor Commented:
Sorry.....
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.