Skip to content

Commit 386eb95

Browse files
committed
Fix support for windows shortcuts
1 parent 80f048e commit 386eb95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/run_simulator.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
if (Path(__file__).parent / 'simulator/VERSION').exists():
2121
print("Running in release mode")
22-
SIM_BASE = Path(__file__).parent
22+
SIM_BASE = Path(__file__).parent.resolve()
2323
else:
2424
print("Running in development mode")
2525
# Assume the script is in the scripts directory
26-
SIM_BASE = Path(__file__).parents[1]
26+
SIM_BASE = Path(__file__).parents[1].resolve()
2727

2828
POSSIBLE_WEBOTS_PATHS = [
2929
("darwin", "/Applications/Webots.app/Contents/MacOS/webots"),
@@ -82,6 +82,8 @@ def main() -> None:
8282
Popen(
8383
[str(webots), str(world_file)],
8484
creationflags=DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP,
85+
# shell=True is needed to run from shortcuts
86+
shell=(webots.suffix == ".lnk"),
8587
)
8688
else:
8789
Popen([str(webots), str(world_file)], start_new_session=True)

0 commit comments

Comments
 (0)