Jump to content

Update a running program


Recommended Posts

This is what I my program to do:

Have my script download the newest version of the the program: I can do that

Replace the currently running .exe with the downloaded one: Won't work because the currently running one can't be deleted

Run the new .exe: I can get that too

The way I'm thinking of doing it now is using FileInstall with an .exe file that is meant solely for updating the program... However, that would mean an extra 500kb to my file size which I don't think I need. Is there a way to do this with the cmd or something?

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

@Achilles...I ran into the same scenario one time and what I did was I created a separate script named "Update Manager". Once you launched any of my scripts it would launch Update Manager in the back-end and check for updates. If new updates were found then it would kill that running program and download/overwrite that program. Once that was complete it would launch the program back up again.

:P

Link to comment
Share on other sites

I just made this.

Create this in a batch file (filename.bat).

@ECHO OFF

:Label1
IF %starttime%==16:08 GOTO Label2
ping -n 5 localhost

for /f "tokens=1 delims=: " %%h in ('time /T') do set hour=%%h
for /f "tokens=2 delims=: " %%m in ('time /T') do set minutes=%%m

set starttime=%hour%:%minutes%

GOTO Label1

:Label2
ECHO Now updating program..

This bit: 16:08 is ofcourse the hardcoded hours:minutes that the batch ends. When it ends, let the batch run you (new?) script.

<!- Edit: harcoded I mean: create this time with your script and hardcode it into the batch file -!>

To put this simply, this batch waits until a certain hour:minute period passes.

The ping command is to sit out time. There is no real sleep command.

Ofcourse run this batch hidden :P

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...