From ec74b062829c6d5e832701110a7de77d65e981d0 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 16 Mar 2019 23:02:44 -0600 Subject: [PATCH 1/7] Verify Python can be run before launching script * Fixes issue #91 --- .bin/Scripts/Launch.cmd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.bin/Scripts/Launch.cmd b/.bin/Scripts/Launch.cmd index 18c304f2..a101db7f 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. From 84deb49beba787a11d4582cd27b36fee51fc66fa Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 16 Mar 2019 23:03:13 -0600 Subject: [PATCH 2/7] Explicitly set colors to properly reset errorlevel --- .bin/Scripts/Launch.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bin/Scripts/Launch.cmd b/.bin/Scripts/Launch.cmd index a101db7f..faea56f8 100644 --- a/.bin/Scripts/Launch.cmd +++ b/.bin/Scripts/Launch.cmd @@ -497,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 :: From 2e679dbf5ee7b00e14f632c50bb9f5645f851943 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 17 Mar 2019 18:11:36 -0600 Subject: [PATCH 3/7] Download stand alone Windows update installers * Fixes issue #91 (again) --- .bin/Scripts/functions/update.py | 16 ++++++++++++++++ .bin/Scripts/settings/sources.py | 17 +++++++++++++++++ .bin/Scripts/update_kit.py | 1 + 3 files changed, 34 insertions(+) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index adb26c6d..1ff66160 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/settings/sources.py b/.bin/Scripts/settings/sources.py index e39a8e9d..29a8c66e 100644 --- a/.bin/Scripts/settings/sources.py +++ b/.bin/Scripts/settings/sources.py @@ -197,6 +197,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/update_kit.py b/.bin/Scripts/update_kit.py index 18bbb69e..15b3162e 100644 --- a/.bin/Scripts/update_kit.py +++ b/.bin/Scripts/update_kit.py @@ -60,6 +60,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 From 1235269da0f2770911804a27414ae711c1b2ac4b Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 17 Mar 2019 20:17:00 -0600 Subject: [PATCH 4/7] Bugfix --- .bin/Scripts/settings/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.bin/Scripts/settings/setup.py b/.bin/Scripts/settings/setup.py index 73b6f59b..0d7b45ba 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 From b84d4eb6b807824216915d55f367f62aae98fb82 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 17 Mar 2019 20:22:50 -0600 Subject: [PATCH 5/7] Bugfix: typo --- .bin/Scripts/functions/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 1ff66160..d7904090 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -79,7 +79,7 @@ def download_windows_updates(): 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): + if not os.path.exists(r'{}\{}'.format(dest, name)): download_generic(dest, name, url) From 4cb14c6429eea45e30ee71756d90a5a0ecfc4de5 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 17 Mar 2019 20:23:25 -0600 Subject: [PATCH 6/7] Restart Explorer after configuring * Allows changes to be seen without restarting manually --- .bin/Scripts/functions/setup.py | 8 ++++++++ .bin/Scripts/new_system_setup.py | 8 ++++++-- .bin/Scripts/system_checklist.py | 4 ++++ .bin/Scripts/user_checklist.py | 4 ++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/setup.py b/.bin/Scripts/functions/setup.py index 75ea45f1..dc6c53a4 100644 --- a/.bin/Scripts/functions/setup.py +++ b/.bin/Scripts/functions/setup.py @@ -4,6 +4,7 @@ from functions.update import * from settings.setup import * +# Configuration def config_classicstart(): """Configure ClassicStart.""" # User level, not system level @@ -225,6 +226,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/new_system_setup.py b/.bin/Scripts/new_system_setup.py index 3b599130..170cf323 100644 --- a/.bin/Scripts/new_system_setup.py +++ b/.bin/Scripts/new_system_setup.py @@ -93,13 +93,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') @@ -108,6 +108,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/system_checklist.py b/.bin/Scripts/system_checklist.py index 84c2c673..d092c8da 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -48,6 +48,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/user_checklist.py b/.bin/Scripts/user_checklist.py index 91e5915a..e74d26f9 100644 --- a/.bin/Scripts/user_checklist.py +++ b/.bin/Scripts/user_checklist.py @@ -71,6 +71,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) From 48c0cf0b1b9da6b2fad0af0b0bdb3974c207dc28 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 17 Mar 2019 20:43:19 -0600 Subject: [PATCH 7/7] Adjusted Explorer settings --- .bin/Scripts/settings/setup.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.bin/Scripts/settings/setup.py b/.bin/Scripts/settings/setup.py index 0d7b45ba..6338701d 100644 --- a/.bin/Scripts/settings/setup.py +++ b/.bin/Scripts/settings/setup.py @@ -92,15 +92,23 @@ SETTINGS_EXPLORER_SYSTEM = { }, } SETTINGS_EXPLORER_USER = { + # Disable features r'Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager': { 'DWORD Items': { - # Disable silently installed apps + # Silently installed apps 'SilentInstalledAppsEnabled': 0, - # Disable Tips and Tricks + # Tips and Tricks 'SoftLandingEnabled ': 0, 'SubscribedContent-338389Enabled': 0, }, }, + # File Explorer + r'Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced': { + 'DWORD Items': { + # Change default Explorer view to "Computer" + 'LaunchTo': 1, + }, + }, # Hide People bar r'Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People': { 'DWORD Items': {'PeopleBand': 0}, @@ -109,10 +117,6 @@ SETTINGS_EXPLORER_USER = { r'Software\Microsoft\Windows\CurrentVersion\Search': { 'DWORD Items': {'SearchboxTaskbarMode': 0}, }, - # Change default Explorer view to "Computer" - r'Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced': { - 'DWORD Items': {'LaunchTo': 1}, - }, } # Visual C++ Runtimes