Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Else question
#1
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.

Code:
Copy      Help
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"
#2
Macro If_Else_Test
Code:
Copy      Help
;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"
#3
another way use flag 0x100(dont show error message box) then use err to handle the error and launch app1

Code:
Copy      Help
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
#4
Thanks! This is very interesting.

It's good to have more options I will experiment with both.


Forum Jump:


Users browsing this thread: 1 Guest(s)