File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import sys
10
10
import traceback
11
+ from os .path import expandvars
11
12
from pathlib import Path
12
13
from shutil import which
13
14
from subprocess import Popen
@@ -43,7 +44,17 @@ def get_webots_parameters() -> tuple[Path, Path]:
43
44
if sys .platform == "darwin" :
44
45
webots = "/Applications/Webots.app/Contents/MacOS/webots"
45
46
elif sys .platform == "win32" :
46
- webots = "C:\\ Program Files\\ Webots\\ msys64\\ mingw64\\ bin\\ webotsw.exe"
47
+ possible_paths = [
48
+ "C:\\ Program Files\\ Webots\\ msys64\\ mingw64\\ bin\\ webotsw.exe" ,
49
+ expandvars ("%LOCALAPPDATA%\\ Programs\\ Webots\\ msys64\\ mingw64\\ bin\\ webotsw.exe" ),
50
+ ]
51
+ for path in possible_paths :
52
+ if Path (path ).exists ():
53
+ webots = path
54
+ break
55
+ else :
56
+ print ("Webots executable not found." )
57
+ raise RuntimeError
47
58
elif sys .platform .startswith ("linux" ):
48
59
possible_paths = ["/usr/local/bin/webots" , "/usr/bin/webots" ]
49
60
for path in possible_paths :
You can’t perform that action at this time.
0 commit comments