diff --git a/.bin/Scripts/Launch.cmd b/.bin/Scripts/Launch.cmd index 18c304f2..faea56f8 100644 --- a/.bin/Scripts/Launch.cmd +++ b/.bin/Scripts/Launch.cmd @@ -263,6 +263,7 @@ call :ExtractOrFindPath || goto ErrorProgramNotFound set "script=%_path%\%L_ITEM%" rem Verify +"%PYTHON%" --version >nul || goto ErrorPythonUnsupported if not exist "%script%" goto ErrorScriptNotFound rem Run @@ -435,6 +436,16 @@ echo ERROR: Office version not supported by this script. start "" "explorer.exe" "%client_dir%\Office" goto Abort +:ErrorPythonUnsupported +rem The Windows installation lacks Windows update KB2999226 needed to run Python +echo. +echo ERROR: Failed to run Python, try installing Windows update KB2999226. +echo NOTE: That update is from October 2015 so this system is SEVERELY outdated +if exist "%bin%\..\Installers\Extras\Windows Updates" ( + start "" "explorer.exe" "%bin%\..\Installers\Extras\Windows Updates" +) +goto Abort + :ErrorQuickBooksSourceNotFound echo. echo ERROR: QuickBooks source "%L_ITEM%" not found. @@ -486,7 +497,7 @@ echo Press any key to exit... pause>nul rem reset color and reset errorlevel to 0 rem NOTE: This is done to avoid causing a ErrorLaunchCMD in the launcher.cmd -color +color 07 goto Exit :: Cleanup and exit :: diff --git a/.bin/Scripts/functions/setup.py b/.bin/Scripts/functions/setup.py index 684f1de6..970edfe9 100644 --- a/.bin/Scripts/functions/setup.py +++ b/.bin/Scripts/functions/setup.py @@ -5,6 +5,7 @@ from settings.setup import * from settings.sources import * +# Configuration def config_classicstart(): """Configure ClassicStart.""" # User level, not system level @@ -300,6 +301,13 @@ def open_windows_updates(): popen_program(['control', '/name', 'Microsoft.WindowsUpdate']) +def restart_explorer(): + """Restart Explorer.""" + kill_process('explorer.exe') + sleep(2) + kill_process('explorer.exe') + + if __name__ == '__main__': print("This file is not meant to be called directly.") diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 9ea639ce..bd1d5a85 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -67,6 +67,22 @@ def download_to_temp(out_name, source_url): download_generic(global_vars['TmpDir'], out_name, source_url) +def download_windows_updates(): + """Download stand alone Windows Update installers.""" + # Prep + dest = r'{}\Installers\Extras\Windows Updates'.format( + global_vars['BaseDir']) + + + # Download + for kb, v in WINDOWS_UPDATE_SOURCES.items(): + for winver, v2 in v.items(): + for arch, url in v2.items(): + name = 'KB{}-Windows{}-x{}.msu'.format(kb, winver, arch) + if not os.path.exists(r'{}\{}'.format(dest, name)): + download_generic(dest, name, url) + + def extract_generic(source, dest, mode='x', sz_args=[]): """Extract a file to a destination.""" cmd = [ diff --git a/.bin/Scripts/new_system_setup.py b/.bin/Scripts/new_system_setup.py index ff947c7e..f3e3e9b2 100644 --- a/.bin/Scripts/new_system_setup.py +++ b/.bin/Scripts/new_system_setup.py @@ -123,13 +123,13 @@ if __name__ == '__main__': if global_vars['OS']['Version'] == '10': try_and_print(message='ClassicStart...', function=config_classicstart, cs='Done') - try_and_print(message='Explorer...', + try_and_print(message='Explorer (user)...', function=config_explorer_user, cs='Done') # Configure system print_info('Configuring system') if global_vars['OS']['Version'] == '10': - try_and_print(message='Explorer...', + try_and_print(message='Explorer (system)...', function=config_explorer_system, cs='Done') try_and_print(message='Disabling telemetry...', function=disable_windows_telemetry, cs='Done') @@ -142,6 +142,10 @@ if __name__ == '__main__': try_and_print(message='Updating Clock...', function=update_clock, cs='Done') + # Restart Explorer + try_and_print(message='Restarting Explorer...', + function=restart_explorer, cs='Done') + # Summary print_info('Summary') try_and_print(message='Operating System:', diff --git a/.bin/Scripts/settings/setup.py b/.bin/Scripts/settings/setup.py index d9a012f7..db30fe19 100644 --- a/.bin/Scripts/settings/setup.py +++ b/.bin/Scripts/settings/setup.py @@ -1,5 +1,6 @@ # Wizard Kit: Settings - Setup +import os import winreg # General diff --git a/.bin/Scripts/settings/sources.py b/.bin/Scripts/settings/sources.py index 4ab58c02..9152c922 100644 --- a/.bin/Scripts/settings/sources.py +++ b/.bin/Scripts/settings/sources.py @@ -203,6 +203,23 @@ RST_SOURCES = { #SetupRST_16.7.exe : Deprecated by Intel 'SetupRST_16.8.exe': 'https://downloadmirror.intel.com/28400/eng/SetupRST.exe', } +WINDOWS_UPDATE_SOURCES = { + '2999226': { + # https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows + '7': { + '32': 'https://download.microsoft.com/download/4/F/E/4FE73868-5EDD-4B47-8B33-CE1BB7B2B16A/Windows6.1-KB2999226-x86.msu', + '64': 'https://download.microsoft.com/download/1/1/5/11565A9A-EA09-4F0A-A57E-520D5D138140/Windows6.1-KB2999226-x64.msu', + }, + '8': { + '32': 'https://download.microsoft.com/download/1/E/8/1E8AFE90-5217-464D-9292-7D0B95A56CE4/Windows8-RT-KB2999226-x86.msu', + '64': 'https://download.microsoft.com/download/A/C/1/AC15393F-A6E6-469B-B222-C44B3BB6ECCC/Windows8-RT-KB2999226-x64.msu', + }, + '8.1': { + '32': 'https://download.microsoft.com/download/E/4/6/E4694323-8290-4A08-82DB-81F2EB9452C2/Windows8.1-KB2999226-x86.msu', + '64': 'https://download.microsoft.com/download/9/6/F/96FD0525-3DDF-423D-8845-5F92F4A6883E/Windows8.1-KB2999226-x64.msu', + }, + }, + } if __name__ == '__main__': diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py index 45df9a86..3bd3772d 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -61,6 +61,10 @@ if __name__ == '__main__': try_and_print(message='Updating Clock...', function=update_clock, cs='Done') + # Restart Explorer + try_and_print(message='Restarting Explorer...', + function=restart_explorer, cs='Done') + # Cleanup print_info('Cleanup') try_and_print(message='AdwCleaner...', diff --git a/.bin/Scripts/update_kit.py b/.bin/Scripts/update_kit.py index 8f21e122..13520d5c 100644 --- a/.bin/Scripts/update_kit.py +++ b/.bin/Scripts/update_kit.py @@ -63,6 +63,7 @@ if __name__ == '__main__': try_and_print(message='Macs Fan Control...', function=update_macs_fan_control, other_results=other_results, width=40) try_and_print(message='MS Office...', function=update_office, other_results=other_results, width=40) try_and_print(message='Visual C++ Runtimes...', function=update_vcredists, other_results=other_results, width=40) + try_and_print(message='Windows Updates...', function=download_windows_updates, other_results=other_results, width=40) update_all_ninite(other_results=other_results, width=40) # Misc diff --git a/.bin/Scripts/user_checklist.py b/.bin/Scripts/user_checklist.py index f159e265..5d4af974 100644 --- a/.bin/Scripts/user_checklist.py +++ b/.bin/Scripts/user_checklist.py @@ -80,6 +80,10 @@ if __name__ == '__main__': if not answer_config_browsers: print_warning(' Skipped') + # Restart Explorer + try_and_print(message='Restarting Explorer...', + function=restart_explorer, cs='Done') + # Run speedtest popen_program(['start', '', 'https://fast.com'], shell=True)