BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update to program
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical
View previous topic :: View next topic  
Author Message
Wade
Guest





PostPosted: Fri Aug 29, 2003 1:58 pm    Post subject: Update to program Reply with quote



I am wondering what is the best way to update your software programs. I
know there was discussion before about this, but I cannot seem to find
anything on that. What I would like to do is update my exe file without
have to download the whole file. I am also looking to do this from the
internet for the customers. Does anyone have suggestions on this. I am
sure this is common for people to do.



Back to top
Alan Garny
Guest





PostPosted: Fri Aug 29, 2003 3:09 pm    Post subject: Re: Update to program Reply with quote



"Wade" <wthorson> wrote

Quote:
I am wondering what is the best way to update your software programs. I
know there was discussion before about this, but I cannot seem to find
anything on that. What I would like to do is update my exe file without
have to download the whole file. I am also looking to do this from the
internet for the customers. Does anyone have suggestions on this. I am
sure this is common for people to do.

I have managed to implement a working solution, but I am afraid it involves
downloading the whole file at the moment. I guess I haven't (yet?) bothered
with compressing the file, because it would mean that I have to compress it
before uploading it onto my web server (I am kind of lazy).

Otherwise, what my program does is to check the version file on the web
site. If the version file returns a version number which is newer than that
of the application it then asks the user whether s/he wants to download the
update (gives the size of it). Once the download is done, I make a copy of
the update in the Windows temporary directory. I also put there a small
batch file (yes, thanks DOS for that!) which job replace the old exe with
the new one, restart the application (if necessary, see below) and delete
itself (i.e. delete the batch file, so all is clean, something that to my
knowledge can only be done with a batch file).

From there, two solutions... either I check for an update at startup, in
which case once the update downloaded and copied to the temporary directory
(together with the batch file), I call the batch file and shut the
application down. The batch then replace the old exe with the new one, and
restart the application before deleting itself.

If on the other hand, I check for an update while already within the
application, once the update downloaded and copied to the temporary
directory (again, together with the batch file), I leave the old application
running, until the user decides to close it. Before the application actually
closes, I call the batch file, which once the application is really closed,
replaces the old executable by the new one and delete itself (no restart of
the application this time).

I have been using this for quite some time and that works like a gem and is
totally transparent to the user.

Cheers, Alan.




Back to top
robertbienert
Guest





PostPosted: Fri Aug 29, 2003 4:18 pm    Post subject: Re: Update to program Reply with quote



Wade schrieb:
Quote:
I am wondering what is the best way to update your software programs. I
know there was discussion before about this, but I cannot seem to find
anything on that. What I would like to do is update my exe file without
have to download the whole file. I am also looking to do this from the
internet for the customers. Does anyone have suggestions on this. I am
sure this is common for people to do.

There is a linux programme called patch that can do something like this.

Yours,
--
Robert Bienert <robertbienert
[simply replace the <AT> with an @ and everything is alright]

Check also my free software at http://www.rbprogs.de.vu/

the daily fortune (Codecentral #20489):

Q: Why was Stonehenge abandoned?
A: It wasn't IBM compatible.


Back to top
Ingvar Nilsen
Guest





PostPosted: Fri Aug 29, 2003 6:17 pm    Post subject: Re: Update to program Reply with quote

Alan Garny wrote:

Quote:
I have managed to implement a working solution, but I am afraid it
involves downloading the whole file at the moment. I guess I
haven't (yet?) bothered with compressing the file, because it would
mean that I have to compress it before uploading it onto my web
server (I am kind of lazy).

I have written a solution we use, almost like yours.
The content is zipped, because the download becomes smaller, and even
more important, a directory structure can be maintained.
Works for updating a single file, a help file for example, to the entire
applications with warts and all.

The update function is embedded in the executable itself, so bu
updating, the update function can also be updated if needed :)

Don't use a batch file, I use a small pure Win32 executable about 16 Kb.

Quote:
I have been using this for quite some time and that works like a gem
and is totally transparent to the user.
Same her, although I close down the main app, let the small EXE replace

the main app and fire up the main app again.
When only help files and the like are updated, there is no need to
restart the main app.

I detest writing utilities like this, because normally professional
installers etc. are much better. But in this case I just could not find
anything simple and useful enough.

I also have to mention that the user is prompted before this, and she/he
is presented with a message (instantly downloaded) which describes the
update, what it contains and the need for updating.

Quote:
Cheers, Alan.

Skål!!

--
Ingvar Nilsen



Back to top
Wade
Guest





PostPosted: Fri Aug 29, 2003 6:38 pm    Post subject: Re: Update to program Reply with quote

Thank you two for your responses. I may have more questions, because that
is probably what I will do, is to right my own solution to implement this.


"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Alan Garny wrote:

Quote:
I have managed to implement a working solution, but I am afraid it
involves downloading the whole file at the moment. I guess I
haven't (yet?) bothered with compressing the file, because it would
mean that I have to compress it before uploading it onto my web
server (I am kind of lazy).

I have written a solution we use, almost like yours.
The content is zipped, because the download becomes smaller, and even
more important, a directory structure can be maintained.
Works for updating a single file, a help file for example, to the entire
applications with warts and all.

The update function is embedded in the executable itself, so bu
updating, the update function can also be updated if needed :)

Don't use a batch file, I use a small pure Win32 executable about 16 Kb.

Quote:
I have been using this for quite some time and that works like a gem
and is totally transparent to the user.
Same her, although I close down the main app, let the small EXE replace

the main app and fire up the main app again.
When only help files and the like are updated, there is no need to
restart the main app.

I detest writing utilities like this, because normally professional
installers etc. are much better. But in this case I just could not find
anything simple and useful enough.

I also have to mention that the user is prompted before this, and she/he
is presented with a message (instantly downloaded) which describes the
update, what it contains and the need for updating.

Quote:
Cheers, Alan.

Skål!!

--
Ingvar Nilsen




Back to top
Leo Saguisag (Borland)
Guest





PostPosted: Fri Aug 29, 2003 8:10 pm    Post subject: Re: Update to program Reply with quote

"Wade" <wthorson> wrote

Quote:
I am wondering what is the best way to update your software programs. I
know there was discussion before about this, but I cannot seem to find
anything on that. What I would like to do is update my exe file without
have to download the whole file. I am also looking to do this from the
internet for the customers. Does anyone have suggestions on this. I am
sure this is common for people to do.

If you're interested in a commercial solution, I believe InstallShield has
an "Update Service" product that you may want to look into. The
InstallShield website is at http://www.installshield.com/

Another tool you may want to try looking at is RTPatch.



Back to top
Alan Garny
Guest





PostPosted: Fri Aug 29, 2003 8:45 pm    Post subject: Re: Update to program Reply with quote

"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Alan Garny wrote:
Quote:
I have managed to implement a working solution, but I am afraid it
involves downloading the whole file at the moment. I guess I
haven't (yet?) bothered with compressing the file, because it would
mean that I have to compress it before uploading it onto my web
server (I am kind of lazy).
I have written a solution we use, almost like yours.
The content is zipped, because the download becomes smaller, and even
more important, a directory structure can be maintained.
Works for updating a single file, a help file for example, to the entire
applications with warts and all.

Interesting... I have a few questions for you if you don't mind...

I also thought of adding features to maintain a directory structure, but I
was wondering how to deal with files that have been removed or modified (in
case you distribute some editable files, for instance).

Otherwise, I know that everything else (e.g. help file), I have them bundled
into the application. The idea is to have the whole contents of my
application in one executable file. Makes it easier if someone wants to run
my app without having to install it: just give him/her one file and voila.

Quote:
The update function is embedded in the executable itself, so bu
updating, the update function can also be updated if needed Smile

Yes, same here. Can be useful indeed.

Quote:
Don't use a batch file, I use a small pure Win32 executable about 16 Kb.

Am I correct in saying that your small exe is bundled into your application?
What do you with it once you are fully done with the updating? Does it self
delete?

Does your small exe contains an unzipper? I have tried to look for something
that could unzip without having to install at least one DLL. The other
solution would be to have a self extracting exe, but the solutions that I
have seen always ask you where to extract, which is not really convenient...

Quote:
I have been using this for quite some time and that works like a gem
and is totally transparent to the user.
Same her, although I close down the main app, let the small EXE replace
the main app and fire up the main app again.
When only help files and the like are updated, there is no need to
restart the main app.

I detest writing utilities like this, because normally professional
installers etc. are much better. But in this case I just could not find
anything simple and useful enough.

Yes, same here. But in my case, what also motivated me is that my app is
open source, so cannot have any commercial bit as part of it, since I also
release the source code...

Quote:
I also have to mention that the user is prompted before this, and she/he
is presented with a message (instantly downloaded) which describes the
update, what it contains and the need for updating.

Pretty obvious thing to do... <g> Having said that, I haven't done it (yet),
as the rest of my app is still at the development stage...

Cheers, Alan.




Back to top
Alan Garny
Guest





PostPosted: Fri Aug 29, 2003 9:37 pm    Post subject: Re: Update to program Reply with quote

"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Quote:
Alan Garny wrote:
Don't use a batch file, I use a small pure Win32 executable about
16 Kb.
Am I correct in saying that your small exe is bundled into your
application?
Yes, the small exe is installed together with the main EXE, and resides
in the program dir throughout the apps life time.

Argh... I don't like that... but then again, that's just me... :)

At least, I am "happy", I thought I had missed the way to self delete an
executable...

Quote:
Does your small exe contains an unzipper?
No, the main app does. Actually, the main app takes care of the entire
update process. The only thing it can't do is to replace itself. So
when everything is unzipped it calls the small EXE and says:" Hey,
please kill me and replace me with my successor"

Yes, makes sense indeed...

Quote:
I have tried to look for something that could unzip without having
to install at least one DLL.
Abbrevia, open source now.

Interesting. Will have a look into that.

Quote:
I know that everything else (e.g. help file), I have them bundled into
the application. The idea is to have the whole contents of my
application
in one executable file. Makes it easier if someone wants to run my
app without having to install it: just give him/her one file and
voila.
Technically a fancy solution, administratively IMO a bad bad
solution Smile

What do you mean?

Cheers, Alan.



Back to top
Alan Garny
Guest





PostPosted: Sat Aug 30, 2003 1:06 am    Post subject: Re: Update to program Reply with quote

"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Alan Garny wrote:

Quote:
Technically a fancy solution, administratively IMO a bad bad solution
Smile
What do you mean?
Tucking additional files away inside the EXE and then ejecting them at
runtime is not a good idea IMO. Possible sources for errors.
In a self-extracting EXE, yes, but not into the main applications
executable.

Ok, maybe I am being a thick here (but then again, it's pretty late where I
am), but in what respect can this be a source of error? Basically, the way I
do it and that all I need is put into a resource, which is linked to the exe
during the compilation process. Then when running the app, the first thing I
do is to extract all the stuff from the exe. Technically speaking, I really
don't see why it could be a source of error.

Otherwise, in b.p.d.nativeapi, there has been a discussion about checking
whether one is connected to the internet. I was wondering: how do you check
that? I mean that surely, you must check it out in some way or another
before downloading an update, no?

My solution, so far, is to check whether one can connect to the Microsoft
(yes, I know... Smile) web site. If I can, then I assume I am connected to the
internet. For this, I use InternetOpen and InternetOpenURL. Obviously, this
may be a problem for those who have a dialup connection and particularly for
those who have a dial on demand connection. This said, 1) that should only
apply to a tiny proportion of my users (less than 1% I would think) and 2) I
don't know of a better to check whether one is connected to the internet or
not. Someone mentioned looking at the INetConnection interface, which I knew
about, but that only works with Windows XP and Server 2003. So, not really
an option unfortunately...

Cheers, Alan.



Back to top
Ingvar Nilsen
Guest





PostPosted: Sat Aug 30, 2003 1:38 am    Post subject: Re: Update to program Reply with quote

Alan Garny wrote:

Quote:
Ok, maybe I am being a thick here (but then again, it's pretty late
where I am), but in what respect can this be a source of error?

OK, only seen from an administrative viewpoint. Not technically.
Imagine you need to supply several files, different versions to
different customers, it is much easier to check "loose" files than those
compiled into the EXE. Apart from that, your solution is absolutely ok!

Quote:
Technically speaking, I really don't see why it could be a source of
error.
And it is not.


Quote:
Otherwise, in b.p.d.nativeapi, there has been a discussion about
checking whether one is connected to the internet. I was wondering:
how do you check that?

By using TIdHttp inside a try-except block.

Quote:
I mean that surely, you must check it out in some way or another
before
downloading an update, no?
Se above.


Quote:
My solution, so far, is to check whether one can connect to the
Microsoft (yes, I know... Smile)

LOL!! I *knew* that website could be used for something meaningful <g>


--
Ingvar Nilsen



Back to top
Alan Garny
Guest





PostPosted: Sat Aug 30, 2003 2:36 am    Post subject: Re: Update to program Reply with quote

"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Quote:
Alan Garny wrote:
Ok, maybe I am being a thick here (but then again, it's pretty late
where I am), but in what respect can this be a source of error?
OK, only seen from an administrative viewpoint. Not technically.
Imagine you need to supply several files, different versions to
different customers, it is much easier to check "loose" files than those
compiled into the EXE. Apart from that, your solution is absolutely ok!

And now that I know what your concern is with my solution, I would say that
my solution is even perfect, since it is the same version for all my users,
no matter what... Smile Indeed, that's a scientific program which is open
source, so no customised version required. Besides, everything is given away
(including the source code), so...

Quote:
Technically speaking, I really don't see why it could be a source of
error.
And it is not.

Glad to read that. I thought for a second I had overlooked something
trivial...

Quote:
Otherwise, in b.p.d.nativeapi, there has been a discussion about
checking whether one is connected to the internet. I was wondering:
how do you check that?
By using TIdHttp inside a try-except block.

Hmm... interesting... I hadn't thought of that. Just out of interest, have
you tried it with different types of internet connection (i.e. LAN, ADSL,
modem, etc.)? The only concern I have is for the modem case, particularly
when the user has dial on command...

Quote:
My solution, so far, is to check whether one can connect to the
Microsoft (yes, I know... Smile)
LOL!! I *knew* that website could be used for something meaningful

Yes, probably the only one! :)



Back to top
Ingvar Nilsen
Guest





PostPosted: Sat Aug 30, 2003 8:40 am    Post subject: Re: Update to program Reply with quote

Alan Garny wrote:

Quote:
Hmm... interesting... I hadn't thought of that. Just out of interest,
have you tried it with different types of internet connection
(i.e. LAN, ADSL, modem, etc.)? The only concern I have is for the
modem case, particularly when the user has dial on command...

Yes, has been tested and runs ok on LAN, ISDN, ASDL and modems. The only
thing I haven't given much attention is dial on command.
You could test it yourself, just create a TIdHttp, invoke Get() and see
what happens. Wonder whether it will trigger the dial procedure or not?

--
Ingvar Nilsen



Back to top
Ingvar Nilsen
Guest





PostPosted: Sat Aug 30, 2003 10:58 am    Post subject: Re: Update to program Reply with quote

Alan Garny wrote:

Quote:
Otherwise, I had a quick look at TIdHTTP and was able to download text
and binary files. Works nice indeed. However, it seems that unless
I start a proper download (using the Get function), there is no
way for me to know about the size of a file. Is that correct?

No. Well..no Smile
Set an event handler to the OnWorkbegin, it has a parameter giving you
the total size of the file. I use this to set gauge max properties.

Quote:
but if I can do everything with TIdHTTP, that would be best...
You can. But it should still come with a wrapper, IMO, it still is a

little "raw".

I have written a wrapper (an Interface actually) around it, that I use
absolutely all the time, it has multipart form fields and also querys
its owner whether it supports a few other interfaces I wrote, namely an
error interface and an info interface.
By doing it this way, I can use my TIdHttp wrapper absolutely everywhere.

Does the owner (Usually a TForm, often the main form) support my error
interface? Ok, a errormessage is displayed when something crashes.
Otherwise it keeps quiet.

Does the owner support my gauge interface? Ok, my wrapper will invoke
event handlers with appropriate data to move a gauge. Otherwise it
doesn't bother with it and drinks a cup of tea instead :)

You see, that is the beauty of interfaces, I never give TIdHttp a
thought anymore, just use the wrapper everywhere, it is so versatile!
And the day I want to replace Indy with Overbyte's (Piette) HttpCli, my
application doesn't even have to know about it, because the
implementation is completely isolated and hidden!

Quote:
Cheers

Skål!

--
Ingvar Nilsen



Back to top
Alan Garny
Guest





PostPosted: Sat Aug 30, 2003 11:40 am    Post subject: Re: Update to program Reply with quote

"Ingvar Nilsen" <telcontr@[Remove-This-Part]online.no> wrote

Alan Garny wrote:
Quote:
Otherwise, I had a quick look at TIdHTTP and was able to download text
and binary files. Works nice indeed. However, it seems that unless
I start a proper download (using the Get function), there is no
way for me to know about the size of a file. Is that correct?
No. Well..no Smile
Set an event handler to the OnWorkbegin, it has a parameter giving you
the total size of the file. I use this to set gauge max properties.

Yes, that's what I have done. Yet, this means that the download has
started... In other words, you get OnWork events and an OnWorkEnd in the
end. Not really a neat solution if one ONLY wants to know about the size of
a remote file.

Quote:
but if I can do everything with TIdHTTP, that would be best...
You can. But it should still come with a wrapper, IMO, it still is a
little "raw".

I totally agree with you on that. In fact, as you said after that, I would
simply use the skeleton I already have. The only difference is that the job
would be done by TIdHTTP instead of calling Wininet functions...

Cheers, Alan.




Back to top
Ingvar Nilsen
Guest





PostPosted: Sat Aug 30, 2003 12:08 pm    Post subject: Re: Update to program Reply with quote

Alan Garny wrote:

Quote:
started... In other words, you get OnWork events and an OnWorkEnd in
the end. Not really a neat solution if one ONLY wants to know
about the size of a remote file.
Ok, I realize, hm.. there must be a way.

Maybe Indy can do it after all, myself I never had the need for it.
I use a .Net application at the other end, which can give me all data I
need, also the size of the update. I wrote that as well.

--
Ingvar Nilsen



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.