473,748 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

over write running .exe

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.??
Feb 3 '06 #1
3 1927
BobAchgill wrote:
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.??


Impossible, you can't overwrite files that are in use (be it
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
Feb 6 '06 #2
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 FileSystemWatch er 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/de...ClassTopic.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/de.../updaterv2.asp

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"BobAchgill " <Bo********@dis cussions.micros oft.com> wrote in message
news:DA******** *************** ***********@mic rosoft.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.??
Feb 6 '06 #3
Jay B. Harlow [MVP - Outlook] wrote:
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 FileSystemWatch er 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/de...ClassTopic.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/de.../updaterv2.asp


Wow.. you learn something new every day :) I was quite unaware of this.
--
Rinze van Huizen
C-Services Holland b.v
Feb 8 '06 #4

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

Similar topics

54
6572
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO FRICKIN' COOL!!! ***MAN*** that would save me a buttload of work and make my life sooooo much easier!" As opposed to minor differences of this feature here, that feature there. Variations on style are of no interest to me. I'm coming at this from a...
5
5325
by: Shalen chhabra | last post by:
Hey, Can anyone give me a snippet for running a python program over all the files in the directory. For ex: I have ten files in a directory and I want to run a python program against all of these files, I wish to do the same using another python code instead of running each of these files one by one, which would be cumbersome giving the argv of each file every single time. This can be easily done using a shell script but I just...
4
16213
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what I've come up with. In this example, there are 5 images (0 thru 4) all with a height of 80px. When you mouse over an image, it changes the growingImage variable equal to the number of the image you mouse over, when you mouse out, it sets it to 5,...
1
2239
by: Neel Word | last post by:
I need to develop an application (development platform: Win2000; target platform: Win98/ME/NT4/2000/XP), which would require file transfer functionality over dial-up and network. We could develop on .NET (1.1 or 1.0 - VS.NET 02/03) or using plain COM (visual c++). We'd prefer .NET though. Does anyone know of any products or COM API (or .NET classes) that can easily handle file transfer over dial-up
3
1956
by: James Stroud | last post by:
Hello All, I am helping someone write a python script to run their DOS application through an SSH terminal. It seems that this program wants to access a DOS shell and send output there. If running remotely, this causes a problem because it locks up the program. The program seems (to me) to be looking for some non-existant DOS shell to send its output to. How might I emulate this shell (or whatever it is) with python? I have tried...
19
4347
by: Mark 123 | last post by:
I just read at http://groups.google.com/group/microsoft.public.access.forms/browse_frm/thread/766ba7b493eacb63/8a7d5504ee848c21?lnk=st&q=migrate+access+97+to+access+2007&rnum=1#8a7d5504ee848c21 that if you have a spilt db using SQL server rather than jet, the front-end's can connect to the backend SQL server over the internet. Has anyone had experience with this? We are thinking of migrating an commercially sold Access97 runtime app to...
3
4109
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where the data is summed over group. But the data is summed over the second group. When a new group begins MyTextBox value is resetting to zero. I need a running sum over the first group so when another second group begins MyTextBox value will
13
3159
by: Godzilla | last post by:
Hello, How do you create/spawn new processes in XP over telnet using python? I.e. I would like to create a new process and have it running in the background... when I terminate the telnet connection, I would what the spawned processes to keep running until I shut it off... I got the os.popen method to spawn a new process running in the backgroun, but not over telnet... tried os.popen and also subprocesses.popen without any luck...
6
1332
by: Beemer Biker | last post by:
I have a C# project VS2005, that uses GridView and Multiview. It is getting bigger then I originally anticipated and running slow and needs to be broken up into several pages (yes, I am a newbie and made it one page) It has been decided to use pintab instead of multiview. I downloaded pintab and it has more vb examples than c#. It is not too late to start over in VB if I wanted to. I googled around and found this discussion about...
0
8994
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
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
9555
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...
1
9329
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,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
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
4607
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
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
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.