Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a "patcheable" application 1

Status
Not open for further replies.

florindaniel

Programmer
Dec 4, 2009
120
0
0
RO
Hello,

I mean: what are the steps to follow if I want to be able
to produce later patches or upgrades or service packs :) for my application, and how these patches can be built?

Now I have an EXE file that I must rebuild and redistribute it.

Thank you
Daniel
 
Their are several pieces of software that can do that for you.

If you use installshield to install your application on end users systems you can also use install shield to create a patch.


I've also looked at a program called RTpatch. it does a good job a making a small program that can update and exe from one version to another.


Alan
 
Daniel

I rolled my own.
Your main exe should be able to read a file off the web to see if there is an update. I compare the version of the exe to a text file on the web.
If there is an update it comes out of the main exe & fires a second exe, your updater.
This can now download your new exe.
My updater downloads a zip file & extracts it. It also is instructed to run a program file (that may have just been downloaded) if relevant.
The updater then fires up the new main exe

Craig Boyd has done a web updater:

Andrew
 
Thank you for advice

That means I can only replace the WHOLE exe not only updated/erroneous parts of it, isn't it?

I suppose I could split the EXE into multiple APPs and replace only that APPs but I don't know in advance wich one will pe upgraded nor will be with errors (all, I presume:)

Daniel
 
Daniel,

I agree with Andrew. I use a similar home-grown system. I put the new executable on a web server; in my start-up routine, I compare the version number (which is built into the filename), and download it if it's newer. This is all completely transparent to the user, except for the small delay during the download (the user sees a polite "please wait a moment" message when this happens).

I also take the view that it's easier to issue an entirely new EXE file, rather than mess around with patches or multiple APPs. It's true that a big EXE will take longer to download than a patch, but it's not going to happen all that often, and I doubt the user will care that much.

By the way, one of my clients wrote an article about this technique which might be of interest; see Installing new copies of VFP executables.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,

How do you get on with the UAC in Vista/Windows 7?

My updater is struggling to do local updates (from a network drive) at the moment (in Windows 7 - I actually never got any Vista clients!) because the UAC switches the user to Administrator and the updater can no longer see the same drive mapping...

I can't expect corporates to turn off UAC just for me, so I need to find a way around this.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
the UAC switches the user to Administrator and the updater can no longer see the same drive mapping...

Martin, I'm not seeing a problem with drive mapping. I think that's because I use a URL as the source directory; the target directory is the VFP default directory on the C drive. I don't use network drives for the updating.

At least, I think that's right. I wrote the code some time ago. My customer handled the configuration issues.

I do know that the application is installed outside the Program Files tree - but more by chance than design.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Likewise on the app being outside the 'program files' tree (all mine go in c:\apps) but I have a number of users on large LANs and try to avoid each of them downloading updates by allowing the first one to put the new exe file in a shared drive.

Is your approach working ok in Vista/W7 with UAC?


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I've narrowed the problem down a bit, and resloved the worst of it.

Now, if the local app 'sees' an update on a network drive, it copies it to a local folder THEN runs the update executable and releases control by quitting. UAC then fires up and runs the updater as an administrator, and copies the new executable from the (fixed) local folder over the top of the existing app. Here we hit a small snag, the updater then runs the new exe file (as Administrator) and quits (releasing control).

The new exe file is running as Administrator now, so the drive mappings for the data are all wrong, as are all the other personalised settings (printers etc). So, the user must quit the app and reload it manually in Win 7 - I have still to implement that last bit on a live Win 7 installation - but it shouldn't be hard.

Unless someone knows how to force a reversion to the original user?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
One approach would be to use an application starter like is shown in:
An Application starter (with auto copy from server into local station).
faq184-4492

If you use something like that it can compare the existing version (typically using File Date) to another version and then make any main EXE file changes before launching it.

I am using that general approach for one of my clients to do in-house version updates all the time and it works well for me.

If your alternate version is somewhere other than on an in-house server, you can make the appropriate modifications to the launcher to handle that as well.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top