Interesting question

D

Dino M. Buljubasic

I have two applications App1 and App2.

App1 is just checking for new version of App2.

If it finds newer version of App2 it will download App1 AND App2. (both of
them). That is what I am doing now in my application.

I am downloading from an FTP server and I can see download progress.
However, when the download is finished, App1 is not updated (which I
understand, because its file is being locked in the process of update).
(don't ask me why I download App1 then :)).

So, I can watch the download process of both App1 and App2, the App2 gets
updated (because it was not locked), App1 does not get updated (probably
because it was locked during the download).

My question is "If I can see download progress, what happens with the update
of App1?" Should not this pop up the warning box saying "File Access
Denied"? In my case it does not. Everything looks like it is downloading
App1 and overwriting it but when I run the code, I can see that what runs is
actually old App1.

Just an interesting thing, wondering what actuallly happens with the file
being downloaded.

Thank you,
 
C

Cor

Dino,
This depends on your FTP process.
But this will of course never work
I think that the solution is as in all this cases to download it with
another name.
Putting in the register that it is new downloaded (that is my way doing it,
but it can be another way too of course).
Give the command over to the downloaded program.
Look in the register, copy the newone over the old one (renaming does not
work either)
Set the register back.
And give then the command back to that new one.
If you will kill the downloaded copied file is a matter of taste, I would
leave it.

I hope this brings you on the route.
Cor
 
D

Dino M. Buljubasic

When you say "Registar", are you thinking of registry? Sorry, don't get it.

I am probably going to do it so that App1 downloads App2 and App downloads
App1. that way, they'll download each other because they never run at the
same time.

However, I still don't understand what happens with the file that is
downloaded. It gets sent thru the wires for sure, I am just wondering what
OS or whatever does with it when it finds out that the file with the same
name already exists and that it is running.

Thanks,
 
C

Cor

Hi Dino,
Yes I did mean registry (language error).
To find out what happens, is very easy to test.
Make a copy of a program
Start the program and try to copy the one you did copy over the running one
with explorer.
You normaly will see a text that it is impossible.
So that will throw an exeption in your program.
Cor
 
D

Dino M. Buljubasic

I don't get any exception though. It just shows that the file is being
downloaded but when I run it, the old version pops up
 
C

Cor

I was thinking, do you have maybe a Try that you don't real Catch with an
exception.
I could make that mistake, you of course not, but still I ask it.
 
R

ramki rao

why don't you let start the app2 after app1 and let app2 replace/update
app1? since app1 is replacing app2, let app2 replace app1 ..just a thought
:)
 
D

Dino M. Buljubasic

Yes, I came to the idea as well. That will probably be the way to go.

Thanks,
 
F

Fergus Cooney

Hi Dino,

Yet the mystery remains - where does the App1 download go? One to tell
your grandchildren :-

Grandad Dibno:
[hushed and serious] "And I downloaded it again and again" ...
[suspensuful pause] ... "and nobody knows where it disappeared!!"

Children
[gasp] "Ooooh"

Regards,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top