-
March 15th, 2011, 02:58 PM
#1
overwriting a file
Hi, iv made a updater which seems to work until it gets to the part where i have to download the new version of the program
could someone please show me how i can replace an existing file, then close the program and automatically open the file which has just been downloaded?
any help would be great
Ben
-
March 15th, 2011, 02:59 PM
#2
Re: overwriting a file
Call a SECOND program, to close the first, and apply the update. It can check each time you start or exit the program
-
March 15th, 2011, 03:08 PM
#3
Re: overwriting a file
ooo ok thanks
is there no way to do within one program?
also how can i replace the existing file? when the updater runs it checks for the update then if needed downloads it. however if the file already exists in the folder and i get an error saying "could not complete operation since a file already exists in this path"
-
March 15th, 2011, 04:02 PM
#4
Re: overwriting a file
After you download it, you can delete the old one, as long as you're sure the new one will work. Maybe even MOVE it out of the program path, into a backup folder telling the date/version, as the filename will be the same for all files.
-
March 17th, 2011, 09:37 AM
#5
Re: overwriting a file
Did you know that you are able to rename a program file either manually, or by program command, even though it is running
eg, MyProg.exe can be renamed to MyProg.old while it is running
Code:
Name "C:\MyProg.exe " As "C:\MyProg.old"
This will then allow you to copy a new version of MyProg.exe which will be run next time the user starts up the program
-
March 17th, 2011, 01:55 PM
#6
Re: overwriting a file
all sorted now thanks
-
March 18th, 2011, 02:25 AM
#7
Re: overwriting a file
Mark your thread resolved please
-
March 21st, 2011, 12:31 AM
#8
Re: overwriting a file
Originally Posted by George1111
Did you know that you are able to rename a program file either manually, or by program command, even though it is running
eg, MyProg.exe can be renamed to MyProg.old while it is running
Code:
Name "C:\MyProg.exe " As "C:\MyProg.old"
This will then allow you to copy a new version of MyProg.exe which will be run next time the user starts up the program
Really? I did not know that. I assumed the program would be locked against rename as well. I'll have to give it a try, could have it's uses.
Always use [code][/code] tags when posting code.
-
March 21st, 2011, 01:33 AM
#9
Re: overwriting a file
Win7 loads programs into memory
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
|