Jump to content

[Solved]Help with programming Logic


 Share

Recommended Posts

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
Link to comment
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 ~/

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...