Sign in to follow this  
Followers 0
Jat421

[Solved]Help with programming Logic

5 posts in this topic

#1 ·  Posted (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 by Jat421

Share this post


Link to post
Share on other sites



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 ~/

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Thanks guys!! creating a batch file did the trick!

Share this post


Link to post
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
Sign in to follow this  
Followers 0