diff --git a/.bin/Scripts/settings/launchers.py b/.bin/Scripts/settings/launchers.py old mode 100644 new mode 100755 index e310c558..93097dcc --- a/.bin/Scripts/settings/launchers.py +++ b/.bin/Scripts/settings/launchers.py @@ -8,6 +8,53 @@ LAUNCHERS = { 'L_TYPE': 'Executable', 'L_PATH': 'd7II', 'L_ITEM': 'd7II.exe', + 'Extra Code': [ + r'rem Pre-d7II safety checks', + r'rem NOTE: This is an ugly hack but it works', + r'', + r':Init2', + r'echo Running safety checks...', + r'set ARCH=32', + r'if /i "%PROCESSOR_ARCHITECTURE%" == "AMD64" set "ARCH=64"', + r'set "AV_REMOVER=%bin%\AVRemover\AVRemover.exe"', + r'set "PYTHON=%bin%\Python\x32\python.exe"', + r'if %ARCH% equ 64 (', + r' set "AV_REMOVER=%bin%\AVRemover\AVRemover64.exe"', + r' set "PYTHON=%bin%\Python\x64\python.exe"', + r')', + r'', + r':PythonChecks', + r'if not exist "%PYTHON%" goto ErrorPythonNotFound', + r'"%PYTHON%" --version >nul || goto ErrorPythonUnsupported', + r'echo Python: OK', + r'', + r':AVCheck', + r'rem Run ESETs AV Removal tool for tech to review', + r'echo Please check for running AV', + r'start "" "%AV_REMOVER%" /wait', + r'echo.', + r'echo Press Enter to Launch d7II...', + r'pause>nul', + r'goto DefineLaunch', + r'', + r':: Pre-d7II Errors', + r':ErrorPythonNotFound', + r'rem Broken Kit', + r'echo.', + r'echo ERROR: The Python executable is missing.', + r'echo This kit is damaged and needs to be rebuilt', + r'goto Abort', + r'', + r':ErrorPythonUnsupported', + r'rem The Windows installation lacks Windows update KB2999226 needed to run Python', + r'echo.', + r'echo ERROR: Failed to run Python, try installing Windows update KB2999226.', + r'echo NOTE: That update is from October 2015 so this system is SEVERELY outdated', + r'if exist "%bin%\..\Installers\Extras\Windows Updates" (', + r' start "" "explorer.exe" "%bin%\..\Installers\Extras\Windows Updates"', + r')', + r'goto Abort', + ], }, 'System Setup': { 'L_TYPE': 'PyScript',