diff --git a/scripts/auto_setup.py b/scripts/auto_setup.py index a994fe2a..9db1d1c4 100644 --- a/scripts/auto_setup.py +++ b/scripts/auto_setup.py @@ -117,7 +117,7 @@ BASE_MENUS = { MenuEntry('Firefox', 'auto_install_firefox'), MenuEntry('LibreOffice', 'auto_install_libreoffice'), MenuEntry('Open Shell', 'auto_install_open_shell'), - MenuEntry('Software Bundle', no_op), + MenuEntry('Software Bundle', 'auto_install_software_bundle'), ), 'Configure System': ( MenuEntry('Chrome Notifications', no_op), diff --git a/scripts/wk/cfg/sources.py b/scripts/wk/cfg/sources.py index 5ee9a483..518b18e6 100644 --- a/scripts/wk/cfg/sources.py +++ b/scripts/wk/cfg/sources.py @@ -56,6 +56,7 @@ SOURCES = { 'Samsung Magician': 'https://s3.ap-northeast-2.amazonaws.com/global.semi.static/SAMSUNG_SSD_v5_3_0_181121/CD0C7CC1BE00525FAC4675B9E502899B41D5C3909ECE3AA2FB6B74A766B2A1EA/Samsung_Magician_Installer.zip', 'SDIO Themes': 'http://snappy-driver-installer.org/downloads/SDIO_Themes.zip', 'SDIO Torrent': 'http://snappy-driver-installer.org/downloads/SDIO_Update.torrent', + 'Software Bundle': 'https://ninite.com/.net4.8-7zip-chrome-edge-vlc/ninite.exe', 'ShutUp10': 'https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe', 'smartmontools': 'https://1278-105252244-gh.circle-artifacts.com/0/builds/smartmontools-win32-setup-7.3-r5216.exe', 'TDSSKiller': 'https://media.kaspersky.com/utilities/VirusUtilities/EN/tdsskiller.exe', diff --git a/scripts/wk/kit/tools.py b/scripts/wk/kit/tools.py index 5e888a3f..50a98059 100644 --- a/scripts/wk/kit/tools.py +++ b/scripts/wk/kit/tools.py @@ -57,7 +57,7 @@ def download_file(out_path, source_url, as_new=False, overwrite=False): _f.write(chunk) # Done - print(f'\r{" "*len(download_msg)}\r', end='', flush=True) + print(f'\033[{len(download_msg)}D\033[0K', end='', flush=True) return out_path diff --git a/scripts/wk/setup/win.py b/scripts/wk/setup/win.py index c5311ad0..5b54da1d 100644 --- a/scripts/wk/setup/win.py +++ b/scripts/wk/setup/win.py @@ -441,6 +441,11 @@ def auto_install_open_shell(): TRY_PRINT.run('Open Shell...', install_open_shell) +def auto_install_software_bundle(): + """Install standard software bundle.""" + TRY_PRINT.run('Software Bundle...', install_software_bundle) + + def auto_install_vcredists(): """Install latest supported Visual C++ runtimes.""" TRY_PRINT.run('Visual C++ Runtimes...', install_vcredists) @@ -612,6 +617,31 @@ def install_open_shell(): run_program(cmd) +def install_software_bundle(): + """Install standard software bundle.""" + download_tool('Ninite', 'Software Bundle') + installer = get_tool_path('Ninite', 'Software Bundle') + msg = 'Waiting for installations to finish...' + warning = 'NOTE: Press CTRL+c to manually resume if it gets stuck...' + + # Start installations and wait for them to finish + print_standard(msg) + print_warning(warning, end='', flush=True) + proc = popen_program([installer]) + try: + proc.wait() + except KeyboardInterrupt: + # Assuming user-forced continue + pass + + # Clear info lines + print( + '\r\033[0K' # Cursor to start of current line and clear to end of line + '\033[F\033[54C' # Cursor to start of prev line and then move 54 right + '\033[0K', # Clear from cursor to end of line + end='', flush=True) + + def install_vcredists(): """Install latest supported Visual C++ runtimes.""" for year in (2012, 2013, 2019): diff --git a/scripts/wk/std.py b/scripts/wk/std.py index 919c73a4..958d275f 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -588,11 +588,11 @@ class TryAndPrint(): verbose, ) f_exception = None - catch_all = catch_all if catch_all else self.catch_all - msg_good = msg_good if msg_good else self.msg_good + catch_all = catch_all if catch_all is not None else self.catch_all + msg_good = msg_good if msg_good is not None else self.msg_good output = None result_msg = 'UNKNOWN' - verbose = verbose if verbose else self.verbose + verbose = verbose if verbose is not None else self.verbose # Build exception tuples e_exceptions = tuple(self._get_exception(e) for e in self.list_errors)