Repository navigation
Expand file tree
/
Copy pathNeuralScreen.vbs
More file actions
65 lines (56 loc) · 2.3 KB
/
Copy pathNeuralScreen.vbs
File metadata and controls
65 lines (56 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
' NeuralScreen.vbs - a hidden launcher (no console windows)
' Runs main.py through pythonw.exe (runtime/pythonw.exe or from PATH);
' all output goes into NeuralScreen.log next to the program.
Option Explicit
Dim fso, shell, dir, py, nvruntime, devpython
Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
dir = fso.GetParentFolderName(WScript.ScriptFullName)
' --- Finding Python: NEURALSCREEN_PYTHON -> runtime\pythonw.exe -> dev path -> PATH ---
py = shell.ExpandEnvironmentStrings("%NEURALSCREEN_PYTHON%")
If py = "%NEURALSCREEN_PYTHON%" Then py = ""
If py <> "" And Not fso.FileExists(py) Then py = ""
If py = "" Then
nvruntime = dir & "\runtime\pythonw.exe"
If fso.FileExists(nvruntime) Then py = nvruntime
End If
If py = "" Then
' fallback: pythonw from PATH (if the user installed Python)
py = "pythonw"
End If
' --- Python check: launching blind without it means a silent failure ---
If py = "pythonw" Then
Dim found
found = False
Dim pathVar, parts, part
pathVar = shell.ExpandEnvironmentStrings("%PATH%")
parts = Split(pathVar, ";")
For Each part In parts
If part <> "" And fso.FileExists(part & "\pythonw.exe") Then
found = True
Exit For
End If
Next
If Not found Then
MsgBox "NeuralScreen: pythonw.exe not found." & vbCrLf & _
"Install Python or unpack the release archive (it bundles a portable runtime).", _
16, "NeuralScreen"
WScript.Quit 1
End If
End If
' --- NGX runtime check (165 MB, not kept in git) ---
If Not fso.FileExists(dir & "\native\nvngx_dlssnr.dll") Then
MsgBox "NeuralScreen: native\nvngx_dlssnr.dll not found." & vbCrLf & _
"Copy the NVIDIA DLSS 5 Neural Rendering runtime there." & _
"See README.md, section Requirements.", 16, "NeuralScreen"
WScript.Quit 1
End If
' --- Worker check (a build artefact) ---
If Not fso.FileExists(dir & "\native\nvngx.dll") Then
MsgBox "NeuralScreen: native\nvngx.dll not found." & vbCrLf & _
"Build it with native\build-host.bat or re-download the release archive.", _
16, "NeuralScreen"
WScript.Quit 1
End If
' --- Launch with no window (window style 0), without waiting ---
shell.Run """" & py & """ -u """ & dir & "\main.py""", 0, False