Posts: 102
Threads: 30
Joined: Mar 2018
05-22-2018, 01:19 AM
(This post was last modified: 05-22-2018, 02:20 AM by InterestedNewbie.)
The following probably needs and If Else statement but I'm not sure how to implement it (and where)....
The script is closing App1 and then it is starting App2.
If App2 is not found on the user's computer App1 will be restarted.
ShutDownProcess("app1")
1
run "$program files$\Apps\app2.exe"
1
OnScreenDisplay "app2 is not installed, launching app1" 2.5
3
run "$program files$\Apps\app1.exe"
Posts: 117
Threads: 5
Joined: Nov 2015
Macro
If_Else_Test
;Assuming app1 is "notepad", you could try this:
int w=win("" "notepad")
ShutDownProcess(w)
if (FileExists("$program files$\Apps\app2.exe")=0)
,OnScreenDisplay "app2 is not installed, launching app1" 5
2 ;; wait for 2 seconds
run "C:\Windows\System32\notepad.exe"
Posts: 1,336
Threads: 61
Joined: Jul 2006
05-22-2018, 11:48 PM
(This post was last modified: 05-23-2018, 12:11 AM by Kevin.)
another way use flag 0x100(dont show error message box) then use err to handle the error and launch app1
run "$Program Files$\Apps\app2.exe" "" "" "" 0x100
err
,1
,OnScreenDisplay "app2 is not installed, launching app1" 2.5
,3
,run "$Program Files$\Apps\app1.exe" "" "" "" 0x100
Posts: 102
Threads: 30
Joined: Mar 2018
Thanks! This is very interesting.
It's good to have more options I will experiment with both.