473,800 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4883
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_s tructures( coredump );
else
init_all_data_s tructures();
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_s tructures( 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_s tructures fails
you have to call init_all_data_s tructures, 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
4403
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 thread for recording the frame rates (using a progress bar for visulization). The whole application worked very well once it received image data from the socket. The problem is when I tried to close that display window (click on the standard...
15
2600
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 ****************************************************************************** Hi fellow Python coders, I often find myself writing:: class grouping:
0
1999
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. Since our application is based on session based variables, its causing awful lot of annoyance to the users. The system runs on IIS 5/WIN2000 Server. The application has hundreds of
3
458
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 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...
2
588
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser
1
4139
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 seconds and then restart the entire application. What is the best way to do that? Thanks.
6
4613
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 restarts and all active sessions are terminated. This error is also described in detail here:...
7
26761
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. The reason why I want to this is complicated, so a restart is faster and more easier whey of doing it.
3
1424
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 closed but in Enterprise Menager Console - Instance - Sessions all connections are closed. I've noticed that process aspnet_wp.exe uses more and more memory, maybe this is the reason? Killing this process results in getting my application work...
1
1499
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 executable's behavior is sporadic, and it will disappear. I think the app is calling a DLL that exists in the current directory, but since the flash drive is gone, it can't find it. so, i wanted to know if i could load the executable with all of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.