473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

application self update without restarting computer

Hi,

I would like to make my application to automatically
check on updates from a source and if any, downloads it
and automatically updates itself with the new version.
Now because the application itself is running, I cannot
update the executable immediately, but need to request a
restart of the computer to automatically update itself.
Does anyone know how I can update the application without
having to restart the computer but is still transparent
to the user that the update is automatic?

Thanks!
Nov 22 '05 #1
3 4856
Elp
Hi Nick,

"Nick" <yk****@usc.edu> wrote in message
news:06****************************@phx.gbl...
Does anyone know how I can update the application without
having to restart the computer but is still transparent
to the user that the update is automatic?


There is a very interesting solution to do exactly what you want described
here:
http://windowsforms.net/articles/appupdater.aspx

Basically, the idea is that, instead of updating the application itself,
they make a copy of the running application, update this copy (this can be
done while the user uses the application as normal as the original remains
untouched) and the next time the user launch the application, the updated
copy is launched instead of the original. But all is very clearly desbribed
in this page.

They even have implemented this solution so you can download and use their
component "as it" or just use that idea to develop your own custom updater
component (which should be not very hard to do).
Nov 22 '05 #2
Take a look at the following:
http://msdn.microsoft.com/vbasic/usi...ml/updater.asp
(watch wrap)

that is for the new application updater block from microsoft. there is
also another older version that was created by a different author on
gotdotnet.com called dotnetupdater. i use this version and it kind of
seems buggy sometimes if you don't do everything perfectly.

the updater application block is a little more tricky to get the hang
of but has ALOT more functionality/security when updating apps, plus
you can extend functionality of the application block to run your own
methods after update.

"Nick" <yk****@usc.edu> wrote in message news:<06****************************@phx.gbl>...
Hi,

I would like to make my application to automatically
check on updates from a source and if any, downloads it
and automatically updates itself with the new version.
Now because the application itself is running, I cannot
update the executable immediately, but need to request a
restart of the computer to automatically update itself.
Does anyone know how I can update the application without
having to restart the computer but is still transparent
to the user that the update is automatic?

Thanks!

Nov 22 '05 #3
> I would like to make my application to automatically
check on updates from a source and if any, downloads it
and automatically updates itself with the new version.
Now because the application itself is running, I cannot
update the executable immediately, but need to request a
restart of the computer to automatically update itself.
Does anyone know how I can update the application without
having to restart the computer but is still transparent
to the user that the update is automatic?


I did this several years ago for DOS, but here is the idea:
use a small application to start the big one

Let's say we have small.exe and big.exe

small.exe (pseudocode)

do {
if( exists( big.exe.new ) ) {
rename big.exe, big.exe.bak
rename big.exe.new, big.exe
}
exit_code = start_and_wait( big.exe );
} while( exit_code == restart ) {
big.exe ( pseudocode )

main() {
if( exists codedump )
load_all_data_structures( coredump );
else
init_all_data_structures();
run_the_thing();
}

periodic_check_for_new_version() { // using a timer or what you want
if( exists new_version ) {
download( new_version );
if( check_CRC( new_version ) == OK ) {
dump_all_data_structures( coredump );
fast_exit( restart );
}
else {
delete( new_version ); // bad CRC, risky!
}
}
}

=============================

I was able do dump/load the complete data structures.
Even more, in fast_exit I was not erasing the screen, then when
the application started with coredump, I just loaded all data
and went ahead. You did not see it change. The only thing: I had
a clock showing the seconds, and sometime you can see it skeeping
a second.
Other small trick: after downloading the new application and
checking the CRC I just set a flag. Then I wait to have no input
from the user for a while before coredump & fast_exit
(assuming that if the user did not care about my app. for 5 minutes,
I will not need it in the next 2 seconds, while I coredump and coreload).

This is the main idea. Sure, if load_all_data_structures fails
you have to call init_all_data_structures, if it succeeds you delete the
coredump). With Windows you can use other systems instead of exit code
(registry keys, the fact that the coredump exists, semaphores, etc)

May not be the best way, but the application is still running
(for the last 9 years)

Mihai
Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Zhang | last post by:
My project uses Python-2.3.4 + Tkinter + PIL-1.1.4 to retrieve images from server and display those images. I created a thread (also a separate toplevel window) for displaying images and another...
15
by: Ralf W. Grosse-Kunstleve | last post by:
****************************************************************************** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html...
0
by: Shankar | last post by:
The system occasionally comes up with an error message saying Application Restarting ASP_0147. Is there anyway to stop this error from happening. Once this happens the whole session is lost....
3
by: Nick | last post by:
Hi, I would like to make my application to automatically check on updates from a source and if any, downloads it and automatically updates itself with the new version. Now because the...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
1
by: localhost | last post by:
In the Application_OnStart, I make some data calls and place the results in the HTTP cache. Sometimes, the database is not available when the application starts up, so I want to sleep for 20...
6
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application...
7
by: GTi | last post by:
Does anyone have any good code for a self restarting application? Sometimes I need to exit my application and start it again, what is the best method of doing this in a windows form application....
3
by: mamin | last post by:
My application works under IIS 5.1 and is connected with oracle 9.2 database. After a few days of working it starts to work slower aned slower. I've checked connections with database if they are...
1
by: davidmurray1 | last post by:
I have a C++ app on my flash drive that i am running, but often times, i must take the flash drive out of the computer and use it elsewhere while the executable continues to run. however, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.