|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
over write running .exeI am using FTP built in to my application to update the application and data
from a server... What is the normal method folks use to over write the application while the program is active? What I am running into is that the FTP code will not over write the .exe while the application is running. Do any other types of application extension files have the same issue with not wanting to be updated while the application is running: .dll, etc.?? BobAchgill wrote:
> I am using FTP built in to my application to update the application and data Impossible, you can't overwrite files that are in use (be it > from a server... > > What is the normal method folks use to over write the application while the > program is active? What I am running into is that the FTP code will not over > write the .exe while the application is running. > > Do any other types of application extension files have the same issue with > not wanting to be updated while the application is running: .dll, etc.?? executables, dll or whatever). Maybe you could write a sort of monitoring program that will detect a new upload (to a specified directory), shut down the program, copy/move the new program and start the new version. -- Rinze van Huizen C-Services Holland b.v Bob,
Actually this is very much possible & actually quite easy in .NET. As Rinze suggests normally one cannot "overwrite files that are in use", however .NET has the ability to create a shadow copy of executables, such that you can replace the original executable with the new one. To create a shadow copy of an executable you set the shadow copy option when creating a new AppDomain, then load your executable in this second app domain. This implies that your app has a loader "stub" that creates the app domain & executes your actual program. Using a FileSystemWatcher you could have the AppDomain automatically restarted when a new version of the app is saved (However I would simply inform my user to exit & restart the app). http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOFileSystemWatcherClassTopic.asp In .NET 2.0 (VS 2005) using ClickOnce is one of the easiest ways to implement this app loader/updater. Alternatively (.NET 1.x VS 2003) you can look at the Updater Application Block: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/updaterv2.asp -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "BobAchgill" <BobAchg***@discussions.microsoft.com> wrote in message news:DA686017-2462-428B-815F-D6362AC44737@microsoft.com... |I am using FTP built in to my application to update the application and data | from a server... | | What is the normal method folks use to over write the application while the | program is active? What I am running into is that the FTP code will not over | write the .exe while the application is running. | | Do any other types of application extension files have the same issue with | not wanting to be updated while the application is running: .dll, etc.?? Jay B. Harlow [MVP - Outlook] wrote:
Show quoteHide quote > Bob, Wow.. you learn something new every day :) I was quite unaware of this.> Actually this is very much possible & actually quite easy in .NET. As Rinze > suggests normally one cannot "overwrite files that are in use", however .NET > has the ability to create a shadow copy of executables, such that you can > replace the original executable with the new one. To create a shadow copy of > an executable you set the shadow copy option when creating a new AppDomain, > then load your executable in this second app domain. This implies that your > app has a loader "stub" that creates the app domain & executes your actual > program. Using a FileSystemWatcher you could have the AppDomain > automatically restarted when a new version of the app is saved (However I > would simply inform my user to exit & restart the app). > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOFileSystemWatcherClassTopic.asp > > > > In .NET 2.0 (VS 2005) using ClickOnce is one of the easiest ways to > implement this app loader/updater. > > Alternatively (.NET 1.x VS 2003) you can look at the Updater Application > Block: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/updaterv2.asp > -- Rinze van Huizen C-Services Holland b.v
Dynamic controls, menuitems, windowlist
Advice needed on programming style PropertyBag in VB.NET? PostMessage and Combobox Question about Control Collection in VB.net Allowing access to controls from another thread accessing blob fileds from oracle Cast from string "" to type 'Date' is not valid Accessing controls from another thread project source design question |
|||||||||||||||||||||||