|
-
Dec 10th, 2005, 12:28 PM
#1
Updating an application
If I create an update to my program and then later on my application downloads the latest version. How can I overwrite the currently running executable with the newer version? Should I create a seperate application that waits until my program is closed and then runs the installation? Is there a better way to do this?
-
Dec 10th, 2005, 12:34 PM
#2
Re: Updating an application
I would go the route of an "updater" program. You could make a flag that is checked when the application exits, and if it knows it has a new version to update, launch that program on exit, and overwrite the file.
Bill
-
Dec 10th, 2005, 01:14 PM
#3
PowerPoster
Re: Updating an application
actually the way i have done it is this:
make a web service where the application can download the latest version.
Once done, it downloads it to the working directory of the application.
THEN all I would do, is update the shortcut on the start menu to point to the NEW version of the application.
thats all!
if you wish to delete the application after a new application version has been downloaded, then simply, at startup, check for any existing application in the program directory/running directory and check the version numbers ... remove them as necessary!
thats the way i did it for my PC server and mobile client application works very well
-
Dec 14th, 2005, 10:02 AM
#4
Re: Updating an application
i never thought of that, clever idea, alternating exe names.. although no good if the user has made their own shortcuts.
I am needing to do this shortly and i was going to approach it this way
[1st instance]
download new exe from server
save file as temp.exe
execute temp.exe (no wait)
terminate
[/end 1st instance]
[2nd instance]
delete original.exe
copy self as original.exe
execute original.exe (no wait)
terminate
[/end 2nd instance]
[3rd instance]
delete temp.exe
continue running as normal
[/end 3rd instance]
-
Dec 14th, 2005, 10:36 AM
#5
Hyperactive Member
Re: Updating an application
In Visual Studio 2005 using the .NET Framework 2.0 there is an Application called ClickOnce. You can use it to deploy your application and it also contains an Updater Functionality.
Check this link to see if it fits your needs:
http://msdn.microsoft.com/smartclien...clickonce.aspx
Heres the FAQ for ClickOnce:
http://www.windowsforms.net/FAQs/def...=24&tabindex=2
HTH,
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Dec 15th, 2005, 04:33 AM
#6
Re: Updating an application
Thanks but I'm using .Net 1.1 so it has a larger user base (for now).
I think I'll create a seperate updating application that waits for exit on my main app and then replace the exe. I need to extra the contents from a zip so I'll have to figure that one out
-
Dec 15th, 2005, 04:46 AM
#7
Hyperactive Member
Re: Updating an application
For zip in .NET 1.1 i always use the Sharp Zip Lib. Lacks some features but its quite easy to use if all you want to do is zip files or extract Files from a zip.
Its free and Open Source.
Heres a link for you.
http://www.icsharpcode.net/OpenSourc.../Download.aspx
HTH,
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Dec 15th, 2005, 06:39 PM
#8
Re: Updating an application
-
Dec 17th, 2005, 02:00 AM
#9
New Member
Re: Updating an application
I've done it a few ways in the past. With a seperate updater program. Downloading the new updates, then using the updater program to restart my application, before it restarts the application delete the old exe and rename the new one.
- Launch Updater Program
- Download Updates
- Shutdown Application
- Rename Files
- Start Application
- Shutdown Updater Program
I've also went as far as creating a bat file, saving it in the startup directory and then restarting the computer, but in your case that might be a little too much.
- Billiard
If you would like me to read your code, please use [code] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|