From 5d2d2beef866a68fd015c7d90bf2532580b63a04 Mon Sep 17 00:00:00 2001 From: andrews05 Date: Thu, 14 Mar 2024 16:13:08 +1300 Subject: [PATCH] Handle error when the exe is not at the expected path --- release/TC Launcher (copy to TC folder).vbs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/release/TC Launcher (copy to TC folder).vbs b/release/TC Launcher (copy to TC folder).vbs index 2329c55..322b664 100644 --- a/release/TC Launcher (copy to TC folder).vbs +++ b/release/TC Launcher (copy to TC folder).vbs @@ -2,12 +2,13 @@ On Error Resume Next Set shell = CreateObject("WScript.Shell") evn = shell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\EV Nova.exe\") +If err.number = 0 Then + shell.Run """" & evn & """" +End If + If err.number <> 0 Then response = MsgBox("EV Nova Community Edition r3 or newer is required to use this script." & vbCrLf & vbCrLf & "If you already have this version, try launching it once from its current location before continuing. If you don't have it yet you can download it from:" & vbCrLf & "https://github.com/andrews05/EV-Nova-CE" & vbCrLf & vbCrLf & "Would you like to download EV Nova CE now?", vbYesNo Or vbCritical Or vbDefaultButton2, "Unable to locate EV Nova.exe") If response = vbYes Then shell.Run "https://github.com/andrews05/EV-Nova-CE" End If - WScript.Quit 1 End If - -shell.Run """" & evn & """"