diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt
index 459a81001b76b77c40208f9753b6efd004399866..c57166b36c2674e37fb367e09b7fd54023a1190b 100644
--- a/DDG4/CMakeLists.txt
+++ b/DDG4/CMakeLists.txt
@@ -149,7 +149,9 @@ target_link_libraries(g4FromXML DDG4)
 file(GLOB DDG4_python python/*.py python/*.C)
 install(FILES ${DDG4_python} DESTINATION ${DD4HEP_PYTHON_INSTALL_DIR})
 
-install(PROGRAMS python/DDSim/bin/ddsim.py DESTINATION bin RENAME ddsim)
+get_filename_component(PYTHON_INTERPRETER_BINARY ${Python_EXECUTABLE} NAME)
+configure_file(python/DDSim/bin/ddsim.in.py ${CMAKE_BINARY_DIR}/bin/ddsim @ONLY)
+install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/ddsim DESTINATION bin)
 
 install(PROGRAMS python/bin/checkOverlaps.py DESTINATION bin RENAME checkOverlaps)
 install(PROGRAMS python/bin/checkGeometry.py DESTINATION bin RENAME checkGeometry)
diff --git a/DDG4/python/DDSim/bin/ddsim.py b/DDG4/python/DDSim/bin/ddsim.in.py
old mode 100755
new mode 100644
similarity index 94%
rename from DDG4/python/DDSim/bin/ddsim.py
rename to DDG4/python/DDSim/bin/ddsim.in.py
index 20b9b528499f465c883ddc233f138da22386c95d..ce20d73b748bbf64c0d61cd9981c83f353c27e3b
--- a/DDG4/python/DDSim/bin/ddsim.py
+++ b/DDG4/python/DDSim/bin/ddsim.in.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON_INTERPRETER_BINARY@
 """
 
 DD4hep simulation with some argument parsing