Jat421 Posted August 15, 2012 Share Posted August 15, 2012 (edited) Hi, I have a application that runs on users PC and their is a code that check for any updates for that application when it's started. Here is the process 1) Application checks for a update. 2) if there is a update copies the new file to the users desktop and delete the old file. Now that's where I am having the logic issue to delete the old file I have to kill the process first that is running and when I kill the process the whole application closes and the code is not executed to delete the old file. If $VersionNoU > $VersionNo then MsgBox(0, "New Version", "New Version") Filecopy($URL, @UserProfileDir & "\Desktop", 1) Local $list = ProcessList() For $i = 1 To $list[0][0] If StringRegExp($list[$i][0], "^AppName.*$") Then ProcessClose($list[$i][0]) Next $Del = Execute($DelPath) MsgBox(0,"test", $Del) FileDelete($Del) Edited August 16, 2012 by Jat421 Link to comment Share on other sites More sharing options...
mv2112 Posted August 15, 2012 Share Posted August 15, 2012 You could have the program write a batch file to the desktop with the contents: PING 1.1.1.1 -n 1 -w 60000 >NUL del oldapplication start newapplication del %0 And use Run to call the bat right before the program closes There's no place like ~/ Link to comment Share on other sites More sharing options...
topsecret Posted August 15, 2012 Share Posted August 15, 2012 If I were you, I would create a separate script - a starter script. Make it check for updates -> if it finds one, download it overwriting the old one and start that. Link to comment Share on other sites More sharing options...
Jat421 Posted August 16, 2012 Author Share Posted August 16, 2012 Thanks guys!! creating a batch file did the trick! Link to comment Share on other sites More sharing options...
topsecret Posted August 16, 2012 Share Posted August 16, 2012 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now