diff --git a/.bin/Scripts/acpi.py b/.bin/Scripts/acpi.py new file mode 100644 index 00000000..d9ccf321 --- /dev/null +++ b/.bin/Scripts/acpi.py @@ -0,0 +1,55 @@ +import sys + +if sys.platform.startswith('win32'): + import ctypes + import ctypes.wintypes + + def EnumAcpiTables(): + #returns a list of the names of the ACPI tables on this system + FirmwareTableProviderSignature=ctypes.wintypes.DWORD(1094930505) + pFirmwareTableBuffer=ctypes.create_string_buffer(0) + BufferSize=ctypes.wintypes.DWORD(0) + #http://msdn.microsoft.com/en-us/library/windows/desktop/ms724259 + EnumSystemFirmwareTables=ctypes.WinDLL("Kernel32").EnumSystemFirmwareTables + ret=EnumSystemFirmwareTables(FirmwareTableProviderSignature, pFirmwareTableBuffer, BufferSize) + pFirmwareTableBuffer=None + pFirmwareTableBuffer=ctypes.create_string_buffer(ret) + BufferSize.value=ret + ret2=EnumSystemFirmwareTables(FirmwareTableProviderSignature, pFirmwareTableBuffer, BufferSize) + return [pFirmwareTableBuffer.value[i:i+4] for i in range(0, len(pFirmwareTableBuffer.value), 4)] + + def GetAcpiTable(table): + #returns raw contents of ACPI table + #http://msdn.microsoft.com/en-us/library/windows/desktop/ms724379x + tableID = 0 + for b in reversed(table): + tableID = (tableID << 8) + b + GetSystemFirmwareTable=ctypes.WinDLL("Kernel32").GetSystemFirmwareTable + FirmwareTableProviderSignature=ctypes.wintypes.DWORD(1094930505) + FirmwareTableID=ctypes.wintypes.DWORD(int(tableID)) + pFirmwareTableBuffer=ctypes.create_string_buffer(0) + BufferSize=ctypes.wintypes.DWORD(0) + ret = GetSystemFirmwareTable(FirmwareTableProviderSignature, FirmwareTableID, pFirmwareTableBuffer, BufferSize) + pFirmwareTableBuffer=None + pFirmwareTableBuffer=ctypes.create_string_buffer(ret) + BufferSize.value=ret + ret2 = GetSystemFirmwareTable(FirmwareTableProviderSignature, FirmwareTableID, pFirmwareTableBuffer, BufferSize) + return pFirmwareTableBuffer.raw +elif sys.platform.startswith('linux'): + import os + TABLE_ROOT = b'/sys/firmware/acpi/tables' + def EnumAcpiTables(): + return os.listdir(TABLE_ROOT) + def GetAcpiTable(table): + with open(os.path.join(TABLE_ROOT, table), 'rb') as o: + return o.read() +else: + raise NotImplementedError('acpi support only implemented for linux and win32') + +def FindAcpiTable(table): +#checks if specific ACPI table exists and returns True/False + tables = EnumAcpiTables() + if table in tables: + return True + else: + return False diff --git a/.bin/Scripts/activate.py b/.bin/Scripts/activate.py index f77609eb..c7bdb663 100644 --- a/.bin/Scripts/activate.py +++ b/.bin/Scripts/activate.py @@ -1,16 +1,15 @@ # Wizard Kit: Activate Windows using various methods -import csv import os import re -import subprocess +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: Windows Activation Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars() def abort(): print_warning('Aborted.') @@ -18,84 +17,41 @@ def abort(): def activate_with_bios(): """Attempt to activate Windows with a key stored in the BIOS.""" - extract_item('ProduKey', silent=True) - _args = [ - '/nosavereg', - '/scomma', '{TmpDir}\\keys.csv'.format(**global_vars), - '/WindowsKeys', '1', - '/OfficeKeys', '0', - '/IEKeys', '0', - '/SQLKeys', '0', - '/ExchangeKeys', '0'] - try: - run_program(global_vars['Tools']['ProduKey'], _args, pipe=False) - except subprocess.CalledProcessError: - print_error('ERROR: Failed to extract BIOS key') - abort() - else: - with open ('{TmpDir}\\keys.csv'.format(**global_vars), newline='') as key_file: - key_reader = csv.reader(key_file) - _key_found = False - for key in key_reader: - if 'BIOS' in key[0] and re.match(r'^\w{5}-\w{5}-\w{5}-\w{5}-\w{5}$', key[2]): - _key_found = True - print_standard('BIOS key found, installing...') - run_program('cscript {SYSTEMROOT}\\System32\\slmgr.vbs /ipk {pkey} //nologo'.format(**global_vars['Env'], pkey=key[2]), check=False, shell=True) - sleep(15) - print_standard('Attempting activation...') - run_program('cscript {SYSTEMROOT}\\System32\\slmgr.vbs /ato //nologo'.format(**global_vars['Env']), check=False, shell=True) - sleep(15) - # Open system properties for user verification - popen_program(['control', 'system']) - break - if not _key_found: - print_error('ERROR: BIOS not key found.') - abort() - -def activate_with_hive(): - """Scan any transferred software hives for Windows keys and attempt activation.""" - extract_item('ProduKey', silent=True) - -def is_activated(): - """Updates activation status, checks if activated, and returns a bool.""" - _out = run_program('cscript /nologo {SYSTEMROOT}\\System32\\slmgr.vbs /xpr'.format(**global_vars['Env'])) - _out = _out.stdout.decode().splitlines() - _out = [l for l in _out if re.match(r'^\s', l)] - if len(_out) > 0: - global_vars['OS']['Activation'] = re.sub(r'^\s+', '', _out[0]) - else: - global_vars['OS']['Activation'] = 'Activation status unknown' - return 'The machine is permanently activated.' in global_vars['OS']['Activation'] + try_and_print(message='BIOS Activation:', function=activate_windows_with_bios, other_results=other_results) if __name__ == '__main__': - stay_awake() - # Bail early if already activated - if is_activated(): - print_info('This system is already activated') - exit_script() - - # Determine activation method - activation_methods = [ - {'Name': 'Activate with BIOS key', 'Function': activate_with_bios}, - {'Name': 'Activate with transferred SW hive', 'Function': activate_with_hive, 'Disabled': True}, - ] - if not re.match(r'^(8|10)$', global_vars['OS']['Version']): - activation_methods[0]['Disabled'] = True - actions = [ - {'Name': 'Quit', 'Letter': 'Q'}, - ] - - # Main loop - while True: - selection = menu_select('Wizard Kit: Windows Activation Menu', activation_methods, actions) - - if (selection.isnumeric()): - activation_methods[int(selection)-1]['Function']() - break - elif selection == 'Q': + try: + stay_awake() + # Bail early if already activated + if windows_is_activated(): + print_info('This system is already activated') exit_script() - - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() + + # Determine activation method + activation_methods = [ + {'Name': 'Activate with BIOS key', 'Function': activate_with_bios}, + ] + if not re.match(r'^(8|10)$', global_vars['OS']['Version']): + activation_methods[0]['Disabled'] = True + actions = [ + {'Name': 'Quit', 'Letter': 'Q'}, + ] + + # Main loop + while True: + selection = menu_select('Wizard Kit: Windows Activation Menu', activation_methods, actions) + + if (selection.isnumeric()): + activation_methods[int(selection)-1]['Function']() + break + elif selection == 'Q': + exit_script() + + # Done + print_success('Done.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/check_disk.py b/.bin/Scripts/check_disk.py index 8c125c56..ad9f974e 100644 --- a/.bin/Scripts/check_disk.py +++ b/.bin/Scripts/check_disk.py @@ -1,33 +1,40 @@ # Wizard Kit: Check Disk Tool import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: Check Disk Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\Check Disk.log'.format(**global_vars)) +global_vars['LogFile'] = '{LogDir}\\Check Disk.log'.format(**global_vars) def abort(): - print_warning('Aborted.', global_vars['LogFile']) + print_warning('Aborted.') exit_script() if __name__ == '__main__': - stay_awake() - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - os.system('cls') - print_info('Check Disk Tool') - try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, cs='CS', ns='NS', other_results=other_results) - - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() + try: + stay_awake() + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + os.system('cls') + print_info('Check Disk Tool') + try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, other_results=other_results) + + # Done + print_success('Done.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/check_disk_fix.py b/.bin/Scripts/check_disk_fix.py index fad6724a..5569f098 100644 --- a/.bin/Scripts/check_disk_fix.py +++ b/.bin/Scripts/check_disk_fix.py @@ -1,37 +1,45 @@ # Wizard Kit: Check Disk (Fix) Tool import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: Check Disk (Fix) Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\Check Disk (Fix).log'.format(**global_vars)) +global_vars['LogFile'] = '{LogDir}\\Check Disk (Fix).log'.format(**global_vars) def abort(): - print_warning('Aborted.', global_vars['LogFile']) + print_warning('Aborted.') exit_script() if __name__ == '__main__': - stay_awake() - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - offline_scan = True - os.system('cls') - print_info('Check Disk Tool') - _spotfix = try_and_print(message='CHKDSK Spotfix ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_spotfix, cs='CS', ns='NS', other_results=other_results) - if global_vars['OS']['Version'] in ['8', '10'] and not _spotfix['CS']: - offline_scan = ask('Run full offline scan?') - try_and_print(message='CHKDSK Offline ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_offline, cs='Scheduled', ns='Error', other_results=other_results) - - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() \ No newline at end of file + try: + stay_awake() + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + offline_scan = True + os.system('cls') + print_info('Check Disk Tool') + _spotfix = try_and_print(message='CHKDSK Spotfix ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_spotfix, other_results=other_results) + if global_vars['OS']['Version'] in ['8', '10'] and not _spotfix['CS']: + offline_scan = ask('Run full offline scan?') + try_and_print(message='CHKDSK Offline ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_offline, cs='Scheduled', ns='Error', other_results=other_results) + + # Done + print_success('Done.') + pause("Press Enter to reboot...") + run_program(['shutdown', '-r', '-t', '15'], check=False) + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/dism.py b/.bin/Scripts/dism.py index a1ceb7fa..63adb27b 100644 --- a/.bin/Scripts/dism.py +++ b/.bin/Scripts/dism.py @@ -1,45 +1,52 @@ # Wizard Kit: DISM wrapper import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: DISM helper Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\DISM helper tool.log'.format(**global_vars)) +global_vars['LogFile'] = '{LogDir}\\DISM helper tool.log'.format(**global_vars) def abort(): print_warning('Aborted.') exit_script() if __name__ == '__main__': - stay_awake() - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - options = [ - {'Name': 'Check Health', 'Command': 'Check'}, - {'Name': 'Restore Health', 'Command': 'Restore'}] - actions = [{'Name': 'Quit', 'Letter': 'Q'}] - selection = menu_select('Please select action to perform', options, actions) - os.system('cls') - print_info('DISM helper tool') - if selection == 'Q': - abort() - elif options[int(selection)-1]['Command'] == 'Check': - try_and_print(message='DISM ScanHealth...', function=run_dism_scan_health, cs='No corruption', ns='Corruption detected', other_results=other_results) - elif options[int(selection)-1]['Command'] == 'Restore': - try_and_print(message='DISM RestoreHealth...', function=run_dism_restore_health, cs='No corruption', ns='Corruption detected', other_results=other_results) - else: - abort() - - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() + try: + stay_awake() + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + options = [ + {'Name': 'Check Health', 'Command': 'Check'}, + {'Name': 'Restore Health', 'Command': 'Restore'}] + actions = [{'Name': 'Quit', 'Letter': 'Q'}] + selection = menu_select('Please select action to perform', options, actions) + os.system('cls') + print_info('DISM helper tool') + if selection == 'Q': + abort() + elif options[int(selection)-1]['Command'] == 'Check': + try_and_print(message='DISM ScanHealth...', function=run_dism_scan_health, cs='No corruption', ns='Corruption detected', other_results=other_results) + elif options[int(selection)-1]['Command'] == 'Restore': + try_and_print(message='DISM RestoreHealth...', function=run_dism_restore_health, cs='No corruption', ns='Corruption detected', other_results=other_results) + else: + abort() + + # Done + print_success('Done.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/functions.py b/.bin/Scripts/functions.py index 2c8db109..2f609c30 100644 --- a/.bin/Scripts/functions.py +++ b/.bin/Scripts/functions.py @@ -11,6 +11,7 @@ import time import traceback import winreg +from operator import itemgetter from subprocess import CalledProcessError # STATIC VARIABLES @@ -24,8 +25,8 @@ COLORS = { } BACKUP_SERVERS = [ { 'IP': '10.0.0.10', - 'Mounted': False, 'Name': 'ServerOne', + 'Mounted': False, 'Share': 'Backups', 'User': 'restore', 'Pass': 'Abracadabra', @@ -87,6 +88,8 @@ TOOLS = { '32': '{BinDir}\\BleachBit\\bleachbit_console.exe'}, 'Caffeine': { '32': '{BinDir}\\caffeine\\caffeine.exe'}, + 'curl': { + '32': '{BinDir}\\curl\\curl.exe'}, 'Du': { '32': '{BinDir}\\SysinternalsSuite\\du.exe', '64': '{BinDir}\\SysinternalsSuite\\du64.exe'}, @@ -136,38 +139,38 @@ REGEX_REGISTRY_DIRS = re.compile(r'^(config$|RegBack$|System32$|Transfer|Win)' REGEX_SOFTWARE_HIVE = re.compile(r'^Software$', re.IGNORECASE) # Data 1 REGEX_EXCL_ITEMS = re.compile(r'^(\.(AppleDB|AppleDesktop|AppleDouble|com\.apple\.timemachine\.supported|dbfseventsd|DocumentRevisions-V100.*|DS_Store|fseventsd|PKInstallSandboxManager|Spotlight.*|SymAV.*|symSchedScanLockxz|TemporaryItems|Trash.*|vol|VolumeIcon\.icns)|desktop\.(ini|.*DB|.*DF)|(hiberfil|pagefile)\.sys|lost\+found|Network\.*Trash\.*Folder|Recycle[dr]|System\.*Volume\.*Information|Temporary\.*Items|Thumbs\.db)$', flags=re.IGNORECASE) -REGEX_EXCL_ROOT_ITEMS = re.compile(r'^\\(boot(mgr|nxt)$|(eula|globdata|install|vc_?red)|.*.sys$|System Volume Information|RECYCLER|\$Recycle\.bin|\$?Win(dows(.old|\.~BT|)$|RE_)|\$GetCurrent|PerfLogs|Program Files|.*\.(esd|swm|wim|dd|map|dmg|image)$|SYSTEM.SAV|Windows10Upgrade)', flags=re.IGNORECASE) -REGEX_INCL_ROOT_ITEMS = re.compile(r'^\\(AdwCleaner|(My\s*|)(Doc(uments?( and Settings|)|s?)|Downloads|WK(-?Info|-?Transfer|)|Media|Music|Pic(ture|)s?|Vid(eo|)s?)|(ProgramData|Recovery|Temp.*|Users)$|.*\.(log|txt|rtf|qb\w*|avi|m4a|m4v|mp4|mkv|jpg|png|tiff?)$)', flags=re.IGNORECASE) -EXTRA_INCL_WIM_ITEMS = [ - 'AdwCleaner\\*log', - 'AdwCleaner\\*txt', - '\\Windows.old*\\Doc*', - '\\Windows.old*\\Download*', - '\\Windows.old*\\WK*', - '\\Windows.old*\\Media*', - '\\Windows.old*\\Music*', - '\\Windows.old*\\Pic*', - '\\Windows.old*\\ProgramData', - '\\Windows.old*\\Recovery', - '\\Windows.old*\\Temp*', - '\\Windows.old*\\Users', - '\\Windows.old*\\Vid*', - '\\Windows.old*\\Windows\\System32\\OEM', - '\\Windows.old*\\Windows\\System32\\config', - '\\Windows\\System32\\OEM', - '\\Windows\\System32\\config'] -FAST_COPY_ARGS = [ +REGEX_EXCL_ROOT_ITEMS = re.compile(r'^\\?(boot(mgr|nxt)$|Config.msi|(eula|globdata|install|vc_?red)|.*.sys$|System Volume Information|RECYCLER?|\$Recycle\.bin|\$?Win(dows(.old.*|\.~BT|)$|RE_)|\$GetCurrent|PerfLogs|Program Files|.*\.(esd|swm|wim|dd|map|dmg|image)$|SYSTEM.SAV|Windows10Upgrade)', flags=re.IGNORECASE) +REGEX_INCL_ROOT_ITEMS = re.compile(r'^\\?(AdwCleaner|(My\s*|)(Doc(uments?( and Settings|)|s?)|Downloads|WK(-?Info|-?Transfer|)|Media|Music|Pic(ture|)s?|Vid(eo|)s?)|(ProgramData|Recovery|Temp.*|Users)$|.*\.(log|txt|rtf|qb\w*|avi|m4a|m4v|mp4|mkv|jpg|png|tiff?)$)', flags=re.IGNORECASE) +REGEX_WIM_FILE = re.compile(r'\.wim$', flags=re.IGNORECASE) +REGEX_WINDOWS_OLD = re.compile(r'^\\Win(dows|)\.old', flags=re.IGNORECASE) +FAST_COPY_ARGS = [ '/cmd=noexist_only', - '/logfile={LogFile}'.format(**global_vars), '/utf8', '/skip_empty_dir', '/linkdest', '/no_ui', '/auto_close', r'/exclude=\*.esd;\*.swm;\*.wim;\*.dd;\*.dd.tgz;\*.dd.txz;\*.map;\*.dmg;\*.image;$RECYCLE.BIN;$Recycle.Bin;.AppleDB;.AppleDesktop;.AppleDouble;.com.apple.timemachine.supported;.dbfseventsd;.DocumentRevisions-V100*;.DS_Store;.fseventsd;.PKInstallSandboxManager;.Spotlight*;.SymAV*;.symSchedScanLockxz;.TemporaryItems;.Trash*;.vol;.VolumeIcon.icns;desktop.ini;Desktop?DB;Desktop?DF;hiberfil.sys;lost+found;Network?Trash?Folder;pagefile.sys;Recycled;RECYCLER;System?Volume?Information;Temporary?Items;Thumbs.db'] +VCR_REDISTS = [ + {'Name': 'Visual C++ 2005 SP1 x32...', 'Cmd': ['msiexec', '/i', '2005sp1\\x86\\vcredist.msi', '/qb!', '/norestart']}, + {'Name': 'Visual C++ 2005 SP1 x64...', 'Cmd': ['msiexec', '/i', '2005sp1\\x64\\vcredist.msi', '/qb!', '/norestart']}, + {'Name': 'Visual C++ 2008 SP1 x32...', 'Cmd': ['2008sp1\\vcredist_x86.exe', '/qb! /norestart']}, + {'Name': 'Visual C++ 2008 SP1 x64...', 'Cmd': ['2008sp1\\vcredist_x64.exe', '/qb! /norestart']}, + {'Name': 'Visual C++ 2010 x32...', 'Cmd': ['2010\\vcredist_x86.exe', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2010 x64...', 'Cmd': ['2010\\vcredist_x64.exe', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2012 Update 4 x32...', 'Cmd': ['2012u4\\vcredist_x86.exe', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2012 Update 4 x64...', 'Cmd': ['2012u4\\vcredist_x64.exe', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2013 x32...', 'Cmd': ['2013\\vcredist_x86.exe', '/install', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2013 x64...', 'Cmd': ['2013\\vcredist_x64.exe', '/install', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2015 Update 3 x32...', 'Cmd': ['2015u3\\vc_redist.x86.exe', '/install', '/passive', '/norestart']}, + {'Name': 'Visual C++ 2015 Update 3 x64...', 'Cmd': ['2015u3\\vc_redist.x64.exe', '/install', '/passive', '/norestart']}] + global_vars = {} # Error Classes +class BIOSKeyNotFoundError(Exception): + pass + class BinNotFoundError(Exception): pass @@ -193,9 +196,9 @@ def ask(prompt='Kotaero!'): prompt = prompt + ' [Y/N]: ' while answer is None: tmp = input(prompt) - if re.search(r'^y(es|)$', tmp): + if re.search(r'^y(es|)$', tmp, re.IGNORECASE): answer = True - elif re.search(r'^n(o|ope|)$', tmp): + elif re.search(r'^n(o|ope|)$', tmp, re.IGNORECASE): answer = False _message = '{prompt}{answer_text}'.format( prompt = prompt, @@ -231,7 +234,7 @@ def exit_script(): os.rmdir(dir) except: pass - + # Open Log (if it exists) _log = global_vars.get('LogFile', '') if os.path.exists(_log): @@ -240,12 +243,12 @@ def exit_script(): popen_program([global_vars['Tools']['NotepadPlusPlus'], global_vars['LogFile']]) except: print_error('ERROR: Failed to extract Notepad++ and open log.') - + # Kill Caffeine if still running kill_process('caffeine.exe') - + # Exit - quit() + sys.exit(0) def extract_item(item=None, filter='', silent=False): """Extract item from .cbin into .bin.""" @@ -262,7 +265,8 @@ def extract_item(item=None, filter='', silent=False): try: run_program(_cmd, shell=True) except subprocess.CalledProcessError: - print_warning('WARNING: Errors encountered while exctracting data') + if not silent: + print_warning('WARNING: Errors encountered while exctracting data') def get_ticket_number(): """Get TicketNumber from user and save it in the info folder.""" @@ -312,23 +316,34 @@ def human_readable_size(size, decimals=0): # Return return tmp +def kill_process(name=None): + """Kill any running caffeine.exe processes.""" + if name is None: + raise Exception + for proc in psutil.process_iter(): + if proc.name() == name: + proc.kill() + def major_exception(): """Display traceback and exit""" print_error('Major exception') print_warning(' Please let The Wizard know and he\'ll look into it (Please include the details below).') - print(traceback.print_exc()) + print(traceback.format_exc()) + print_log(traceback.format_exc()) sleep(30) pause("Press Enter to exit...") - quit() + sys.exit(1) -def menu_select(title='~ Untitled Menu ~', main_entries=[], action_entries=[], prompt='Please make a selection', secret_exit=False): +def menu_select(title='~ Untitled Menu ~', main_entries=[], action_entries=[], + prompt='Please make a selection', secret_exit=False, disabled_label='DISABLED'): """Display options in a menu for user and return selected option as a str.""" # Bail early if (len(main_entries) + len(action_entries) == 0): raise Exception("MenuError: No items given") # Build menu - menu_splash = '{title}\n\n'.format(title=title) + menu_splash = '{title}\n\n'.format(title=title) + width = len(str(len(main_entries))) valid_answers = [] if (secret_exit): valid_answers.append('Q') @@ -340,11 +355,19 @@ def menu_select(title='~ Untitled Menu ~', main_entries=[], action_entries=[], p # Add Spacer if ('CRLF' in entry): menu_splash += '\n' - if ('Disabled' in entry): - menu_splash += '{YELLOW}{number:>{mwidth}}: {name} (DISABLED){CLEAR}\n'.format(number=i+1, mwidth=len(str(len(main_entries))), name=entry.get('Display Name', entry['Name']), **COLORS) + if entry.get('Disabled', False): + menu_splash += '{YELLOW}{number:>{width}}: {name} ({disabled}){CLEAR}\n'.format( + number = i+1, + disabled = disabled_label, + width = width, + name = entry.get('Display Name', entry['Name']), + **COLORS) else: valid_answers.append(str(i+1)) - menu_splash += '{number:>{mwidth}}: {name}\n'.format(number=i+1, mwidth=len(str(len(main_entries))), name=entry.get('Display Name', entry['Name'])) + menu_splash += '{number:>{width}}: {name}\n'.format( + number = i+1, + width = width, + name = entry.get('Display Name', entry['Name'])) menu_splash += '\n' # Add action entries @@ -354,7 +377,10 @@ def menu_select(title='~ Untitled Menu ~', main_entries=[], action_entries=[], p if ('CRLF' in entry): menu_splash += '\n' valid_answers.append(entry['Letter']) - menu_splash += '{letter:>{mwidth}}: {name}\n'.format(letter=entry['Letter'].upper(), mwidth=len(str(len(action_entries))), name=entry['Name']) + menu_splash += '{letter:>{width}}: {name}\n'.format( + letter = entry['Letter'].upper(), + width = len(str(len(action_entries))), + name = entry['Name']) menu_splash += '\n' answer = '' @@ -373,7 +399,7 @@ def non_clobber_rename(full_path): while os.path.exists(new_path): new_path = '{path}_{i}'.format(i=_i, path=full_path) _i += 1 - + return new_path def pause(prompt='Press Enter to continue... '): @@ -384,18 +410,18 @@ def popen_program(cmd=None, pipe=False, minimized=False, shell=False): """Run program and return a subprocess.Popen object.""" if cmd is None: raise Exception('No program passed.') - + startupinfo=None if minimized: startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags = subprocess.STARTF_USESHOWWINDOW startupinfo.wShowWindow = 6 - + if pipe: - popen_obj = subprocess.Popen(_cmd, shell=shell, startupinfo=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + popen_obj = subprocess.Popen(cmd, shell=shell, startupinfo=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: - popen_obj = subprocess.Popen(_cmd, shell=shell, startupinfo=None) - + popen_obj = subprocess.Popen(cmd, shell=shell, startupinfo=None) + return popen_obj def print_error(message='Generic error', end='\n', timestamp=True, **kwargs): @@ -436,13 +462,15 @@ def run_program(cmd=None, args=[], check=True, pipe=True, shell=False): """Run program and return a subprocess.CompletedProcess object.""" if cmd is None: raise Exception('No program passed.') - + _cmd = cmd if len(args) > 0: + # BAD Need to refactor all calls to run_program to only use cmd=X + ## That way the cmd var is set the same as the real run() and Popen() calls _cmd = [cmd] + args if shell: _cmd = ' '.join(_cmd) - + if pipe: process_return = subprocess.run(_cmd, check=check, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: @@ -450,8 +478,8 @@ def run_program(cmd=None, args=[], check=True, pipe=True, shell=False): return process_return -def set_global_vars(**kwargs): - global_vars.update(kwargs) +def show_info(message='~Some message~', info='~Some info~', indent=8, width=32): + print_standard('{indent}{message:<{width}}{info}'.format(indent=' '*indent, width=width, message=message, info=info)) def sleep(seconds=2): time.sleep(seconds) @@ -472,7 +500,7 @@ def stay_awake(): def try_and_print(function=None, message='Trying...', cs='CS', ns='NS', other_results={}, catch_all=True, indent=8, width=32, print_return=False, silent_function=True, *args, **kwargs): """Run function, print if successful or not, and return dict. - + other_results is in the form of {'Warning': {'ExceptionClassName': 'Result Message'}, 'Error': {'ExceptionClassName': 'Result Message'}} The the ExceptionClassNames will be additionally excepted conditions and the result string will be printed in the correct color. catch_all=False will result in unspecified exceptions being re-raised.""" @@ -485,7 +513,7 @@ def try_and_print(function=None, message='Trying...', cs='CS', ns='NS', other_re err_exceptions = tuple(getattr(sys.modules[__name__], e) for e in err_exceptions) wrn_results = other_results.get('Warning', {}) err_results = other_results.get('Error', {}) - + # Run function and catch errors print_standard('{indent}{message:<{width}}'.format(indent=' '*indent, message=message, width=width), end='', flush=True) try: @@ -507,7 +535,7 @@ def try_and_print(function=None, message='Trying...', cs='CS', ns='NS', other_re except: print_error(ns, timestamp=False) err = traceback.format_exc() - + # Return or raise? if bool(err) and not catch_all: raise @@ -522,7 +550,7 @@ def upload_data(path=None, file=None): winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'Software\SimonTatham\PuTTY\SshHostKeys') with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\SimonTatham\PuTTY\SshHostKeys', access=winreg.KEY_WRITE) as _key: winreg.SetValueEx(_key, 'rsa2@22:{IP}'.format(**CLIENT_INFO_SERVER), 0, winreg.REG_SZ, CLIENT_INFO_SERVER['RegEntry']) - + # Write batch file with open('{TmpDir}\\psftp.batch'.format(**global_vars), 'w', encoding='ascii') as f: f.write('lcd "{path}"\n'.format(path=path)) @@ -530,7 +558,7 @@ def upload_data(path=None, file=None): f.write('mkdir {TicketNumber}\n'.format(**global_vars)) f.write('cd {TicketNumber}\n'.format(**global_vars)) f.write('put "{file}"\n'.format(file=file)) - + # Upload Info _cmd = [ global_vars['Tools']['PuTTY-PSFTP'], @@ -553,14 +581,6 @@ def wait_for_process(name=None): _still_running = True sleep(1) -def kill_process(name=None): - """Kill any running caffeine.exe processes.""" - if name is None: - raise Exception - for proc in psutil.process_iter(): - if proc.name() == name: - proc.kill() - # global_vars functions def init_global_vars(): """Sets global variables based on system info.""" @@ -589,12 +609,12 @@ def check_os(): _vars_os[key] = 0 except: _vars_os[key] = 'Unknown' - + # Determine OS bit depth _vars_os['Arch'] = 32 if 'PROGRAMFILES(X86)' in global_vars['Env']: _vars_os['Arch'] = 64 - + # Determine OS Name _vars_os['Name'] = '{ProductName} {CSDVersion}'.format(**_vars_os) if _vars_os['CurrentBuild'] == 9600: @@ -605,6 +625,8 @@ def check_os(): _vars_os['Name'] += ' Release 1511 "Threshold 2"' if _vars_os['CurrentBuild'] == 14393: _vars_os['Name'] += ' Release 1607 "Redstone 1" / "Anniversary Update"' + if _vars_os['CurrentBuild'] == 15063: + _vars_os['Name'] += ' Release 1703 "Redstone 1" / "Creators Update"' _vars_os['Name'] = _vars_os['Name'].replace('Service Pack ', 'SP') _vars_os['Name'] = _vars_os['Name'].replace('Unknown Release', 'Release') _vars_os['Name'] = re.sub(r'\s+', ' ', _vars_os['Name']) @@ -626,11 +648,13 @@ def check_os(): # 6.3.10240 # === 10 v1511 "Threshold 2" == # 6.3.10586 - # === 10 v1607 "Anniversary Update" "Redstone 1" == + # === 10 v1607 "Redstone 1" "Anniversary Update" == # 6.3.14393 - # === 10 v???? "Redstone 2" == + # === 10 v1703 "Redstone 2" "Creators Update" == + # 6.3.15063 + # === 10 v???? "Redstone 3" "Fall Creators Update" == # 6.3.????? - + # Determine OS version _os_name = '{Name} x{Arch}'.format(**_vars_os) if _vars_os['CurrentVersion'] == '6.0': @@ -659,37 +683,36 @@ def check_os(): elif _vars_os['CurrentBuild'] == 10586: _os_name = _os_name + ' (outdated)' elif _vars_os['CurrentBuild'] == 14393: + _os_name = _os_name + ' (outdated)' + elif _vars_os['CurrentBuild'] == 15063: pass # Current Win10 else: _os_name = _os_name + ' (unrecognized)' _vars_os['DisplayName'] = _os_name - + # Determine bootup type _vars_os['SafeMode'] = False if 'SAFEBOOT_OPTION' in global_vars['Env']: _vars_os['SafeMode'] = True - - # Determine activation status + + # Ignore activation status if in Safe Mode if _vars_os['SafeMode']: _vars_os['Activation'] = 'Activation status unavailable in safe mode' else: - _out = run_program('cscript /nologo {SYSTEMROOT}\\System32\\slmgr.vbs /xpr'.format(**global_vars['Env'])) - _out = _out.stdout.decode().splitlines() - _out = [l for l in _out if re.match(r'^\s', l)] - if len(_out) > 0: - _vars_os['Activation'] = re.sub(r'^\s+', '', _out[0]) - else: - _vars_os['Activation'] = 'Activation status unknown' - + _vars_os['Activation'] = 'Unknown' + global_vars['OS'] = _vars_os + # Update activation status + update_windows_activation_status() + def check_tools(): # Add tools to dict if global_vars['OS'].get('Arch', 32) == 64: global_vars['Tools'] = {k: v.get('64', v.get('32')) for (k, v) in TOOLS.items()} else: global_vars['Tools'] = {k: v.get('32') for (k, v) in TOOLS.items()} - + # Fix paths global_vars['Tools'] = {k: v.format(**global_vars) for (k, v) in global_vars['Tools'].items()} @@ -713,11 +736,16 @@ def find_bin(): raise BinNotFoundError global_vars['BaseDir'] = _base +def make_tmp_dirs(): + os.makedirs(global_vars['BackupDir'], exist_ok=True) + os.makedirs(global_vars['LogDir'], exist_ok=True) + os.makedirs(global_vars['TmpDir'], exist_ok=True) + def set_common_vars(): global_vars['Date'] = time.strftime("%Y-%m-%d") global_vars['Date-Time'] = time.strftime("%Y-%m-%d_%H%M_%z") global_vars['Env'] = os.environ.copy() - + global_vars['ArchivePassword'] = ARCHIVE_PASSWORD global_vars['BinDir'] = '{BaseDir}\\.bin'.format(**global_vars) global_vars['CBinDir'] = '{BaseDir}\\.cbin'.format(**global_vars) @@ -727,11 +755,6 @@ def set_common_vars(): global_vars['QuarantineDir'] = '{ClientDir}\\Quarantine'.format(**global_vars) global_vars['TmpDir'] = '{BinDir}\\tmp'.format(**global_vars) -def make_tmp_dirs(): - os.makedirs(global_vars['BackupDir'], exist_ok=True) - os.makedirs(global_vars['LogDir'], exist_ok=True) - os.makedirs(global_vars['TmpDir'], exist_ok=True) - # Browsers def backup_browsers(): functions = [ @@ -862,7 +885,7 @@ def clean_internet_explorer(): kill_process('iexplore.exe') run_program('rundll32.exe', ['inetcpl.cpl,ResetIEtoDefaults'], check=False) key = r'Software\Microsoft\Internet Explorer\Main' - + # Set homepage with winreg.OpenKey(winreg.HKEY_CURRENT_USER, key, access=winreg.KEY_WRITE) as _key: winreg.SetValueEx(_key, 'Start Page', 0, winreg.REG_SZ, DEFAULT_HOMEPAGE) @@ -881,7 +904,7 @@ def clean_firefox_profile(profile): shutil.move(profile.path, backup_path) homepages = [] os.makedirs(profile.path, exist_ok=True) - + # Restore essential files from backup_path for entry in os.scandir(backup_path): if REGEX_FIREFOX.search(entry.name): @@ -889,15 +912,15 @@ def clean_firefox_profile(profile): shutil.copytree(entry.path, '{path}\\{name}'.format(path=profile.path, name=entry.name)) else: shutil.copy(entry.path, '{path}\\{name}'.format(path=profile.path, name=entry.name)) - + # Set profile defaults with open('{path}\\prefs.js'.format(path=profile.path), 'a', encoding='ascii') as f: f.write('user_pref("browser.search.geoSpecificDefaults", false);\n') - + # Set search to Google f.write('user_pref("browser.search.defaultenginename", "Google");\n') f.write('user_pref("browser.search.defaultenginename.US", "Google");\n') - + # Set homepage f.write('user_pref("browser.startup.homepage", "{homepage}");\n'.format(homepage=DEFAULT_HOMEPAGE)) @@ -909,7 +932,7 @@ def config_google_chrome(): chrome_exe = get_chrome_exe() if chrome_exe is None: raise NotInstalledError - + # Check for system exensions _ublock_origin = None _ublock_extra = None @@ -921,7 +944,7 @@ def config_google_chrome(): _ublock_extra = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, r'Software\Wow6432Node\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco') except FileNotFoundError: pass - + # Open Chrome _args = [ 'https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en', @@ -948,12 +971,12 @@ def config_mozilla_firefox(): firefox_exe = get_firefox_exe() if firefox_exe is None: raise NotInstalledError - + # Check for system extension(s) _ublock_origin = '{PROGRAMFILES}\\Mozilla Firefox\\distribution\\extensions\\uBlock0@raymondhill.net'.format(**global_vars['Env']) if 'PROGRAMFILES(X86)' in global_vars['Env']: _ublock_origin = '{PROGRAMFILES(X86)}\\Mozilla Firefox\\distribution\\extensions\\uBlock0@raymondhill.net'.format(**global_vars['Env']) - + # Open Firefox if os.path.exists(_ublock_origin): run_program(firefox_exe, ['about:addons'], check=False) @@ -989,13 +1012,13 @@ def create_firefox_default_profiles(): firefox_exe = get_firefox_exe() firefox_dev_exe = get_firefox_dev_exe() profiles_ini_path = '{APPDATA}\\Mozilla\\Firefox\\profiles.ini'.format(**global_vars['Env']) - + # Rename profiles.ini if os.path.exists(profiles_ini_path): backup_path = '{path}_{Date}.bak'.format(path=profiles_ini_path, **global_vars) backup_path = non_clobber_rename(backup_path) shutil.move(profiles_ini_path, backup_path) - + # Create profile(s) if firefox_exe is not None: run_program(firefox_exe, ['-createprofile', 'default'], check=False) @@ -1028,7 +1051,7 @@ def get_chrome_profiles(): profiles = [p for p in profiles if not re.search(r'\.(wk|)bak.*', p.name, re.IGNORECASE)] except: pass - + return profiles def get_chrome_canary_exe(): @@ -1049,7 +1072,7 @@ def get_chrome_canary_profiles(): profiles = [p for p in profiles if not re.search(r'\.(wk|)bak.*', p.name, re.IGNORECASE)] except: pass - + return profiles def get_iexplorer_exe(): @@ -1089,7 +1112,7 @@ def get_firefox_profiles(): profiles = [p for p in profiles if not re.search(r'\.(wk|)bak.*', p.name, re.IGNORECASE)] except: pass - + return profiles def get_opera_exe(): @@ -1106,7 +1129,7 @@ def get_opera_beta_exe(): """Check for Opera Beta installation and return launcher.exe path as str.""" prog_exe = '{PROGRAMFILES}\\Opera beta\\launcher.exe'.format(**global_vars['Env']) # Installs as 64-bit on a 64-bit OS so PROGRAMFILES should always be correct - + if os.path.exists(prog_exe): return prog_exe else: @@ -1116,7 +1139,7 @@ def get_opera_dev_exe(): """Check for Opera Beta installation and return launcher.exe path as str.""" prog_exe = '{PROGRAMFILES}\\Opera developer\\launcher.exe'.format(**global_vars['Env']) # Installs as 64-bit on a 64-bit OS so PROGRAMFILES should always be correct - + if os.path.exists(prog_exe): return prog_exe else: @@ -1131,7 +1154,7 @@ def get_opera_profile(): return [entry] except: pass - + return profiles def get_opera_beta_profile(): @@ -1143,7 +1166,7 @@ def get_opera_beta_profile(): return [entry] except: pass - + return profiles def get_opera_dev_profile(): @@ -1155,39 +1178,42 @@ def get_opera_dev_profile(): return [entry] except: pass - + return profiles def list_homepages(indent=8, width=32): """List current homepages for reference.""" print_standard('{indent}{browser:<{width}}'.format(indent=' '*indent, width=width, browser='Google Chrome...'), end='', flush=True) print_warning('Currently not possible', timestamp=False) - + # Firefox profiles = get_firefox_profiles() if len(profiles) > 0: print_standard('{indent}{browser:<{width}}'.format(indent=' '*indent, width=width, browser='Mozilla Firefox...')) - + for profile in profiles: + homepages = [] try: with open('{path}\\prefs.js'.format(path=profile.path), 'r') as f: _search = re.search(r'browser\.startup\.homepage", "([^"]*)"', f.read(), re.IGNORECASE) if _search: homepages = _search.group(1).split('|') except FileNotFoundError: - homepages = [] - + pass + for page in homepages: print_standard('{indent}{name:<{width}}{page}'.format(indent=' '*(indent+4), width=width-4, name=profile.name, page=page)) - + # IE + homepage = '' + secondary_homepages = [] key = r'Software\Microsoft\Internet Explorer\Main' with winreg.OpenKey(winreg.HKEY_CURRENT_USER, key) as _key: homepage = winreg.QueryValueEx(_key, 'Start Page')[0] try: secondary_homepages = winreg.QueryValueEx(_key, 'Secondary Start Pages')[0] except FileNotFoundError: - secondary_homepages = [] + pass print_standard('{indent}{browser:<{width}}{page}'.format(indent=' '*indent, width=width, browser='Internet Explorer...', page=homepage)) for page in secondary_homepages: print_standard('{indent}{page}'.format(indent=' '*(indent+width), page=page)) @@ -1198,24 +1224,24 @@ def reset_google_chrome(): profiles = get_chrome_profiles() if len(profiles) == 0: raise NoProfilesError - + for profile in profiles: clean_chromium_profile(profile) - + def reset_google_chrome_canary(): kill_process('chrome.exe') chrome_canary_exe = get_chrome_canary_exe() profiles = get_chrome_canary_profiles() if len(profiles) == 0: raise NoProfilesError - + for profile in profiles: clean_chromium_profile(profile) def reset_mozilla_firefox(): kill_process('firefox.exe') profiles = get_firefox_profiles() - + if len(profiles) == 0: create_firefox_default_profiles() kill_process('firefox.exe') @@ -1230,7 +1256,7 @@ def reset_opera(): profiles = get_opera_profile() if len(profiles) == 0: raise NoProfilesError - + # Reset browser (Opera only supports one profile) clean_chromium_profile(profiles[0]) @@ -1240,7 +1266,7 @@ def reset_opera_beta(): profiles = get_opera_beta_profile() if len(profiles) == 0: raise NoProfilesError - + # Reset browser (Opera only supports one profile) clean_chromium_profile(profiles[0]) @@ -1250,7 +1276,7 @@ def reset_opera_dev(): profiles = get_opera_dev_profile() if len(profiles) == 0: raise NoProfilesError - + # Reset browser (Opera only supports one profile) clean_chromium_profile(profiles[0]) @@ -1279,21 +1305,12 @@ def cleanup_adwcleaner(): shutil.rmtree(_path) def cleanup_desktop(): - #~#TODO (Pseudo-code) - #~#for d in drives: - #~# for user in os.scandir('{drive}\\Users'.format(drive=d)): - #~# if os.path.exists('{drive}\\Users\\{user}\\Desktop'.format(drive=d, user=user)): - #~# for entry in os.scandir('{drive}\\Users\\{user}\\Desktop'.format(drive=d, user=user)): - #~# # JRT, RKill, Shortcut cleaner - #~# if re.search(r'^((JRT|RKill).*|sc-cleaner)', entry.name, re.IGNORECASE): - #~# shutil.move(entry.path, '{ClientDir}\\Info\\{name}'.format(name=entry.name, **global_vars)) os.makedirs('{ClientDir}\\Info'.format(**global_vars), exist_ok=True) if os.path.exists('{USERPROFILE}\\Desktop'.format(**global_vars['Env'])): for entry in os.scandir('{USERPROFILE}\\Desktop'.format(**global_vars['Env'])): # JRT, RKill, Shortcut cleaner if re.search(r'^((JRT|RKill).*|sc-cleaner)', entry.name, re.IGNORECASE): - _name = re.sub(r'^(.*)\.', '\1_{Date-Time}'.format(**global_vars), entry.name, re.IGNORECASE) - _name = '{ClientDir}\\Info\\{name}'.format(name=_name, **global_vars) + _name = '{ClientDir}\\Info\\{name}'.format(name=entry.name, **global_vars) shutil.move(entry.path, non_clobber_rename(_name)) run_program('rmdir "{path}"'.format(path='{ClientDir}\\Info'.format(**global_vars)), check=False, shell=True) @@ -1331,13 +1348,14 @@ def uninstall_sas(): # Config def config_classicstart(): + # User level, not system level _classicstart = '{PROGRAMFILES}\\Classic Shell\\ClassicStartMenu.exe'.format(**global_vars['Env']) _skin = '{PROGRAMFILES}\\Classic Shell\\Skins\\Metro-Win10-Black.skin7'.format(**global_vars['Env']) - extract_item('ClassicStart', silent=True) - + extract_item('ClassicStartSkin', silent=True) + # Stop Classic Start - run_program(_classicstart, ['-exit'], check=False) - + run_program([_classicstart, '-exit'], check=False) + # Configure winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'Software\IvoSoft\ClassicShell\Settings') winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'Software\IvoSoft\ClassicStartMenu\MRU') @@ -1348,13 +1366,14 @@ def config_classicstart(): winreg.SetValueEx(_key, 'MenuStyle', 0, winreg.REG_SZ, 'Win7') winreg.SetValueEx(_key, 'RecentPrograms', 0, winreg.REG_SZ, 'Recent') winreg.SetValueEx(_key, 'SkipMetro', 0, winreg.REG_DWORD, 1) - + # Enable Win10 theme if on Win10 if global_vars['OS']['Version'] == '10' and os.path.exists(_skin): winreg.SetValueEx(_key, 'SkinW7', 0, winreg.REG_SZ, 'Metro-Win10-Black') - + winreg.SetValueEx(_key, 'SkinVariationW7', 0, winreg.REG_SZ, '') + # Pin Google Chrome to Start Menu (Classic) - _source = '{BinDir}\\ClassicStart\\Google Chrome.lnk'.format(**global_vars) + _source = '{BinDir}\\ClassicStartSkin\\Google Chrome.lnk'.format(**global_vars) _dest_path = '{APPDATA}\\ClassicShell\\Pinned'.format(**global_vars['Env']) _dest = '{dest_path}\\Google Chrome.lnk'.format(dest_path=_dest_path) try: @@ -1362,15 +1381,59 @@ def config_classicstart(): shutil.copy(_source, _dest) except: pass # Meh, it's fine without - + # (Re)start Classic Start - run_program(_classicstart, ['-exit'], check=False) + run_program([_classicstart, '-exit'], check=False) sleep(1) kill_process('ClassicStartMenu.exe') run_program(_classicstart, check=False) -def config_explorer(): - pass +def config_explorer_system(): + # Disable Telemetry + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection', 0, winreg.KEY_WRITE) + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DataCollection', 0, winreg.KEY_WRITE) + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'AllowTelemetry', 0, winreg.REG_DWORD, 0) + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DataCollection', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'AllowTelemetry', 0, winreg.REG_DWORD, 0) + with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) as _key: + winreg.SetValueEx(_key, 'AllowTelemetry', 0, winreg.REG_DWORD, 0) + + # Disable Wi-Fi Sense + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting', 0, winreg.KEY_WRITE) + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots', 0, winreg.KEY_WRITE) + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'Value', 0, winreg.REG_DWORD, 0) + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'Value', 0, winreg.REG_DWORD, 0) + + # Disable Location Tracking + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'SensorPermissionState', 0, winreg.REG_DWORD, 0) + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'System\CurrentControlSet\Services\lfsvc\Service\Configuration', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'Status', 0, winreg.REG_DWORD, 0) + +def config_explorer_user(): + # Disable Cortana + winreg.CreateKeyEx(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Personalization\Settings', 0, winreg.KEY_WRITE) + winreg.CreateKeyEx(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\InputPersonalization', 0, winreg.KEY_WRITE) + winreg.CreateKeyEx(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\InputPersonalization\TrainedDataStore', 0, winreg.KEY_WRITE) + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Personalization\Settings', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'AcceptedPrivacyPolicy', 0, winreg.REG_DWORD, 0) + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\InputPersonalization', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'RestrictImplicitTextCollection', 0, winreg.REG_DWORD, 1) + winreg.SetValueEx(_key, 'RestrictImplicitInkCollection', 0, winreg.REG_DWORD, 1) + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\InputPersonalization\TrainedDataStore', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'HarvestContacts', 0, winreg.REG_DWORD, 1) + + # Hide Search button / box + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Search', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'SearchboxTaskbarMode', 0, winreg.REG_DWORD, 0) + + # Change default Explorer view to "Computer" + with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', access=winreg.KEY_WRITE) as _key: + winreg.SetValueEx(_key, 'LaunchTo', 0, winreg.REG_DWORD, 1) def update_clock(): # Set Timezone and sync clock @@ -1380,12 +1443,17 @@ def update_clock(): run_program('net start w32ime', check=False) run_program('w32tm /resync /nowait', check=False) -# Data Transfers +# Disk Management and Data Transfers def cleanup_transfer(): """Fix permissions and walk through transfer folder (from the bottom) and remove extraneous items.""" - run_program('attrib -a -h -r -s "{TransferDir}"'.format(**global_vars), check=False) - if os.path.exists(global_vars['TransferDir']): - for root, dirs, files in os.walk(global_vars['TransferDir'], topdown=False): + cmd = ['attrib', '-a', '-h', '-r', '-s', global_vars['Data']['Destination']] + run_program(cmd, check=False) + try: + os.rmdir(global_vars['Data']['Destination']) + except: + pass # Should only remove when empty + if os.path.exists(global_vars['Data']['Destination']): + for root, dirs, files in os.walk(global_vars['Data']['Destination'], topdown=False): for name in dirs: # Remove empty directories and junction points try: @@ -1400,117 +1468,48 @@ def cleanup_transfer(): except OSError: pass +def extract_keys(): + """Extract keys from provided hives and return a dict.""" + keys = {} + + # Extract keys + extract_item('ProduKey', silent=True) + for hive in find_software_hives(): + _cmd = [ + global_vars['Tools']['ProduKey'], + '/IEKeys', '0', + '/WindowsKeys', '1', + '/OfficeKeys', '1', + '/ExtractEdition', '1', + '/nosavereg', + '/regfile', hive, + '/scomma', ''] + _out = run_program(_cmd) + + for line in _out.stdout.decode().splitlines(): + # Add key to keys under product only if unique + _tmp = line.split(',') + _product = _tmp[0] + _key = _tmp[2] + if _product not in keys: + keys[_product] = [] + if _key not in keys[_product]: + keys[_product].append(_key) + + global_vars['Keys'] = keys + def is_valid_wim_image(item): - _valid = item.is_file() and re.search(r'\.wim$', item.name, flags=re.IGNORECASE) + _valid = bool(item.is_file() and REGEX_WIM_FILE.search(item.name)) if _valid: + extract_item('wimlib', silent=True) try: - _cmd = [global_vars['Tools']['wimlib-imagex'], 'info', '{image}'.format(image=item.path)] + _cmd = [global_vars['Tools']['wimlib-imagex'], 'info', item.path] run_program(_cmd) except subprocess.CalledProcessError: _valid = False print_log('WARNING: Image "{image}" damaged.'.format(image=item.name)) - sleep(2) return _valid -# Disks, Partitions, and Volumes -def get_attached_disk_info(): - """Get details about the attached disks and return a list of dicts.""" - disks = [] - # print_info('Getting drive info...') - - # Assign all the letters - assign_volume_letters() - - # Get disk numbers - with open(diskpart_script, 'w') as script: - script.write('list disk\n') - process_return = run_program('diskpart /s {script}'.format(script=diskpart_script)) - for tmp in re.findall(r'Disk (\d+)\s+\w+\s+(\d+\s+\w+)', process_return.stdout.decode()): - disks.append({'Number': tmp[0], 'Size': human_readable_size(tmp[1])}) - - # Get disk details - for disk in disks: - # Get partition style - with open(diskpart_script, 'w') as script: - script.write('select disk {Number}\n'.format(**disk)) - script.write('uniqueid disk\n') - process_return = run_program('diskpart /s {script}'.format(script=diskpart_script)) - if re.findall(r'Disk ID: {[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+}', process_return.stdout.decode()): - disk['Table'] = 'GPT' - elif re.findall(r'Disk ID: 00000000', process_return.stdout.decode()): - disk['Table'] = 'RAW' - elif re.findall(r'Disk ID: [A-Z0-9]+', process_return.stdout.decode()): - disk['Table'] = 'MBR' - else: - disk['Table'] = 'Unknown' - - # Get disk name/model and physical details - with open(diskpart_script, 'w') as script: - script.write('select disk {Number}\n'.format(**disk)) - script.write('detail disk\n') - process_return = run_program('diskpart /s {script}'.format(script=diskpart_script)) - tmp = process_return.stdout.decode().strip().splitlines() - # Remove empty lines and those without a ':' and split each remaining line at the ':' to form a key/value pair - tmp = [s.strip() for s in tmp if s.strip() != ''] - # Set disk name - disk['Name'] = tmp[4] - tmp = [s.split(':') for s in tmp if ':' in s] - # Add new key/value pairs to the disks variable - disk.update({key.strip(): value.strip() for (key, value) in tmp}) - - # Get partition info for disk - with open(diskpart_script, 'w') as script: - script.write('select disk {Number}\n'.format(**disk)) - script.write('list partition\n') - process_return = run_program('diskpart /s {script}'.format(script=diskpart_script)) - disk['Partitions'] = [] - for tmp in re.findall(r'Partition\s+(\d+)\s+\w+\s+(\d+\s+\w+)\s+', process_return.stdout.decode().strip()): - disk['Partitions'].append({'Number': tmp[0], 'Size': human_readable_size(tmp[1])}) - for par in disk['Partitions']: - # Get partition details - with open(diskpart_script, 'w') as script: - script.write('select disk {Number}\n'.format(**disk)) - script.write('select partition {Number}\n'.format(**par)) - script.write('detail partition\n') - process_return = run_program('diskpart /s {script}'.format(script=diskpart_script)) - for tmp in re.findall(r'Volume\s+\d+\s+(\w|RAW)\s+', process_return.stdout.decode().strip()): - if tmp == 'RAW': - par['FileSystem'] = 'RAW' - else: - par['Letter'] = tmp - try: - process_return2 = run_program('fsutil fsinfo volumeinfo {Letter}:'.format(**par)) - for line in process_return2.stdout.decode().splitlines(): - line = line.strip() - # Get partition name - match = re.search(r'Volume Name\s+:\s+(.*)$', line) - if match: - par['Name'] = match.group(1).strip() - # Get filesystem type - match = re.search(r'File System Name\s+:\s+(.*)$', line) - if match: - par['FileSystem'] = match.group(1).strip() - usage = shutil.disk_usage('{Letter}:\\'.format(Letter=tmp)) - par['Used Space'] = human_readable_size(usage.used) - except subprocess.CalledProcessError: - par['FileSystem'] = 'Unknown' - # Get MBR type / GPT GUID for extra details on "Unknown" partitions - for tmp in re.findall(r'Type\s+:\s+(\S+)', process_return.stdout.decode().strip()): - par['Type'] = tmp - uid = partition_uids.lookup_guid(tmp) - if uid is not None: - par.update({ - 'Description': uid.get('Description', ''), - 'OS': uid.get('OS', '')}) - # Ensure the Name has been set - if 'Name' not in par: - par['Name'] = '' - if 'FileSystem' not in par: - par['FileSystem'] = 'Unknown' - - # Done - return disks - def mount_backup_shares(): """Mount the backup shares unless labeled as already mounted.""" for server in BACKUP_SERVERS: @@ -1533,27 +1532,346 @@ def mount_backup_shares(): print_warning('Failed to mount \\\\{Name}\\{Share} ({IP})'.format(**server)) sleep(1) -def select_backup(ticket): - """Find any backups for the ticket stored on one of the BACKUP_SERVERS. Returns path as a os.DirEntry.""" - _backups = [] +def run_fast_copy(items=None, dest=None): + if items is None or dest is None: + raise Exception + elif len(items) == 0: + raise Exception + + cmd = [global_vars['Tools']['FastCopy'], *FAST_COPY_ARGS] + if 'LogFile' in global_vars: + cmd.append('/logfile={LogFile}'.format(**global_vars)) + cmd.extend(items) + cmd.append('/to={dest}\\'.format(dest=dest)) + run_program(cmd) + +def run_wimextract(source=None, items=None, dest=None): + if source is None or items is None or dest is None: + raise Exception + elif len(items) == 0: + raise Exception + extract_item('wimlib', silent=True) + + # Write files.txt + with open('{TmpDir}\\wim_files.txt'.format(**global_vars), 'w') as f: + # Defaults + for item in items: + f.write('{item}\n'.format(item=item)) + sleep(1) # For safety? + + # Extract files + cmd = [ + global_vars['Tools']['wimlib-imagex'], + 'extract', + source, '1', + '@{TmpDir}\\wim_files.txt'.format(**global_vars), + '--dest-dir={dest}\\'.format(dest=dest), + '--no-acls', + '--nullglob'] + run_program(cmd) + +def save_keys(): + key_list = [] + if global_vars['Keys']: + for product in sorted(global_vars['Keys']): + key_list.append(product) + for key in sorted(global_vars['Keys'][product]): + key_list.append(' {key}'.format(key=key)) + else: + key_list.append('No keys found.') + + return key_list + +def scan_backup(): + if 'Source' not in global_vars['Data']: + raise Exception + backup = global_vars['Data']['Source'] + global_vars['Data']['Selected Items'] = [] + + if backup.is_dir(): + # File-Based + print_standard('Scanning File-Based backup: {}'.format(backup.path)) + scan_backup_folder(backup) + else: + # Image-Based + if REGEX_WIM_FILE.search(backup.name): + print_standard('Scanning Image-Based backup: {}'.format(backup.path)) + selected_items = scan_backup_wim(backup) + else: + print_error('ERROR: Unsupported image: {}'.format(backup.path)) + raise GenericError + +def scan_backup_folder(backup_folder=None, rel_path=None, interactive=True): + if backup_folder is None: + raise Exception + win_olds = [] + dest = '{dest}{rel_path}'.format( + dest = global_vars['Data']['Destination'], + rel_path = '' if rel_path is None else '\\'+rel_path) + + # Root items + _items = [] + for item in os.scandir(backup_folder.path): + if REGEX_INCL_ROOT_ITEMS.search(item.name): + _items.append(item.path) + elif not REGEX_EXCL_ROOT_ITEMS.search(item.name): + if (not interactive + or ask('Copy: "{rel_path}{name}" ?'.format(name=item.name, rel_path='' if rel_path is None else rel_path+'\\'))): + _items.append(item.path) + if REGEX_WINDOWS_OLD.search(item.name): + win_olds.append(item) + if len(_items) > 0: + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Root Items...'.format('' if rel_path is None else rel_path+'\\'), + 'Items': _items.copy(), + 'Destination': dest}) + + # Fonts + if os.path.exists('{}\\Windows\\Fonts'.format(backup_folder.path)): + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Fonts...'.format('' if rel_path is None else rel_path+'\\'), + 'Items': ['{}\\Windows\\Fonts'.format(backup_folder.path)], + 'Destination': '{}\\{}'.format(dest, 'Windows')}) + _items.append('{source}\\Windows\\Fonts'.format(source=backup_folder.path)) + + # Registry + _items = [] + if os.path.exists('{}\\Windows\\System32\\config'.format(backup_folder.path)): + _items.append('{}\\Windows\\System32\\config'.format(backup_folder.path)) + if os.path.exists('{}\\Windows\\System32\\OEM'.format(backup_folder.path)): + _items.append('{}\\Windows\\System32\\OEM'.format(backup_folder.path)) + if len(_items) > 0: + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Registry...'.format('' if rel_path is None else rel_path+'\\'), + 'Items': _items.copy(), + 'Destination': '{}\\{}'.format(dest, 'Windows\\System32')}) + + # Windows.old(s) + for old in win_olds: + scan_backup_folder(old.path, rel_path=old.name, interactive=False) + +def scan_backup_wim(backup_file=None, rel_path=None, interactive=True): + if backup_file is None: + raise Exception + if rel_path is None: + rel_path = '' + else: + rel_path = rel_path + '\\' + win_olds = [] + + # Scan source + extract_item('wimlib', silent=True) + _cmd = [ + global_vars['Tools']['wimlib-imagex'], 'dir', + backup_file.path, '1'] + try: + _list = run_program(_cmd) + except subprocess.CalledProcessError as err: + print_error('ERROR: Failed to get file list.') + raise + + # Root Items + _items = [] + root_items = [i.strip() for i in _list.stdout.decode('utf-8', 'ignore').splitlines() if i.count('\\') == 1 and i.strip() != '\\'] + if rel_path: + root_items = [i.replace(rel_path, '') for i in root_items if rel_path in i] + for item in root_items: + if REGEX_INCL_ROOT_ITEMS.search(item): + _items.append(item) + elif not REGEX_EXCL_ROOT_ITEMS.search(item): + if (not interactive + or ask('Extract: "{rel_path}{name}" ?'.format(name=item, rel_path=rel_path))): + _items.append('{}{}'.format(rel_path, item)) + if REGEX_WINDOWS_OLD.search(item): + win_olds.append(item) + if len(_items) > 0: + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Root Items...'.format(rel_path), + 'Items': _items.copy(), + 'Destination': global_vars['Data']['Destination']}) + + # Fonts + if wim_contains(backup_file.path, '{}Windows\\Fonts'.format(rel_path)): + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Fonts...'.format(rel_path), + 'Items': ['{}\\Windows\\Fonts'.format(rel_path)], + 'Destination': global_vars['Data']['Destination']}) + + # Registry + _items = [] + if wim_contains(backup_file.path, '{}Windows\\System32\\config'.format(rel_path)): + _items.append('{}Windows\\System32\\config'.format(rel_path)) + if wim_contains(backup_file.path, '{}Windows\\System32\\OEM'.format(rel_path)): + _items.append('{}Windows\\System32\\OEM'.format(rel_path)) + if len(_items) > 0: + global_vars['Data']['Selected Items'].append({ + 'Message': '{}Registry...'.format(rel_path), + 'Items': _items.copy(), + 'Destination': global_vars['Data']['Destination']}) + + # Windows.old(s) + for old in win_olds: + scan_backup_wim(backup_file, rel_path=old, interactive=False) + +def select_backup(): + """Select backup from those found on the BACKUP_SERVERS for the ticket.""" + sources = [] mount_backup_shares() + + # Check for ticket folders on servers for server in BACKUP_SERVERS: if server['Mounted']: + print_standard('Scanning {server}...'.format(server=server['Name'])) for d in os.scandir('\\\\{IP}\\{Share}'.format(**server)): - if d.is_dir() and re.match('^{}'.format(ticket), d.name): - _backups.append({'Name': '{s_name}: {backup}'.format(s_name=server['Name'], backup=d.name), 'Dir': d}) + if d.is_dir() and re.match('^{}'.format(global_vars['TicketNumber']), d.name): + # Add folder to sources + sources.append({ + 'Name': '{server:9}| File-Based: [DIR] {ticket}'.format(server=server['Name'], ticket=d.name), + 'Server': server, + 'Source': d}) + + # Check for images and subfolders + for ticket_folder in sources.copy(): + for item in os.scandir(ticket_folder['Source'].path): + if item.is_dir(): + # Add folder to sources + sources.append({ + 'Name': '{server:9}| File-Based: [DIR] {ticket}\\{folder}'.format( + folder = item.name, + server = ticket_folder['Server']['Name'], + ticket = ticket_folder['Source'].name), + 'Server': ticket_folder['Server'], + 'Source': item}) + + # Check for images in folder + for subitem in os.scandir(item.path): + if REGEX_WIM_FILE.search(item.name): + # Add image to sources + try: + size = human_readable_size(item.stat().st_size) + except: + size = ' ? ?' # unknown + sources.append({ + 'Disabled': bool(not is_valid_wim_image(subitem)), + 'Name': '{server:9}| Image-Based: {size:>7} {ticket}\\{folder}\\{image}'.format( + folder = item.name, + image = subitem.name, + server = ticket_folder['Server']['Name'], + size = size, + ticket = ticket_folder['Source'].name), + 'Server': ticket_folder['Server'], + 'Source': subitem}) + elif REGEX_WIM_FILE.search(item.name): + # Add image to sources + try: + size = human_readable_size(item.stat().st_size) + except: + size = ' ? ?' # unknown + sources.append({ + 'Disabled': bool(not is_valid_wim_image(item)), + 'Name': '{server:9}| Image-Based: {size:>7} {ticket}\\{image}'.format( + image = item.name, + server = ticket_folder['Server']['Name'], + size = size, + ticket = ticket_folder['Source'].name), + 'Server': ticket_folder['Server'], + 'Source': item}) + + # Build Menu + sources.sort(key=itemgetter('Name')) actions = [{'Name': 'Quit', 'Letter': 'Q'}] - # Select backup path - if len(_backups) > 0: - selection = menu_select('Which backup are we using?', _backups, actions) + # Select backup from sources + if len(sources) > 0: + selection = menu_select('Which backup are we using?', sources, actions, disabled_label='DAMAGED') if selection == 'Q': - return None + umount_backup_shares() + exit_script() else: - return _backups[int(selection)-1]['Dir'] + global_vars['Data']['Source'] = sources[int(selection)-1]['Source'] else: - print_error('No backups found for ticket: {ticket}.'.format(ticket=ticket)) - return None + print_error('ERROR: No backups found for ticket: {TicketNumber}.'.format(**global_vars)) + umount_backup_shares() + pause("Press Enter to exit...") + exit_script() + +def select_destination(): + """Select destination for data 1 transfer.""" + disk = select_disk() + path = '{disk}{folder_path}_{Date}'.format( + disk = disk['Disk'].mountpoint, + folder_path = 'WK\\Transfer' if 'fixed' in disk['Disk'].opts else 'WK-Transfer', + **global_vars) + + # Avoid merging with existing transfer + path = non_clobber_rename(path) + os.makedirs(path, exist_ok=True) + + global_vars['Data']['Destination'] = path + +def select_disk(): + """Select disk from attached disks. returns dict.""" + actions = [{'Name': 'Quit', 'Letter': 'Q'}] + disks = [] + for d in psutil.disk_partitions(): + info = { + 'Disk': d, + 'Name': d.mountpoint} + try: + usage = psutil.disk_usage(d.device) + free = '{free} / {total} available'.format( + free = human_readable_size(usage.free, 2), + total = human_readable_size(usage.total, 2)) + except: + # Meh, leaving unsupported destinations out + pass + # free = 'Unknown' + # info['Disabled'] = True + else: + info['Display Name'] = '{disk} ({free})'.format(disk=info['Name'], free=free) + disks.append(info) + + selection = menu_select('Which disk are we transferring to?', disks, actions) + if selection == 'Q': + exit_script() + else: + return disks[int(selection)-1] + +def transfer_backup(): + if 'Source' not in global_vars['Data']: + raise Exception + backup = global_vars['Data']['Source'] + + if backup.is_dir(): + # File-Based + transfer_backup_file_based() + else: + # Image-Based + if REGEX_WIM_FILE.search(backup.name): + transfer_backup_image_based() + else: + print_error('ERROR: Unsupported image: {}'.format(backup.path)) + raise GenericError + +def transfer_backup_file_based(): + if 'Source' not in global_vars['Data'] or 'Selected Items' not in global_vars['Data']: + raise Exception + backup = global_vars['Data']['Source'] + selected_items = global_vars['Data']['Selected Items'] + + # Run FastCopy for each selection "group" + for group in selected_items: + try_and_print(message=group['Message'], function=run_fast_copy, cs='Done', items=group['Items'], dest=group['Destination']) + +def transfer_backup_image_based(): + if 'Source' not in global_vars['Data'] or 'Selected Items' not in global_vars['Data']: + raise Exception + backup = global_vars['Data']['Source'] + selected_items = global_vars['Data']['Selected Items'] + + # Run wimlib-imagex for each selection "group" + for group in selected_items: + try_and_print(message=group['Message'], function=run_wimextract, cs='Done', source=global_vars['Data']['Source'].path, items=group['Items'], dest=group['Destination']) def umount_backup_shares(): """Unnount the backup shares regardless of current status.""" @@ -1567,15 +1885,235 @@ def umount_backup_shares(): print_error('Failed to umount \\\\{Name}\\{Share}.'.format(**server)) sleep(1) +def wim_contains(source_path=None, file_path=None): + if file_path is None or source_path is None: + raise Exception + + _cmd = [ + global_vars['Tools']['wimlib-imagex'], 'dir', + '{source}'.format(source=source_path), '1', + '--path={}'.format(file_path), + '--one-file-only'] + try: + run_program(_cmd) + except subprocess.CalledProcessError: + return False + else: + return True + +# Kit Updates +def download_file(out_dir, out_name, source_url): + """Downloads a file using curl.""" + extract_item('curl', silent=True) + _cmd = [ + global_vars['Tools']['curl'], + # '-#LSfo', # ProgressBar + '-Lfso', + '{out_dir}/{out_name}'.format(out_dir=out_dir, out_name=out_name), + source_url] + os.makedirs(out_dir, exist_ok=True) + run_program(_cmd, pipe=False) + +def resolve_dynamic_url(source_url, regex): + """Download the "download page" and scan for a url using the regex provided; returns str.""" + # Download the "download page" + extract_item('curl', silent=True) + _tmp_file = '{TmpDir}/webpage.tmp'.format(**global_vars) + _cmd = [ + global_vars['Tools']['curl'], + '-#LSfo', + _tmp_file, + source_url] + try: + run_program(_cmd) + except: + # "Fail silently as the download_file() function will catch it + return None + + # Scan the file for the regex + with open(_tmp_file, 'r') as file: + for line in file: + if re.search(regex, line): + _url = line.strip() + _url = re.sub(r'.*(a |)href="([^"]+)".*', r'\2', _url) + _url = re.sub(r".*(a |)href='([^']+)'.*", r'\2', _url) + break + + # Cleanup and return + os.remove(_tmp_file) + return _url + +def update_adwcleaner(): + _path = global_vars['BinDir'] + _name = 'AdwCleaner.exe' + _dl_page = 'http://www.bleepingcomputer.com/download/adwcleaner/dl/125/' + _regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/a/adwcleaner/AdwCleaner\.exe' + _url = resolve_dynamic_url(_dl_page, _regex) + download_file(_path, _name, _url) + +def update_eset(): + _path = global_vars['BinDir'] + _name = 'ESET.exe' + _url = 'http://download.eset.com/special/eos/esetsmartinstaller_enu.exe' + download_file(_path, _name, _url) + +def update_jrt(): + _path = global_vars['BinDir'] + _name = 'JRT.exe' + _url = 'http://downloads.malwarebytes.org/file/jrt' + download_file(_path, _name, _url) + +def update_kvrt(): + _path = global_vars['BinDir'] + _name = 'KVRT.exe' + _url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe' + download_file(_path, _name, _url) + +def update_hitmanpro(): + _path = '{BinDir}/HitmanPro'.format(**global_vars) + _name = 'HitmanPro.exe' + _url = 'http://dl.surfright.nl/HitmanPro.exe' + download_file(_path, _name, _url) + + _name = 'HitmanPro64.exe' + _url = 'http://dl.surfright.nl/HitmanPro_x64.exe' + download_file(_path, _name, _url) + +def update_intel_driver_utility(): + _path = '{BinDir}/_Drivers'.format(**global_vars) + _name = 'Intel Driver Update Utility.exe' + _dl_page = 'http://www.intel.com/content/www/us/en/support/detect.html' + _regex = r'a href.*http(s|)://downloadmirror\.intel\.com/[a-zA-Z0-9]+/[a-zA-Z0-9]+/Intel%20Driver%20Update%20Utility%20Installer.exe' + _url = resolve_dynamic_url(_dl_page, _regex) + _url = resolve_dynamic_url(_dl_page, _regex) + download_file(_path, _name, _url) + +def update_intel_ssd_toolbox(): + _path = '{BinDir}/_Drivers'.format(**global_vars) + _name = 'Intel SSD Toolbox.exe' + _dl_page = 'https://downloadcenter.intel.com/download/26085/Intel-Solid-State-Drive-Toolbox' + _regex = r'href=./downloads/eula/[0-9]+/Intel-Solid-State-Drive-Toolbox.httpDown=https\%3A\%2F\%2Fdownloadmirror\.intel\.com\%2F[0-9]+\%2Feng\%2FIntel\%20SSD\%20Toolbox\%20-\%20v[0-9\.]+.exe' + _url = resolve_dynamic_url(_dl_page, _regex) + _url = re.sub(r'.*httpDown=(.*)', r'\1', _url, flags=re.IGNORECASE) + _url = _url.replace('%3A', ':') + _url = _url.replace('%2F', '/') + download_file(_path, _name, _url) + +def update_rkill(): + _path = '{BinDir}/RKill'.format(**global_vars) + _name = 'RKill.exe' + _dl_page = 'http://www.bleepingcomputer.com/download/rkill/dl/10/' + _regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/r/rkill/rkill\.exe' + _url = resolve_dynamic_url(_dl_page, _regex) + download_file(_path, _name, _url) + +def update_samsung_magician(): + print_warning('Disabled.') + #~Broken~# _path = '{BinDir}/_Drivers'.format(**global_vars) + #~Broken~# _name = 'Samsung Magician.zip' + #~Broken~# _dl_page = 'http://www.samsung.com/semiconductor/minisite/ssd/download/tools.html' + #~Broken~# _regex = r'href=./semiconductor/minisite/ssd/downloads/software/Samsung_Magician_Setup_v[0-9]+.zip' + #~Broken~# _url = resolve_dynamic_url(_dl_page, _regex) + #~Broken~# # Convert relative url to absolute + #~Broken~# _url = 'http://www.samsung.com' + _url + #~Broken~# download_file(_path, _name, _url) + #~Broken~# # Extract and replace old copy + #~Broken~# _args = [ + #~Broken~# 'e', '"{BinDir}/_Drivers/Samsung Magician.zip"'.format(**global_vars), + #~Broken~# '-aoa', '-bso0', '-bsp0', + #~Broken~# '-o"{BinDir}/_Drivers"'.format(**global_vars) + #~Broken~# ] + #~Broken~# run_program(seven_zip, _args) + #~Broken~# try: + #~Broken~# os.remove('{BinDir}/_Drivers/Samsung Magician.zip'.format(**global_vars)) + #~Broken~# #~PoSH~# Move-Item "$bin\_Drivers\Samsung*exe" "$bin\_Drivers\Samsung Magician.exe" $path 2>&1 | Out-Null + #~Broken~# except: + #~Broken~# pass + pass + +def update_sysinternalssuite(): + _path = '{BinDir}/tmp'.format(**global_vars) + _name = 'SysinternalsSuite.zip' + _url = 'https://download.sysinternals.com/files/SysinternalsSuite.zip' + download_file(_path, _name, _url) + # Extract + _args = [ + 'e', '"{BinDir}/tmp/SysinternalsSuite.zip"'.format(**global_vars), + '-aoa', '-bso0', '-bsp0', + '-o"{BinDir}/SysinternalsSuite"'.format(**global_vars)] + run_program(seven_zip, _args) + try: + os.remove('{BinDir}/tmp/SysinternalsSuite.zip'.format(**global_vars)) + except: + pass + +def update_tdsskiller(): + _path = global_vars['BinDir'] + _name = 'TDSSKiller.exe' + _url = 'http://media.kaspersky.com/utilities/VirusUtilities/EN/tdsskiller.exe' + download_file(_path, _name, _url) + # Installations +def install_adobe_reader(): + cmd = [ + '{BaseDir}/Installers/Extras/Office/Adobe Reader DC.exe'.format(**global_vars), + '/sAll', + '/msi', '/norestart', '/quiet', + 'ALLUSERS=1', + 'EULA_ACCEPT=YES'] + try_and_print(message='Adobe Reader DC...', function=run_program, cmd=cmd) + +def install_chrome_extensions(): + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Google\Chrome\Extensions', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Google\Chrome\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) + with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Google\Chrome\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) as _key: + winreg.SetValueEx(_key, 'update_url', 0, winreg.REG_SZ, 'https://clients2.google.com/service/update2/crx') + winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) + with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, r'Software\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco', 0, winreg.KEY_WRITE | winreg.KEY_WOW64_32KEY) as _key: + winreg.SetValueEx(_key, 'update_url', 0, winreg.REG_SZ, 'https://clients2.google.com/service/update2/crx') + def install_classicstart_skin(): - extract_item('ClassicStart', silent=True) - _source = '{BinDir}\\ClassicStart\\Metro-Win10-Black.skin7'.format(**global_vars) + if global_vars['OS']['Version'] not in ['8', '10']: + raise UnsupportedOSError + extract_item('ClassicStartSkin', silent=True) + _source = '{BinDir}\\ClassicStartSkin\\Metro-Win10-Black.skin7'.format(**global_vars) _dest_path = '{PROGRAMFILES}\\Classic Shell\\Skins'.format(**global_vars['Env']) _dest = '{dest_path}\\Metro-Win10-Black.skin7'.format(dest_path=_dest_path) os.makedirs(_dest_path, exist_ok=True) shutil.copy(_source, _dest) +def install_firefox_extensions(): + extract_item('FirefoxExtensions', silent=True) + extensions = ['uBlock0@raymondhill.net'] + dests = ['{PROGRAMFILES}\\Mozilla Firefox\\distribution\\extensions'.format(**global_vars['Env'])] + if 'PROGRAMFILES(X86)' in global_vars['Env']: + dests.append('{PROGRAMFILES(X86)}\\Mozilla Firefox\\distribution\\extensions'.format(**global_vars['Env'])) + for extension in extensions: + _source = '{BinDir}\\FirefoxExtensions\\{extension}'.format(extension=extension, **global_vars) + for dest in dests: + _dest = '{}\\{}'.format(dest, extension) + if not os.path.exists(dest): + shutil.copytree(_source, _dest) + +def install_ninite_bundle(mse=False): + if global_vars['OS']['Version'] in ['8', '10']: + # Modern selection + popen_program('{BaseDir}/Installers/Extras/Bundles/Modern.exe'.format(**global_vars)) + else: + # Legacy selection + if mse: + popen_program('{BaseDir}/Installers/Extras/Security/Microsoft Security Essentials.exe'.format(**global_vars)) + popen_program('{BaseDir}/Installers/Extras/Bundles/Legacy.exe'.format(**global_vars)) + +def install_vcredists(): + extract_item('_vcredists', silent=True) + prev_dir = os.getcwd() + os.chdir('{BinDir}/_vcredists'.format(**global_vars)) + for vcr in VCR_REDISTS: + try_and_print(message=vcr['Name'], function=run_program, cmd=vcr['Cmd']) + + os.chdir(prev_dir) + # Network def check_connection(): while True: @@ -1633,7 +2171,7 @@ def run_chkdsk(): if int(_out.returncode) > 0: # print_error(' ERROR: CHKDSK encountered errors') raise GenericError - + # Save stderr with open('{LogDir}\\CHKDSK.err'.format(**global_vars), 'a') as f: for line in _out.stderr.decode().splitlines(): @@ -1668,7 +2206,7 @@ def run_chkdsk_spotfix(): if int(_out.returncode) > 0: # print_error(' ERROR: CHKDSK encountered errors') raise GenericError - + # Save stderr with open('{LogDir}\\CHKDSK_Spotfix.err'.format(**global_vars), 'a') as f: for line in _out.stderr.decode().splitlines(): @@ -1742,7 +2280,7 @@ def run_kvrt(): '-accepteula', '-dontcryptsupportinfo', '-fixednames', '-d', global_vars['QuarantineDir'], '-processlevel', '3'] - run_program(_cmd, pipe=False) + popen_program(_cmd, pipe=False) def run_process_killer(): """Kill most running processes skipping those in the whitelist.txt.""" @@ -1763,7 +2301,7 @@ def run_rkill(): run_program(_cmd, check=False) wait_for_process('RKill') kill_process('notepad.exe') - + # RKill cleanup if os.path.exists('{USERPROFILE}\\Desktop'.format(**global_vars['Env'])): for item in os.scandir('{USERPROFILE}\\Desktop'.format(**global_vars['Env'])): @@ -1780,16 +2318,17 @@ def run_sfc_scan(): _out = run_program(_cmd, check=False) # Save stderr with open('{LogDir}\\SFC.err'.format(**global_vars), 'a') as f: - for line in _out.stderr.decode().splitlines(): + for line in _out.stderr.decode('utf-8', 'ignore').splitlines(): f.write(line.strip() + '\n') # Save stdout with open('{LogDir}\\SFC.log'.format(**global_vars), 'a') as f: - for line in _out.stdout.decode().splitlines(): + for line in _out.stdout.decode('utf-8', 'ignore').splitlines(): f.write(line.strip() + '\n') - # Report result - if re.findall(r'did\s+not\s+find\s+any\s+integrity\s+violations', _out.stdout.decode()): + # Check result + log_text = _out.stdout.decode('utf-8', 'ignore').replace('\0', '') + if re.findall(r'did\s+not\s+find\s+any\s+integrity\s+violations', log_text): pass - elif re.findall(r'successfully\s+repaired\s+them', _out.stdout.decode()): + elif re.findall(r'successfully\s+repaired\s+them', log_text): raise GenericRepair else: raise GenericError @@ -1806,6 +2345,54 @@ def run_tdsskiller(): '-dcexact', '-tdlfs'] run_program(_cmd, pipe=False) +# Windows Activation +def activate_windows_with_bios(): + """Attempt to activate Windows with a key stored in the BIOS.""" + # Code borrowed from https://github.com/aeruder/get_win8key + ##################################################### + #script to query windows 8.x OEM key from PC firmware + #ACPI -> table MSDM -> raw content -> byte offset 56 to end + #ck, 03-Jan-2014 (christian@korneck.de) + ##################################################### + bios_key = None + table = b"MSDM" + if acpi.FindAcpiTable(table) is True: + rawtable = acpi.GetAcpiTable(table) + #http://msdn.microsoft.com/library/windows/hardware/hh673514 + #byte offset 36 from beginning = Microsoft 'software licensing data structure' / 36 + 20 bytes offset from beginning = Win Key + bios_key = rawtable[56:len(rawtable)].decode("utf-8") + else: + raise Exception('ACPI table {} not found.'.format(str(table))) + if bios_key is None: + raise BIOSKeyNotFoundError + + # Install Key + run_program('cscript {SYSTEMROOT}\\System32\\slmgr.vbs /ipk {pkey} //nologo'.format(**global_vars['Env'], pkey=bios_key), check=False) + sleep(5) + + # Attempt activation + run_program('cscript {SYSTEMROOT}\\System32\\slmgr.vbs /ato //nologo'.format(**global_vars['Env']), check=False) + sleep(5) + + # Check status + if not windows_is_activated(): + raise Exception('Activation Failed') + +def update_windows_activation_status(): + if not re.search(r'(permanent|safe mode)', global_vars['OS']['Activation'], re.IGNORECASE): + _out = run_program('cscript /nologo {SYSTEMROOT}\\System32\\slmgr.vbs /xpr'.format(**global_vars['Env'])) + _out = _out.stdout.decode().splitlines() + _out = [l for l in _out if re.match(r'^\s', l)] + if len(_out) > 0: + global_vars['OS']['Activation'] = re.sub(r'^\s+', '', _out[0]) + else: + global_vars['OS']['Activation'] = 'Activation status unknown' + +def windows_is_activated(): + """Updates activation status, checks if activated, and returns a bool.""" + update_windows_activation_status() + return re.search(r'permanent', global_vars['OS']['Activation'], re.IGNORECASE) + # System Info def backup_file_list(): """Export current file listing for the system.""" @@ -1857,14 +2444,14 @@ def find_software_hives(): """Search for transferred SW hives and return a list.""" hives = [] search_paths = [global_vars['ClientDir']] - + while len(search_paths) > 0: for item in os.scandir(search_paths.pop(0)): if item.is_dir() and REGEX_REGISTRY_DIRS.search(item.name): search_paths.append(item.path) if item.is_file() and REGEX_SOFTWARE_HIVE.search(item.name): hives.append(item.path) - + return hives def get_installed_office(): @@ -1873,20 +2460,20 @@ def get_installed_office(): for line in sorted(f.readlines()): if REGEX_OFFICE.search(line): programs.append(line[4:82].strip()) - + if len(programs) == 0: programs = ['No programs found'] return programs def get_product_keys(): keys = [] - + with open ('{LogDir}\\Product Keys (ProduKey).txt'.format(**global_vars), 'r') as f: for line in f.readlines(): if re.search(r'^Product Name', line): line = re.sub(r'^Product Name\s+:\s+(.*)', r'\1', line.strip()) keys.append(line) - + if len(keys) == 0: keys = ['No product keys found'] return keys @@ -1895,13 +2482,12 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): """Get size of user folders for all users and return a dict of dicts.""" users = {} TMP_HIVE_PATH = 'HKU\\wk_tmp' - # Extract and configure du extract_item('SysinternalsSuite', filter='du*', silent=True) winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'Software\Sysinternals\Du') with winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Sysinternals\Du', access=winreg.KEY_WRITE) as _key: winreg.SetValueEx(_key, 'EulaAccepted', 0, winreg.REG_DWORD, 1) - + try: # Get SIDs if all_users: @@ -1910,7 +2496,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): out = run_program('wmic useraccount where name="{USERNAME}" get sid'.format(**global_vars['Env'])) sids = out.stdout.decode().splitlines() sids = [s.strip() for s in sids if re.search(r'-1\d+$', s.strip())] - + # Get Usernames and add to _users for sid in sids: try: @@ -1923,7 +2509,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): except subprocess.CalledProcessError: # This results in an empty dict being returned, leaving it to the calling section to handle that case pass - + # Use username/SID pairs to check profile folder sizes for u in users.keys(): try: @@ -1947,7 +2533,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): except subprocess.CalledProcessError: # Failed to get folder size pass - + # Check if user hive is already loaded unload_hive = False try: @@ -1962,7 +2548,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): except subprocess.CalledProcessError: # Failed to load user hive pass - + # Get Shell folder sizes key = r'{SID}\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'.format(**users[u]) try: @@ -1996,7 +2582,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): except FileNotFoundError: # Can't read the user hive, skipping this user. pass - + # Extra shell folder check for folder in SHELL_FOLDERS.keys(): if folder not in users[u]['Shell Folders']: @@ -2018,7 +2604,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): except subprocess.CalledProcessError: # Failed to get folder size pass - + # Extra folder sizes for folder in EXTRA_FOLDERS: folder_path = '{ProfileImagePath}\\{folder}'.format(folder=folder, **users[u]) @@ -2043,7 +2629,7 @@ def get_user_data_size_info(all_users=True, indent=8, width=32): if unload_hive: _cmd = 'reg unload {tmp_path}'.format(tmp_path=TMP_HIVE_PATH) run_program(_cmd, check=False) - + except FileNotFoundError: # Can't find the ProfileImagePath, skipping this user. pass @@ -2064,7 +2650,7 @@ def run_aida64(): '/CUSTOM', '{BinDir}\\AIDA64\\full.rpf'.format(**global_vars), '/HTML', '/SILENT', '/SAFEST'] run_program(_cmd, check=False) - + # Installed Programs if not os.path.exists('{LogDir}\\Installed Program List (AIDA64).txt'.format(**global_vars)): _cmd = [ @@ -2073,7 +2659,7 @@ def run_aida64(): '/CUSTOM', '{BinDir}\\AIDA64\\installed_programs.rpf'.format(**global_vars), '/TEXT', '/SILENT', '/SAFEST'] run_program(_cmd, check=False) - + # Product Keys if not os.path.exists('{LogDir}\\Product Keys (AIDA64).txt'.format(**global_vars)): _cmd = [ @@ -2161,8 +2747,8 @@ def show_free_space(): def show_installed_ram(): mem = psutil.virtual_memory() - if mem.total > 8053063680: - # > 7.5 Gb so 8Gb or greater + if mem.total > 5905580032: + # > 5.5 Gb so 6Gb or greater print_standard(human_readable_size(mem.total).strip()) elif mem.total > 3758096384: # > 3.5 Gb so 4Gb or greater @@ -2210,7 +2796,7 @@ def show_user_data_summary(all_users=True, indent=8, width=32): for user in sorted(users.keys()): print_success(' User: {user}'.format(user=user)) print_standard(users[user].get('ProfileSize', 'Unknown')) - print_standard(' '*indent + '-'*(width+6)) + print_standard('{}{}'.format(' '*indent, '-'*(width+6))) for folder in sorted(users[user]['Shell Folders']): print_standard(users[user]['Shell Folders'][folder]) for folder in sorted(users[user]['Extra Folders']): diff --git a/.bin/Scripts/gen_office.bash b/.bin/Scripts/gen_office.bash index 8fe8aede..2edf109f 100644 --- a/.bin/Scripts/gen_office.bash +++ b/.bin/Scripts/gen_office.bash @@ -3,51 +3,10 @@ cd ../../ mkdir Installers/Extras/Office -p pushd Installers/Extras/Office -mkdir 2007 mkdir 2010 mkdir 2013 mkdir 2016 -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/2007 Microsoft Office system (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/2007 Microsoft Office system (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/2007 Microsoft Office system (SP3).cmd" -sed -ir 's/__ITEM__/2007 Microsoft Office system (SP3)/' "2007/2007 Microsoft Office system (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Access 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Access 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Access 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Access 2007 (SP3)/' "2007/Access 2007 (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/AccessRuntime2007.cmd" -sed -ir 's/__TYPE__/Office/' "2007/AccessRuntime2007.cmd" -sed -ir 's/__PATH__/2007/' "2007/AccessRuntime2007.cmd" -sed -ir 's/__ITEM__/AccessRuntime2007.exe/' "2007/AccessRuntime2007.cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Home and Student 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Home and Student 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Home and Student 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Home and Student 2007 (SP3)/' "2007/Home and Student 2007 (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Outlook 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Outlook 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Outlook 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Outlook 2007 (SP3)/' "2007/Outlook 2007 (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Professional 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Professional 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Professional 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Professional 2007 (SP3)/' "2007/Professional 2007 (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Publisher 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Publisher 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Publisher 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Publisher 2007 (SP3)/' "2007/Publisher 2007 (SP3).cmd" - -cp ../../../.bin/Scripts/Launcher_Template.cmd "2007/Small Business 2007 (SP3).cmd" -sed -ir 's/__TYPE__/Office/' "2007/Small Business 2007 (SP3).cmd" -sed -ir 's/__PATH__/2007/' "2007/Small Business 2007 (SP3).cmd" -sed -ir 's/__ITEM__/Small Business 2007 (SP3)/' "2007/Small Business 2007 (SP3).cmd" - cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Outlook 2010 (SP2) (x32).cmd" sed -ir 's/__TYPE__/Office/' "2010/Outlook 2010 (SP2) (x32).cmd" sed -ir 's/__PATH__/2010/' "2010/Outlook 2010 (SP2) (x32).cmd" @@ -83,11 +42,6 @@ sed -ir 's/__TYPE__/Office/' "2013/Home and Student 2013 (x64).cmd" sed -ir 's/__PATH__/2013/' "2013/Home and Student 2013 (x64).cmd" sed -ir 's/__ITEM__/hs_64.xml/' "2013/Home and Student 2013 (x64).cmd" -cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Office 365 2013 (x64).cmd" -sed -ir 's/__TYPE__/Office/' "2013/Office 365 2013 (x64).cmd" -sed -ir 's/__PATH__/2013/' "2013/Office 365 2013 (x64).cmd" -sed -ir 's/__ITEM__/365_64.xml/' "2013/Office 365 2013 (x64).cmd" - cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Home and Business 2013 (x32).cmd" sed -ir 's/__TYPE__/Office/' "2013/Home and Business 2013 (x32).cmd" sed -ir 's/__PATH__/2013/' "2013/Home and Business 2013 (x32).cmd" @@ -98,11 +52,6 @@ sed -ir 's/__TYPE__/Office/' "2013/Home and Student 2013 (x32).cmd" sed -ir 's/__PATH__/2013/' "2013/Home and Student 2013 (x32).cmd" sed -ir 's/__ITEM__/hs_32.xml/' "2013/Home and Student 2013 (x32).cmd" -cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Office 365 2013 (x32).cmd" -sed -ir 's/__TYPE__/Office/' "2013/Office 365 2013 (x32).cmd" -sed -ir 's/__PATH__/2013/' "2013/Office 365 2013 (x32).cmd" -sed -ir 's/__ITEM__/365_32.xml/' "2013/Office 365 2013 (x32).cmd" - cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Home and Business 2016 (x64).cmd" sed -ir 's/__TYPE__/Office/' "2016/Home and Business 2016 (x64).cmd" sed -ir 's/__PATH__/2016/' "2016/Home and Business 2016 (x64).cmd" @@ -132,4 +81,4 @@ cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Office 365 2016 (x32).cmd" sed -ir 's/__TYPE__/Office/' "2016/Office 365 2016 (x32).cmd" sed -ir 's/__PATH__/2016/' "2016/Office 365 2016 (x32).cmd" sed -ir 's/__ITEM__/365_32.xml/' "2016/Office 365 2016 (x32).cmd" -popd \ No newline at end of file +popd diff --git a/.bin/Scripts/init_client_dir.cmd b/.bin/Scripts/init_client_dir.cmd index c88312ae..e3225415 100644 --- a/.bin/Scripts/init_client_dir.cmd +++ b/.bin/Scripts/init_client_dir.cmd @@ -48,9 +48,9 @@ if defined _info mkdir "%client_dir%\Info">nul 2>&1 if defined _office mkdir "%client_dir%\Office">nul 2>&1 if defined _quickbooks mkdir "%client_dir%\QuickBooks">nul 2>&1 if defined _quarantine mkdir "%client_dir%\Quarantine">nul 2>&1 -if defined _transfer mkdir "%client_dir%\Transfer">nul 2>&1 +if defined _transfer mkdir "%client_dir%\Transfer_%iso_date%">nul 2>&1 :Done goto Exit -:Exit \ No newline at end of file +:Exit diff --git a/.bin/Scripts/install_sw_bundle.py b/.bin/Scripts/install_sw_bundle.py index db97cc95..0a75c2d5 100644 --- a/.bin/Scripts/install_sw_bundle.py +++ b/.bin/Scripts/install_sw_bundle.py @@ -1,86 +1,51 @@ # Wizard Kit: Install the standard SW bundle based on the OS version import os -import re +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: SW Bundle Tool') +sys.path.append(os.getcwd()) from functions import * -vars_wk = init_vars_wk() -vars_wk.update(init_vars_os()) +init_global_vars() +global_vars['LogFile'] = '{LogDir}\\Install SW Bundle.log'.format(**global_vars) if __name__ == '__main__': - stay_awake(vars_wk) - errors = False - - # Adobe Reader - if vars_wk['OS']['Version'] != 'Vista': - print('Installing Adobe Reader DC...') - _prog = '{BaseDir}/Installers/Extras/Office/Adobe Reader DC.exe'.format(**vars_wk) - _args = ['/sAll', '/msi', '/norestart', '/quiet', 'ALLUSERS=1', 'EULA_ACCEPT=YES'] - try: - run_program(_prog, _args) - except: - print_error('Failed to install Adobe Reader DC') - errors = True - - # Visual C++ Redists - print('Installing Visual C++ Runtimes...') - extract_item('_vcredists', vars_wk, silent=True) - os.chdir('{BinDir}/_vcredists'.format(**vars_wk)) - _redists = [ - # 2005 - {'Prog': 'msiexec', - 'Args': ['/i', '2005sp1\\x86\\vcredist.msi', '/qb!', '/norestart']}, - {'Prog': 'msiexec', - 'Args': ['/i', '2005sp1\\x64\\vcredist.msi', '/qb!', '/norestart']}, - # 2008 - {'Prog': '2008sp1\\vcredist_x86.exe', - 'Args': ['/qb! /norestart']}, - {'Prog': '2008sp1\\vcredist_x64.exe', - 'Args': ['/qb! /norestart']}, - # 2010 - {'Prog': '2010\\vcredist_x86.exe', - 'Args': ['/passive', '/norestart']}, - {'Prog': '2010\\vcredist_x64.exe', - 'Args': ['/passive', '/norestart']}, - # 2012 - {'Prog': '2012u4\\vcredist_x86.exe', - 'Args': ['/passive', '/norestart']}, - {'Prog': '2012u4\\vcredist_x64.exe', - 'Args': ['/passive', '/norestart']}, - # 2013 - {'Prog': '2013\\vcredist_x86.exe', - 'Args': ['/install', '/passive', '/norestart']}, - {'Prog': '2013\\vcredist_x64.exe', - 'Args': ['/install', '/passive', '/norestart']}, - # 2015 - {'Prog': '2015u3\\vc_redist.x86.exe', - 'Args': ['/install', '/passive', '/norestart']}, - {'Prog': '2015u3\\vc_redist.x64.exe', - 'Args': ['/install', '/passive', '/norestart']}, - ] - for vcr in _redists: - try: - run_program(vcr['Prog'], vcr['Args'], check=False) - except: - print_error('Failed to install {}'.format(vcr['Prog'])) - errors = True - - # Main Bundle - if vars_wk['OS']['Version'] in ['Vista', '7']: - # Legacy selection - if ask('Install MSE?'): - _prog = '{BaseDir}/Installers/Extras/Security/Microsoft Security Essentials.exe'.format(**vars_wk) - subprocess.Popen(_prog) - _prog = '{BaseDir}/Installers/Extras/Bundles/Legacy.exe'.format(**vars_wk) - subprocess.Popen(_prog) - elif vars_wk['OS']['Version'] in ['8', '10']: - # Modern selection - _prog = '{BaseDir}/Installers/Extras/Bundles/Modern.exe'.format(**vars_wk) - subprocess.Popen(_prog) - - if errors: - pause("Press Enter to exit...") - exit_script(vars_wk) + try: + stay_awake() + os.system('cls') + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + answer_wk_extensions = ask('Install WK Extensions?') + answer_adobe_reader = ask('Install Adobe Reader?') + answer_vcr = ask('Install Visual C++ Runtimes?') + if global_vars['OS']['Version'] in ['7']: + # Vista is dead, not going to check for it + answer_mse = ask('Install MSE?') + else: + answer_mse = False + + if answer_wk_extensions: + print_info('Installing WK Extensions') + try_and_print(message='Classic Shell skin...', function=install_classicstart_skin, other_results=other_results) + try_and_print(message='Google Chrome extensions...', function=install_chrome_extensions) + try_and_print(message='Mozilla Firefox extensions...', function=install_firefox_extensions) + print_info('Installing Programs') + if answer_adobe_reader: + install_adobe_reader() + if answer_vcr: + install_vcredists() + try_and_print(message='Ninite bundle...', cs='Started', function=install_ninite_bundle, mse=answer_mse) + print_standard('\nDone.') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/safemode_enter.py b/.bin/Scripts/safemode_enter.py index 5247c03c..c745f0b3 100644 --- a/.bin/Scripts/safemode_enter.py +++ b/.bin/Scripts/safemode_enter.py @@ -1,24 +1,31 @@ # Wizard Kit: Enter SafeMode by editing the BCD import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: SafeMode Tool') +sys.path.append(os.getcwd()) from functions import * if __name__ == '__main__': - if ask('Enable booting to SafeMode (with Networking)?'): - # Edit BCD to set safeboot as default - run_program('bcdedit /set {default} safeboot network', check=False) + try: + if ask('Enable booting to SafeMode (with Networking)?'): + # Edit BCD to set safeboot as default + run_program('bcdedit /set {default} safeboot network', check=False) + + # Enable MSI access under safemode + run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False) + run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /ve /t REG_SZ /d "Service" /f', check=False) - # Enable MSI access under safemode - run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False) - run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /ve /t REG_SZ /d "Service" /f', check=False) - - ## Done ## - pause('Press Enter to reboot...') - run_program('shutdown -r -t 3', check=False) - - # Quit - quit() + ## Done ## + pause('Press Enter to reboot...') + run_program('shutdown -r -t 3', check=False) + + # Done + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/safemode_exit.py b/.bin/Scripts/safemode_exit.py index aad99677..23431f06 100644 --- a/.bin/Scripts/safemode_exit.py +++ b/.bin/Scripts/safemode_exit.py @@ -1,24 +1,31 @@ # Wizard Kit: Exit SafeMode by editing the BCD import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: SafeMode Tool') +sys.path.append(os.getcwd()) from functions import * if __name__ == '__main__': - if ask('Disable booting to SafeMode?'): - # Edit BCD to remove safeboot value - run_program('bcdedit /deletevalue {current} safeboot', check=False) - run_program('bcdedit /deletevalue {default} safeboot', check=False) + try: + if ask('Disable booting to SafeMode?'): + # Edit BCD to remove safeboot value + run_program('bcdedit /deletevalue {current} safeboot', check=False) + run_program('bcdedit /deletevalue {default} safeboot', check=False) + + # Disable MSI access under safemode + run_program(r'reg delete HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False) - # Disable MSI access under safemode - run_program(r'reg delete HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False) - - ## Done ## - pause('Press Enter to reboot...') - run_program('shutdown -r -t 3', check=False) - - # Quit - quit() + ## Done ## + pause('Press Enter to reboot...') + run_program('shutdown -r -t 3', check=False) + + # Done + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/sfc_scan.py b/.bin/Scripts/sfc_scan.py index 52c48b45..78b4d123 100644 --- a/.bin/Scripts/sfc_scan.py +++ b/.bin/Scripts/sfc_scan.py @@ -1,11 +1,12 @@ # Wizard Kit: SFC Tool import os -import re +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: SFC Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() @@ -15,10 +16,22 @@ def abort(): exit_script() if __name__ == '__main__': - stay_awake() - try_and_print(message='SFC scan...', function=run_sfc_scan, cs='CS', ns='NS', other_results=other_results) - - # Done - print_standard('\nDone.') - pause('Press Enter to exit...') - exit_script() + try: + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + }} + stay_awake() + try_and_print(message='SFC scan...', function=run_sfc_scan, other_results=other_results) + + # Done + print_standard('\nDone.') + pause('Press Enter to exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/sw_checklist.py b/.bin/Scripts/sw_checklist.py deleted file mode 100644 index 0bc28464..00000000 --- a/.bin/Scripts/sw_checklist.py +++ /dev/null @@ -1,78 +0,0 @@ -# Wizard Kit: Software Checklist - -import os - -# Init -os.chdir(os.path.dirname(os.path.realpath(__file__))) -os.system('title Wizard Kit: Software Checklist Tool') -from functions import * -init_global_vars() -set_global_vars(LogFile='{LogDir}\\Software Checklist.log'.format(**global_vars)) - -def abort(): - print_warning('Aborted.') - exit_script() - -if __name__ == '__main__': - stay_awake() - get_ticket_number() - os.system('cls') - print_info('Starting Software Checklist for Ticket #{TicketNumber}\n'.format(**global_vars)) - - # Configure - print_info('Configure') - try_and_print(message='Updating Clock...', function=update_clock, cs='Done') - if global_vars['OS']['Version'] in ['8', '10']: - try_and_print(message='Classic Start...', function=config_classicstart, cs='Done') - try_and_print(message='Explorer...', function=config_explorer, cs='Done') - - # Cleanup - print_info('Cleanup') - try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done') - try_and_print(message='AdwCleaner...', function=cleanup_adwcleaner, cs='Done') - try_and_print(message='ESET...', function=uninstall_eset, cs='Done') - # try_and_print(message='MBAM...', function=uninstall_mbam, cs='Done') - try_and_print(message='Super Anti-Spyware...', function=uninstall_sas, cs='Done') - - # Export system info - print_info('Backup System Information') - try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done') - # try_and_print(message='Browsers...', function=backup_browsers, cs='Done') - try_and_print(message='File listing...', function=backup_file_list, cs='Done') - try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') - try_and_print(message='Product Keys...', function=run_produkey, cs='Done') - try_and_print(message='Registry...', function=backup_registry, cs='Done') - - # User data - print_info('User Data') - show_user_data_summary() - - # Summary - print_info('Summary') - try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False) - try_and_print(message='', function=show_os_activation, ns='Unknown', silent_function=False) - try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True) - show_free_space() - try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False) - - # Upload info - print_info('Finalizing') - try_and_print(message='Compressing Info...', function=compress_info, cs='Done') - try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done') - - # Play audio, show devices, open Windows updates, and open Activation if necessary - popen_program('devmgmt.msc') - run_hwinfo_sensors() - if global_vars['OS']['Version'] == '10': - popen_program(['control', '/name', 'Microsoft.WindowsUpdate']) - else: - popen_program('wuapp') - if 'The machine is permanently activated.' not in global_vars['OS']['Activation']: - popen_program('slui') - sleep(3) - run_xmplay() - - # Done - print_standard('\nDone.') - pause('Press Enter exit...') - exit_script() diff --git a/.bin/Scripts/sw_diagnostics.py b/.bin/Scripts/sw_diagnostics.py deleted file mode 100644 index fd137f9c..00000000 --- a/.bin/Scripts/sw_diagnostics.py +++ /dev/null @@ -1,84 +0,0 @@ -# Wizard Kit: Software Diagnostics - -import os - -# Init -os.chdir(os.path.dirname(os.path.realpath(__file__))) -os.system('title Wizard Kit: Software Diagnostics Tool') -from functions import * -init_global_vars() -set_global_vars(LogFile='{LogDir}\\Software Diagnostics.log'.format(**global_vars)) - -def abort(): - print_warning('Aborted.') - pause("Press Enter to exit...") - exit_script() - -if __name__ == '__main__': - stay_awake() - get_ticket_number() - os.system('cls') - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - print_info('Starting Software Diagnostics for Ticket #{TicketNumber}\n'.format(**global_vars)) - - # Sanitize Environment - print_info('Sanitizing Environment') - try_and_print(message='Killing processes...', function=run_process_killer, cs='Done') - try_and_print(message='Running RKill...', function=run_rkill, cs='Done') - try_and_print(message='Running TDSSKiller...', function=run_tdsskiller, cs='Done') - - # Re-run if earlier process was stopped. - stay_awake() - - # Start diags - print_info('Starting Background Scans') - check_connection() - try_and_print(message='Running HitmanPro...', function=run_hitmanpro, cs='Started') - try_and_print(message='Running Autoruns...', function=run_autoruns, cs='Started') - - # OS Health Checks - print_info('OS Health Checks') - try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='SFC scan...', function=run_sfc_scan, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='DISM CheckHealth...', function=run_dism_scan_health, cs='CS', ns='NS', other_results=other_results) - - # Export system info - print_info('Backup System Information') - try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done') - try_and_print(message='BleachBit report...', function=run_bleachbit, cs='Done') - try_and_print(message='Browsers...', function=backup_browsers, cs='Done') - try_and_print(message='File listing...', function=backup_file_list, cs='Done') - try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') - try_and_print(message='Product Keys...', function=run_produkey, cs='Done') - try_and_print(message='Registry...', function=backup_registry, cs='Done') - - # Summary - print_info('Summary') - try_and_print(message='Temp Size:', function=show_temp_files_size, silent_function=False) - show_free_space() - try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False) - try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True) - try_and_print(message='Product Keys:', function=get_product_keys, ns='Unknown', print_return=True) - try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False) - try_and_print(message='', function=show_os_activation, ns='Unknown', silent_function=False) - - # User data - print_info('User Data') - show_user_data_summary() - - # Upload info - print_info('Finalizing') - try_and_print(message='Compressing Info...', function=compress_info, cs='Done') - try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done') - - # Done - print_standard('\nDone.') - pause('Press Enter to exit...') - exit_script() diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py new file mode 100644 index 00000000..2a267d7f --- /dev/null +++ b/.bin/Scripts/system_checklist.py @@ -0,0 +1,89 @@ +# Wizard Kit: System Checklist + +import os +import sys + +# Init +os.chdir(os.path.dirname(os.path.realpath(__file__))) +os.system('title Wizard Kit: System Checklist Tool') +sys.path.append(os.getcwd()) +from functions import * +init_global_vars() +global_vars['LogFile'] = '{LogDir}\\System Checklist.log'.format(**global_vars) + +def abort(): + print_warning('Aborted.') + exit_script() + +if __name__ == '__main__': + try: + stay_awake() + get_ticket_number() + os.system('cls') + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + 'BIOSKeyNotFoundError': 'BIOS key not found', + }, + 'Warning': {}} + print_info('Starting System Checklist for Ticket #{TicketNumber}\n'.format(**global_vars)) + + # Configure + print_info('Configure') + if global_vars['OS']['Version'] == '10': + try_and_print(message='Explorer...', function=config_explorer_system, cs='Done') + try_and_print(message='Updating Clock...', function=update_clock, cs='Done') + + # Cleanup + print_info('Cleanup') + try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done') + try_and_print(message='AdwCleaner...', function=cleanup_adwcleaner, cs='Done') + try_and_print(message='ESET...', function=uninstall_eset, cs='Done') + # try_and_print(message='MBAM...', function=uninstall_mbam, cs='Done') + try_and_print(message='Super Anti-Spyware...', function=uninstall_sas, cs='Done') + + # Export system info + print_info('Backup System Information') + try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done') + # try_and_print(message='Browsers...', function=backup_browsers, cs='Done') + try_and_print(message='File listing...', function=backup_file_list, cs='Done') + try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') + try_and_print(message='Product Keys...', function=run_produkey, cs='Done') + try_and_print(message='Registry...', function=backup_registry, cs='Done') + + # User data + print_info('User Data') + show_user_data_summary() + + # Summary + print_info('Summary') + try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False) + try_and_print(message='Activation:', function=show_os_activation, ns='Unknown', silent_function=False) + if not windows_is_activated() and global_vars['OS']['Version'] in ('8', '10'): + try_and_print(message='BIOS Activation:', function=activate_windows_with_bios, other_results=other_results) + try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True) + show_free_space() + try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False) + + # Upload info + print_info('Finalizing') + try_and_print(message='Compressing Info...', function=compress_info, cs='Done') + try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done') + + # Play audio, show devices, open Windows updates, and open Activation if necessary + popen_program(['mmc', 'devmgmt.msc']) + run_hwinfo_sensors() + popen_program(['control', '/name', 'Microsoft.WindowsUpdate']) + if not windows_is_activated(): + popen_program('slui') + sleep(3) + run_xmplay() + + # Done + print_standard('\nDone.') + pause('Press Enter exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/system_diagnostics.py b/.bin/Scripts/system_diagnostics.py new file mode 100644 index 00000000..e9d9ae02 --- /dev/null +++ b/.bin/Scripts/system_diagnostics.py @@ -0,0 +1,91 @@ +# Wizard Kit: System Diagnostics + +import os +import sys + +# Init +os.chdir(os.path.dirname(os.path.realpath(__file__))) +os.system('title Wizard Kit: System Diagnostics Tool') +sys.path.append(os.getcwd()) +from functions import * +init_global_vars() +global_vars['LogFile'] = '{LogDir}\\System Diagnostics.log'.format(**global_vars) + +def abort(): + print_warning('Aborted.') + pause("Press Enter to exit...") + exit_script() + +if __name__ == '__main__': + try: + stay_awake() + get_ticket_number() + os.system('cls') + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + print_info('Starting System Diagnostics for Ticket #{TicketNumber}\n'.format(**global_vars)) + + # Sanitize Environment + print_info('Sanitizing Environment') + try_and_print(message='Killing processes...', function=run_process_killer, cs='Done') + try_and_print(message='Running RKill...', function=run_rkill, cs='Done') + try_and_print(message='Running TDSSKiller...', function=run_tdsskiller, cs='Done') + + # Re-run if earlier process was stopped. + stay_awake() + + # Start diags + print_info('Starting Background Scans') + check_connection() + try_and_print(message='Running HitmanPro...', function=run_hitmanpro, cs='Started') + try_and_print(message='Running Autoruns...', function=run_autoruns, cs='Started') + + # OS Health Checks + print_info('OS Health Checks') + try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, other_results=other_results) + try_and_print(message='SFC scan...', function=run_sfc_scan, other_results=other_results) + try_and_print(message='DISM CheckHealth...', function=run_dism_scan_health, other_results=other_results) + + # Export system info + print_info('Backup System Information') + try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done') + try_and_print(message='BleachBit report...', function=run_bleachbit, cs='Done') + try_and_print(message='Browsers...', function=backup_browsers, cs='Done') + try_and_print(message='File listing...', function=backup_file_list, cs='Done') + try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') + try_and_print(message='Product Keys...', function=run_produkey, cs='Done') + try_and_print(message='Registry...', function=backup_registry, cs='Done') + + # Summary + print_info('Summary') + try_and_print(message='Temp Size:', function=show_temp_files_size, silent_function=False) + show_free_space() + try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False) + try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True) + try_and_print(message='Product Keys:', function=get_product_keys, ns='Unknown', print_return=True) + try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False) + try_and_print(message='', function=show_os_activation, ns='Unknown', silent_function=False) + + # User data + print_info('User Data') + show_user_data_summary() + + # Upload info + print_info('Finalizing') + try_and_print(message='Compressing Info...', function=compress_info, cs='Done') + try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done') + + # Done + print_standard('\nDone.') + pause('Press Enter to exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/transferred_keys.py b/.bin/Scripts/transferred_keys.py index ca6588b0..51e8666b 100644 --- a/.bin/Scripts/transferred_keys.py +++ b/.bin/Scripts/transferred_keys.py @@ -1,69 +1,38 @@ # Wizard Kit: Transferred Keys import os -import re -import subprocess +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) -os.system('title Wizard Kit: Key Tool') +os.system('title Wizard Kit: ProductKey Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\Transferred Keys.log'.format(**global_vars)) +global_vars['LogFile'] = '{LogDir}\\Transferred Keys.log'.format(**global_vars) def abort(): print_warning('Aborted.') - exit_script(global_vars) - -def extract_keys(): - """Extract keys from provided hives and return a dict.""" - keys = {} - - # Extract keys - extract_item('ProduKey') - for hive in find_software_hives(): - print_standard(' Scanning {hive}...'.format(hive=hive)) - _args = [ - '/IEKeys', '0', - '/WindowsKeys', '1', - '/OfficeKeys', '1', - '/ExtractEdition', '1', - '/nosavereg', - '/regfile', hive, - '/scomma', ''] - try: - _out = run_program(global_vars['Tools']['ProduKey'], _args) - for line in _out.stdout.decode().splitlines(): - # Add key to keys under product only if unique - _tmp = line.split(',') - _product = _tmp[0] - _key = _tmp[2] - if _product not in keys: - keys[_product] = [] - if _key not in keys[_product]: - keys[_product].append(_key) - except subprocess.CalledProcessError: - print_error(' Failed to extract any keys') - else: - for line in _out.stdout.decode().splitlines(): - _match = re.search(r'', line, re.IGNORECASE) - - return keys - -if __name__ == '__main__': - stay_awake() - keys = extract_keys() - - # Save Keys - if keys: - for product in sorted(keys): - print_standard('{product}:'.format(product=product)) - for key in sorted(keys[product]): - print_standard(' {key}'.format(key=key)) - else: - print_error('No keys found.') - - # Done - print_standard('\nDone.') pause("Press Enter to exit...") exit_script() + +if __name__ == '__main__': + try: + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericError': 'No keys found', + }} + stay_awake() + try_and_print(message='Extracting keys...', function=extract_keys, other_results=other_results) + try_and_print(message='Displaying keys...', function=save_keys, print_return=True) + + # Done + print_standard('\nDone.') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/update_kit.py b/.bin/Scripts/update_kit.py index d26b0731..12d40fbf 100644 --- a/.bin/Scripts/update_kit.py +++ b/.bin/Scripts/update_kit.py @@ -1,311 +1,199 @@ # Wizard Kit: Download the latest versions of the programs in the kit import os -import re +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: Kit Update Tool') +sys.path.append(os.getcwd()) from functions import * -vars_wk = init_vars_wk() -vars_wk.update(init_vars_os()) -extract_item('curl', vars_wk, silent=True) -curl = '{BinDir}/curl/curl.exe'.format(**vars_wk) -seven_zip = '{BinDir}/7-Zip/7za.exe'.format(**vars_wk) -if vars_wk['OS']['Arch'] == 64: - seven_zip = seven_zip.replace('7za', '7za64') - -def download_file(out_dir, out_name, source_url): - """Downloads a file using curl.""" - print('Downloading: {out_name}'.format(out_name=out_name)) - _args = [ - '-#LSfo', - '{out_dir}/{out_name}'.format(out_dir=out_dir, out_name=out_name), - source_url - ] - try: - os.makedirs(out_dir, exist_ok=True) - run_program(curl, _args, pipe=False) - except: - print_error('Falied to download file.') - -def resolve_dynamic_url(source_url, regex): - """Download the "download page" and scan for a url using the regex provided; returns str.""" - # Download the file - _tmp_file = '{TmpDir}/webpage.tmp'.format(**vars_wk) - _args = ['-#LSfo', _tmp_file, source_url] - try: - os.makedirs(vars_wk['TmpDir'], exist_ok=True) - run_program(curl, _args) - except: - print_error('Falied to resolve dynamic url') - - # Scan the file for the regex - with open(_tmp_file, 'r') as file: - for line in file: - if re.search(regex, line): - _url = line.strip() - _url = re.sub(r'.*(a |)href="([^"]+)".*', r'\2', _url) - _url = re.sub(r".*(a |)href='([^']+)'.*", r'\2', _url) - break - - # Cleanup and return - os.remove(_tmp_file) - return _url +init_global_vars() if __name__ == '__main__': - stay_awake(vars_wk) - ## Diagnostics ## - # HitmanPro - _path = '{BinDir}/HitmanPro'.format(**vars_wk) - _name = 'HitmanPro.exe' - _url = 'http://dl.surfright.nl/HitmanPro.exe' - download_file(_path, _name, _url) - _name = 'HitmanPro64.exe' - _url = 'http://dl.surfright.nl/HitmanPro_x64.exe' - download_file(_path, _name, _url) - - ## VR-OSR ## - # AdwCleaner - _path = vars_wk['BinDir'] - _name = 'AdwCleaner.exe' - _dl_page = 'http://www.bleepingcomputer.com/download/adwcleaner/dl/125/' - _regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/a/adwcleaner/AdwCleaner\.exe' - _url = resolve_dynamic_url(_dl_page, _regex) - download_file(_path, _name, _url) - - # ESET Online Scanner - _path = vars_wk['BinDir'] - _name = 'ESET.exe' - _url = 'http://download.eset.com/special/eos/esetsmartinstaller_enu.exe' - download_file(_path, _name, _url) - - # Junkware Removal Tool - _path = vars_wk['BinDir'] - _name = 'JRT.exe' - _url = 'http://downloads.malwarebytes.org/file/jrt' - download_file(_path, _name, _url) - - # Kaspersky Virus Removal Tool - _path = vars_wk['BinDir'] - _name = 'KVRT.exe' - _url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe' - download_file(_path, _name, _url) - - # RKill - _path = '{BinDir}/RKill'.format(**vars_wk) - _name = 'RKill.exe' - _dl_page = 'http://www.bleepingcomputer.com/download/rkill/dl/10/' - _regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/r/rkill/rkill\.exe' - _url = resolve_dynamic_url(_dl_page, _regex) - download_file(_path, _name, _url) - - # TDSSKiller - _path = vars_wk['BinDir'] - _name = 'TDSSKiller.exe' - _url = 'http://media.kaspersky.com/utilities/VirusUtilities/EN/tdsskiller.exe' - download_file(_path, _name, _url) - - ## Driver Tools ## - # Intel Driver Update Utility - _path = '{BinDir}/_Drivers'.format(**vars_wk) - _name = 'Intel Driver Update Utility.exe' - _dl_page = 'http://www.intel.com/content/www/us/en/support/detect.html' - _regex = r'a href.*http(s|)://downloadmirror\.intel\.com/[a-zA-Z0-9]+/[a-zA-Z0-9]+/Intel%20Driver%20Update%20Utility%20Installer.exe' - _url = resolve_dynamic_url(_dl_page, _regex) - _url = resolve_dynamic_url(_dl_page, _regex) - download_file(_path, _name, _url) - - # Intel SSD Toolbox - _path = '{BinDir}/_Drivers'.format(**vars_wk) - _name = 'Intel SSD Toolbox.exe' - _dl_page = 'https://downloadcenter.intel.com/download/26085/Intel-Solid-State-Drive-Toolbox' - _regex = r'href=./downloads/eula/[0-9]+/Intel-Solid-State-Drive-Toolbox.httpDown=https\%3A\%2F\%2Fdownloadmirror\.intel\.com\%2F[0-9]+\%2Feng\%2FIntel\%20SSD\%20Toolbox\%20-\%20v[0-9\.]+.exe' - _url = resolve_dynamic_url(_dl_page, _regex) - _url = re.sub(r'.*httpDown=(.*)', r'\1', _url, flags=re.IGNORECASE) - _url = _url.replace('%3A', ':') - _url = _url.replace('%2F', '/') - download_file(_path, _name, _url) - - #~Broken~# # Samsung Magician - print_warning('Samsung Magician section is broken.') - print('Please manually put "Samsung Magician.exe" into "{BinDir}\\_Drivers\\"') - #~Broken~# _path = '{BinDir}/_Drivers'.format(**vars_wk) - #~Broken~# _name = 'Samsung Magician.zip' - #~Broken~# _dl_page = 'http://www.samsung.com/semiconductor/minisite/ssd/download/tools.html' - #~Broken~# _regex = r'href=./semiconductor/minisite/ssd/downloads/software/Samsung_Magician_Setup_v[0-9]+.zip' - #~Broken~# _url = resolve_dynamic_url(_dl_page, _regex) - #~Broken~# # Convert relative url to absolute - #~Broken~# _url = 'http://www.samsung.com' + _url - #~Broken~# download_file(_path, _name, _url) - #~Broken~# # Extract and replace old copy - #~Broken~# _args = [ - #~Broken~# 'e', '"{BinDir}/_Drivers/Samsung Magician.zip"'.format(**vars_wk), - #~Broken~# '-aoa', '-bso0', '-bsp0', - #~Broken~# '-o"{BinDir}/_Drivers"'.format(**vars_wk) - #~Broken~# ] - #~Broken~# run_program(seven_zip, _args) - #~Broken~# try: - #~Broken~# os.remove('{BinDir}/_Drivers/Samsung Magician.zip'.format(**vars_wk)) - #~Broken~# #~PoSH~# Move-Item "$bin\_Drivers\Samsung*exe" "$bin\_Drivers\Samsung Magician.exe" $path 2>&1 | Out-Null - #~Broken~# except: - #~Broken~# pass - - # SanDisk Express Cache - _path = '{BinDir}/_Drivers'.format(**vars_wk) - _name = 'SanDisk Express Cache.exe' - _url = 'http://mp3support.sandisk.com/ReadyCache/ExpressCacheSetup.exe' - download_file(_path, _name, _url) - - ## Installers ## - # Ninite - Bundles - _path = '{BaseDir}/Installers/Extras/Bundles'.format(**vars_wk) - download_file(_path, 'Runtimes.exe', 'https://ninite.com/.net4.6.2-air-java8-silverlight/ninite.exe') - download_file(_path, 'Legacy.exe', 'https://ninite.com/.net4.6.2-7zip-air-chrome-firefox-java8-silverlight-vlc/ninite.exe') - download_file(_path, 'Modern.exe', 'https://ninite.com/.net4.6.2-7zip-air-chrome-classicstart-firefox-java8-silverlight-vlc/ninite.exe') - - # Ninite - Audio-Video - _path = '{BaseDir}/Installers/Extras/Audio-Video'.format(**vars_wk) - download_file(_path, 'AIMP.exe', 'https://ninite.com/aimp/ninite.exe') - download_file(_path, 'Audacity.exe', 'https://ninite.com/audacity/ninite.exe') - download_file(_path, 'CCCP.exe', 'https://ninite.com/cccp/ninite.exe') - download_file(_path, 'Foobar2000.exe', 'https://ninite.com/foobar/ninite.exe') - download_file(_path, 'GOM.exe', 'https://ninite.com/gom/ninite.exe') - download_file(_path, 'iTunes.exe', 'https://ninite.com/itunes/ninite.exe') - download_file(_path, 'K-Lite Codecs.exe', 'https://ninite.com/klitecodecs/ninite.exe') - download_file(_path, 'KMPlayer.exe', 'https://ninite.com/kmplayer/ninite.exe') - download_file(_path, 'MediaMonkey.exe', 'https://ninite.com/mediamonkey/ninite.exe') - download_file(_path, 'MusicBee.exe', 'https://ninite.com/musicbee/ninite.exe') - download_file(_path, 'Spotify.exe', 'https://ninite.com/spotify/ninite.exe') - download_file(_path, 'VLC.exe', 'https://ninite.com/vlc/ninite.exe') - download_file(_path, 'Winamp.exe', 'https://ninite.com/winamp/ninite.exe') - - # Ninite - Cloud Storage - _path = '{BaseDir}/Installers/Extras/Cloud Storage'.format(**vars_wk) - download_file(_path, 'BitTorrent Sync.exe', 'https://ninite.com/bittorrentsync/ninite.exe') - download_file(_path, 'Dropbox.exe', 'https://ninite.com/dropbox/ninite.exe') - download_file(_path, 'Google Drive.exe', 'https://ninite.com/googledrive/ninite.exe') - download_file(_path, 'Mozy.exe', 'https://ninite.com/mozy/ninite.exe') - download_file(_path, 'OneDrive.exe', 'https://ninite.com/onedrive/ninite.exe') - download_file(_path, 'SugarSync.exe', 'https://ninite.com/sugarsync/ninite.exe') - - # Ninite - Communication - _path = '{BaseDir}/Installers/Extras/Communication'.format(**vars_wk) - download_file(_path, 'AIM.exe', 'https://ninite.com/aim/ninite.exe') - download_file(_path, 'Pidgin.exe', 'https://ninite.com/pidgin/ninite.exe') - download_file(_path, 'Skype.exe', 'https://ninite.com/skype/ninite.exe') - download_file(_path, 'Trillian.exe', 'https://ninite.com/trillian/ninite.exe') - - # Ninite - Compression - _path = '{BaseDir}/Installers/Extras/Compression'.format(**vars_wk) - download_file(_path, '7-Zip.exe', 'https://ninite.com/7zip/ninite.exe') - download_file(_path, 'PeaZip.exe', 'https://ninite.com/peazip/ninite.exe') - download_file(_path, 'WinRAR.exe', 'https://ninite.com/winrar/ninite.exe') - - # Ninite - Developer - _path = '{BaseDir}/Installers/Extras/Developer'.format(**vars_wk) - download_file(_path, 'Eclipse.exe', 'https://ninite.com/eclipse/ninite.exe') - download_file(_path, 'FileZilla.exe', 'https://ninite.com/filezilla/ninite.exe') - download_file(_path, 'JDK 8.exe', 'https://ninite.com/jdk8/ninite.exe') - download_file(_path, 'JDK 8 (x64).exe', 'https://ninite.com/jdkx8/ninite.exe') - download_file(_path, 'Notepad++.exe', 'https://ninite.com/notepadplusplus/ninite.exe') - download_file(_path, 'PuTTY.exe', 'https://ninite.com/putty/ninite.exe') - download_file(_path, 'Python 2.exe', 'https://ninite.com/python/ninite.exe') - download_file(_path, 'Visual Studio Code.exe', 'https://ninite.com/vscode/ninite.exe') - download_file(_path, 'WinMerge.exe', 'https://ninite.com/winmerge/ninite.exe') - download_file(_path, 'WinSCP.exe', 'https://ninite.com/winscp/ninite.exe') - - # Ninite - File Sharing - _path = '{BaseDir}/Installers/Extras/File Sharing'.format(**vars_wk) - download_file(_path, 'eMule.exe', 'https://ninite.com/emule/ninite.exe') - download_file(_path, 'qBittorrent.exe', 'https://ninite.com/qbittorrent/ninite.exe') - - # Ninite - Image-Photo - _path = '{BaseDir}/Installers/Extras/Image-Photo'.format(**vars_wk) - download_file(_path, 'FastStone.exe', 'https://ninite.com/faststone/ninite.exe') - download_file(_path, 'GIMP.exe', 'https://ninite.com/gimp/ninite.exe') - download_file(_path, 'Greenshot.exe', 'https://ninite.com/greenshot/ninite.exe') - download_file(_path, 'Inkscape.exe', 'https://ninite.com/inkscape/ninite.exe') - download_file(_path, 'IrfanView.exe', 'https://ninite.com/irfanview/ninite.exe') - download_file(_path, 'Paint.NET.exe', 'https://ninite.com/paint.net/ninite.exe') - download_file(_path, 'ShareX.exe', 'https://ninite.com/sharex/ninite.exe') - download_file(_path, 'XnView.exe', 'https://ninite.com/xnview/ninite.exe') - - # Ninite - Misc - _path = '{BaseDir}/Installers/Extras/Misc'.format(**vars_wk) - download_file(_path, 'Classic Start.exe', 'https://ninite.com/classicstart/ninite.exe') - download_file(_path, 'Evernote.exe', 'https://ninite.com/evernote/ninite.exe') - download_file(_path, 'Everything.exe', 'https://ninite.com/everything/ninite.exe') - download_file(_path, 'Google Earth.exe', 'https://ninite.com/googleearth/ninite.exe') - download_file(_path, 'NV Access.exe', 'https://ninite.com/nvda/ninite.exe') - download_file(_path, 'Steam.exe', 'https://ninite.com/steam/ninite.exe') - - # Ninite - Office - _path = '{BaseDir}/Installers/Extras/Office'.format(**vars_wk) - download_file(_path, 'CutePDF.exe', 'https://ninite.com/cutepdf/ninite.exe') - download_file(_path, 'Foxit Reader.exe', 'https://ninite.com/foxit/ninite.exe') - download_file(_path, 'LibreOffice.exe', 'https://ninite.com/libreoffice/ninite.exe') - download_file(_path, 'OpenOffice.exe', 'https://ninite.com/openoffice/ninite.exe') - download_file(_path, 'PDFCreator.exe', 'https://ninite.com/pdfcreator/ninite.exe') - download_file(_path, 'SumatraPDF.exe', 'https://ninite.com/sumatrapdf/ninite.exe') - download_file(_path, 'Thunderbird.exe', 'https://ninite.com/thunderbird/ninite.exe') - - # Ninite - Runtimes - _path = '{BaseDir}/Installers/Extras/Runtimes'.format(**vars_wk) - download_file(_path, 'Adobe Air.exe', 'https://ninite.com/air/ninite.exe') - download_file(_path, 'dotNET.exe', 'https://ninite.com/.net4.6.2/ninite.exe') - download_file(_path, 'Java 8.exe', 'https://ninite.com/java8/ninite.exe') - download_file(_path, 'Shockwave.exe', 'https://ninite.com/shockwave/ninite.exe') - download_file(_path, 'Silverlight.exe', 'https://ninite.com/silverlight/ninite.exe') - - # Ninite - Security - _path = '{BaseDir}/Installers/Extras/Security'.format(**vars_wk) - download_file(_path, 'Ad-Aware.exe', 'https://ninite.com/adaware/ninite.exe') - download_file(_path, 'Avast.exe', 'https://ninite.com/avast/ninite.exe') - download_file(_path, 'AVG.exe', 'https://ninite.com/avg/ninite.exe') - download_file(_path, 'Avira.exe', 'https://ninite.com/avira/ninite.exe') - download_file(_path, 'Microsoft Security Essentials.exe', 'https://ninite.com/essentials/ninite.exe') - download_file(_path, 'Malwarebytes Anti-Malware.exe', 'https://ninite.com/malwarebytes/ninite.exe') - download_file(_path, 'Spybot 2.exe', 'https://ninite.com/spybot2/ninite.exe') - download_file(_path, 'SUPERAntiSpyware.exe', 'https://ninite.com/super/ninite.exe') - - # Ninite - Utilities - _path = '{BaseDir}/Installers/Extras/Utilities'.format(**vars_wk) - download_file(_path, 'Auslogics DiskDefrag.exe', 'https://ninite.com/auslogics/ninite.exe') - download_file(_path, 'CDBurnerXP.exe', 'https://ninite.com/cdburnerxp/ninite.exe') - download_file(_path, 'Glary Utilities.exe', 'https://ninite.com/glary/ninite.exe') - download_file(_path, 'ImgBurn.exe', 'https://ninite.com/imgburn/ninite.exe') - download_file(_path, 'InfraRecorder.exe', 'https://ninite.com/infrarecorder/ninite.exe') - download_file(_path, 'KeePass 2.exe', 'https://ninite.com/keepass2/ninite.exe') - download_file(_path, 'Launchy.exe', 'https://ninite.com/launchy/ninite.exe') - download_file(_path, 'RealVNC.exe', 'https://ninite.com/realvnc/ninite.exe') - download_file(_path, 'Revo Uninstaller.exe', 'https://ninite.com/revo/ninite.exe') - download_file(_path, 'TeamViewer 11.exe', 'https://ninite.com/teamviewer11/ninite.exe') - download_file(_path, 'TeraCopy.exe', 'https://ninite.com/teracopy/ninite.exe') - download_file(_path, 'WinDirStat.exe', 'https://ninite.com/windirstat/ninite.exe') - - # Ninite - Web Browsers - _path = '{BaseDir}/Installers/Extras/Web Browsers'.format(**vars_wk) - download_file(_path, 'Google Chrome.exe', 'https://ninite.com/chrome/ninite.exe') - download_file(_path, 'Mozilla Firefox.exe', 'https://ninite.com/firefox/ninite.exe') - download_file(_path, 'Opera Chromium.exe', 'https://ninite.com/operaChromium/ninite.exe') - - ## Misc ## - # Sysinternals - _path = '{BinDir}/tmp'.format(**vars_wk) - _name = 'SysinternalsSuite.zip' - _url = 'https://download.sysinternals.com/files/SysinternalsSuite.zip' - download_file(_path, _name, _url) - # Extract - _args = [ - 'e', '"{BinDir}/tmp/SysinternalsSuite.zip"'.format(**vars_wk), - '-aoa', '-bso0', '-bsp0', - '-o"{BinDir}/SysinternalsSuite"'.format(**vars_wk)] - run_program(seven_zip, _args) try: - os.remove('{BinDir}/tmp/SysinternalsSuite.zip'.format(**vars_wk)) - except: - pass + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }} + stay_awake() + + # Diagnostics + print_info('Diagnostics') + try_and_print(message='HitmanPro...', function=update_hitmanpro, other_results=other_results) + + # VR/OSR + print_info('VR/OSR') + try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results) + try_and_print(message='ESET...', function=update_eset, other_results=other_results) + try_and_print(message='JRT...', function=update_jrt, other_results=other_results) + try_and_print(message='KVRT...', function=update_kvrt, other_results=other_results) + try_and_print(message='RKill...', function=update_rkill, other_results=other_results) + try_and_print(message='TDSSKiller...', function=update_tdsskiller, other_results=other_results) + + # Driver Tools + print_info('Driver Tools') + try_and_print(message='Intel Driver Update Utility...', function=update_intel_driver_utility, other_results=other_results) + try_and_print(message='Intel SSD Toolbox...', function=update_intel_ssd_toolbox, other_results=other_results) + # try_and_print(message='Samsung Magician...', function=update_samsung_magician, other_results=other_results) + try_and_print(message='Samsung Magician...', function=update_samsung_magician, silent_function=False) + + # Ninite - Bundles + print_info('Installers') + print_success(' '*4 + 'Ninite Bundles') + _path = '{BaseDir}\\Installers\\Extras\\Bundles'.format(**global_vars) + try_and_print(message='Runtimes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Runtimes.exe', source_url='https://ninite.com/.net4.6.2-air-java8-silverlight/ninite.exe') + try_and_print(message='Legacy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Legacy.exe', source_url='https://ninite.com/.net4.6.2-7zip-air-chrome-firefox-java8-silverlight-vlc/ninite.exe') + try_and_print(message='Modern.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Modern.exe', source_url='https://ninite.com/.net4.6.2-7zip-air-chrome-classicstart-firefox-java8-silverlight-vlc/ninite.exe') + + # Ninite - Audio-Video + print_success(' '*4 + 'Audio-Video') + _path = '{BaseDir}\\Installers\\Extras\\Audio-Video'.format(**global_vars) + try_and_print(message='AIMP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AIMP.exe', source_url='https://ninite.com/aimp/ninite.exe') + try_and_print(message='Audacity.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Audacity.exe', source_url='https://ninite.com/audacity/ninite.exe') + try_and_print(message='CCCP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CCCP.exe', source_url='https://ninite.com/cccp/ninite.exe') + try_and_print(message='Foobar2000.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Foobar2000.exe', source_url='https://ninite.com/foobar/ninite.exe') + try_and_print(message='GOM.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='GOM.exe', source_url='https://ninite.com/gom/ninite.exe') + try_and_print(message='iTunes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='iTunes.exe', source_url='https://ninite.com/itunes/ninite.exe') + try_and_print(message='K-Lite Codecs.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='K-Lite Codecs.exe', source_url='https://ninite.com/klitecodecs/ninite.exe') + try_and_print(message='KMPlayer.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='KMPlayer.exe', source_url='https://ninite.com/kmplayer/ninite.exe') + try_and_print(message='MediaMonkey.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='MediaMonkey.exe', source_url='https://ninite.com/mediamonkey/ninite.exe') + try_and_print(message='MusicBee.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='MusicBee.exe', source_url='https://ninite.com/musicbee/ninite.exe') + try_and_print(message='Spotify.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Spotify.exe', source_url='https://ninite.com/spotify/ninite.exe') + try_and_print(message='VLC.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='VLC.exe', source_url='https://ninite.com/vlc/ninite.exe') + try_and_print(message='Winamp.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Winamp.exe', source_url='https://ninite.com/winamp/ninite.exe') - pause("Press Enter to exit...") - exit_script(vars_wk) + # Ninite - Cloud Storage + print_success(' '*4 + 'Cloud Storage') + _path = '{BaseDir}\\Installers\\Extras\\Cloud Storage'.format(**global_vars) + try_and_print(message='BitTorrent Sync.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='BitTorrent Sync.exe', source_url='https://ninite.com/bittorrentsync/ninite.exe') + try_and_print(message='Dropbox.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Dropbox.exe', source_url='https://ninite.com/dropbox/ninite.exe') + try_and_print(message='Google Drive.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Drive.exe', source_url='https://ninite.com/googledrive/ninite.exe') + try_and_print(message='Mozy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Mozy.exe', source_url='https://ninite.com/mozy/ninite.exe') + try_and_print(message='OneDrive.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='OneDrive.exe', source_url='https://ninite.com/onedrive/ninite.exe') + try_and_print(message='SugarSync.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='SugarSync.exe', source_url='https://ninite.com/sugarsync/ninite.exe') + + # Ninite - Communication + print_success(' '*4 + 'Communication') + _path = '{BaseDir}\\Installers\\Extras\\Communication'.format(**global_vars) + try_and_print(message='AIM.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AIM.exe', source_url='https://ninite.com/aim/ninite.exe') + try_and_print(message='Pidgin.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Pidgin.exe', source_url='https://ninite.com/pidgin/ninite.exe') + try_and_print(message='Skype.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Skype.exe', source_url='https://ninite.com/skype/ninite.exe') + try_and_print(message='Trillian.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Trillian.exe', source_url='https://ninite.com/trillian/ninite.exe') + + # Ninite - Compression + print_success(' '*4 + 'Compression') + _path = '{BaseDir}\\Installers\\Extras\\Compression'.format(**global_vars) + try_and_print(message='7-Zip.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='7-Zip.exe', source_url='https://ninite.com/7zip/ninite.exe') + try_and_print(message='PeaZip.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='PeaZip.exe', source_url='https://ninite.com/peazip/ninite.exe') + try_and_print(message='WinRAR.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinRAR.exe', source_url='https://ninite.com/winrar/ninite.exe') + + # Ninite - Developer + print_success(' '*4 + 'Developer') + _path = '{BaseDir}\\Installers\\Extras\\Developer'.format(**global_vars) + try_and_print(message='Eclipse.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Eclipse.exe', source_url='https://ninite.com/eclipse/ninite.exe') + try_and_print(message='FileZilla.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='FileZilla.exe', source_url='https://ninite.com/filezilla/ninite.exe') + try_and_print(message='JDK 8.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='JDK 8.exe', source_url='https://ninite.com/jdk8/ninite.exe') + try_and_print(message='JDK 8 (x64).exe', function=download_file, other_results=other_results, out_dir=_path, out_name='JDK 8 (x64).exe', source_url='https://ninite.com/jdkx8/ninite.exe') + try_and_print(message='Notepad++.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Notepad++.exe', source_url='https://ninite.com/notepadplusplus/ninite.exe') + try_and_print(message='PuTTY.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='PuTTY.exe', source_url='https://ninite.com/putty/ninite.exe') + try_and_print(message='Python 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Python 2.exe', source_url='https://ninite.com/python/ninite.exe') + try_and_print(message='Visual Studio Code.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Visual Studio Code.exe', source_url='https://ninite.com/vscode/ninite.exe') + try_and_print(message='WinMerge.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinMerge.exe', source_url='https://ninite.com/winmerge/ninite.exe') + try_and_print(message='WinSCP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinSCP.exe', source_url='https://ninite.com/winscp/ninite.exe') + + # Ninite - File Sharing + print_success(' '*4 + 'File Sharing') + _path = '{BaseDir}\\Installers\\Extras\\File Sharing'.format(**global_vars) + try_and_print(message='eMule.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='eMule.exe', source_url='https://ninite.com/emule/ninite.exe') + try_and_print(message='qBittorrent.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='qBittorrent.exe', source_url='https://ninite.com/qbittorrent/ninite.exe') + + # Ninite - Image-Photo + print_success(' '*4 + 'Image-Photo') + _path = '{BaseDir}\\Installers\\Extras\\Image-Photo'.format(**global_vars) + try_and_print(message='FastStone.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='FastStone.exe', source_url='https://ninite.com/faststone/ninite.exe') + try_and_print(message='GIMP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='GIMP.exe', source_url='https://ninite.com/gimp/ninite.exe') + try_and_print(message='Greenshot.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Greenshot.exe', source_url='https://ninite.com/greenshot/ninite.exe') + try_and_print(message='Inkscape.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Inkscape.exe', source_url='https://ninite.com/inkscape/ninite.exe') + try_and_print(message='IrfanView.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='IrfanView.exe', source_url='https://ninite.com/irfanview/ninite.exe') + try_and_print(message='Paint.NET.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Paint.NET.exe', source_url='https://ninite.com/paint.net/ninite.exe') + try_and_print(message='ShareX.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='ShareX.exe', source_url='https://ninite.com/sharex/ninite.exe') + try_and_print(message='XnView.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='XnView.exe', source_url='https://ninite.com/xnview/ninite.exe') + + # Ninite - Misc + print_success(' '*4 + 'Misc') + _path = '{BaseDir}\\Installers\\Extras\\Misc'.format(**global_vars) + try_and_print(message='Classic Start.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Classic Start.exe', source_url='https://ninite.com/classicstart/ninite.exe') + try_and_print(message='Evernote.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Evernote.exe', source_url='https://ninite.com/evernote/ninite.exe') + try_and_print(message='Everything.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Everything.exe', source_url='https://ninite.com/everything/ninite.exe') + try_and_print(message='Google Earth.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Earth.exe', source_url='https://ninite.com/googleearth/ninite.exe') + try_and_print(message='NV Access.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='NV Access.exe', source_url='https://ninite.com/nvda/ninite.exe') + try_and_print(message='Steam.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Steam.exe', source_url='https://ninite.com/steam/ninite.exe') + + # Ninite - Office + print_success(' '*4 + 'Office') + _path = '{BaseDir}\\Installers\\Extras\\Office'.format(**global_vars) + try_and_print(message='CutePDF.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CutePDF.exe', source_url='https://ninite.com/cutepdf/ninite.exe') + try_and_print(message='Foxit Reader.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Foxit Reader.exe', source_url='https://ninite.com/foxit/ninite.exe') + try_and_print(message='LibreOffice.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='LibreOffice.exe', source_url='https://ninite.com/libreoffice/ninite.exe') + try_and_print(message='OpenOffice.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='OpenOffice.exe', source_url='https://ninite.com/openoffice/ninite.exe') + try_and_print(message='PDFCreator.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='PDFCreator.exe', source_url='https://ninite.com/pdfcreator/ninite.exe') + try_and_print(message='SumatraPDF.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='SumatraPDF.exe', source_url='https://ninite.com/sumatrapdf/ninite.exe') + try_and_print(message='Thunderbird.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Thunderbird.exe', source_url='https://ninite.com/thunderbird/ninite.exe') + + # Ninite - Runtimes + print_success(' '*4 + 'Runtimes') + _path = '{BaseDir}\\Installers\\Extras\\Runtimes'.format(**global_vars) + try_and_print(message='Adobe Air.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Adobe Air.exe', source_url='https://ninite.com/air/ninite.exe') + try_and_print(message='dotNET.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='dotNET.exe', source_url='https://ninite.com/.net4.6.2/ninite.exe') + try_and_print(message='Java 8.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Java 8.exe', source_url='https://ninite.com/java8/ninite.exe') + try_and_print(message='Shockwave.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Shockwave.exe', source_url='https://ninite.com/shockwave/ninite.exe') + try_and_print(message='Silverlight.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Silverlight.exe', source_url='https://ninite.com/silverlight/ninite.exe') + + # Ninite - Security + print_success(' '*4 + 'Security') + _path = '{BaseDir}\\Installers\\Extras\\Security'.format(**global_vars) + try_and_print(message='Ad-Aware.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Ad-Aware.exe', source_url='https://ninite.com/adaware/ninite.exe') + try_and_print(message='Avast.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Avast.exe', source_url='https://ninite.com/avast/ninite.exe') + try_and_print(message='AVG.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AVG.exe', source_url='https://ninite.com/avg/ninite.exe') + try_and_print(message='Avira.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Avira.exe', source_url='https://ninite.com/avira/ninite.exe') + try_and_print(message='Microsoft Security Essentials.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Microsoft Security Essentials.exe', source_url='https://ninite.com/essentials/ninite.exe') + try_and_print(message='Malwarebytes Anti-Malware.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Malwarebytes Anti-Malware.exe', source_url='https://ninite.com/malwarebytes/ninite.exe') + try_and_print(message='Spybot 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Spybot 2.exe', source_url='https://ninite.com/spybot2/ninite.exe') + try_and_print(message='SUPERAntiSpyware.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='SUPERAntiSpyware.exe', source_url='https://ninite.com/super/ninite.exe') + + # Ninite - Utilities + print_success(' '*4 + 'Utilities') + _path = '{BaseDir}\\Installers\\Extras\\Utilities'.format(**global_vars) + try_and_print(message='Auslogics DiskDefrag.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Auslogics DiskDefrag.exe', source_url='https://ninite.com/auslogics/ninite.exe') + try_and_print(message='CDBurnerXP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CDBurnerXP.exe', source_url='https://ninite.com/cdburnerxp/ninite.exe') + try_and_print(message='Glary Utilities.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Glary Utilities.exe', source_url='https://ninite.com/glary/ninite.exe') + try_and_print(message='ImgBurn.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='ImgBurn.exe', source_url='https://ninite.com/imgburn/ninite.exe') + try_and_print(message='InfraRecorder.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='InfraRecorder.exe', source_url='https://ninite.com/infrarecorder/ninite.exe') + try_and_print(message='KeePass 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='KeePass 2.exe', source_url='https://ninite.com/keepass2/ninite.exe') + try_and_print(message='Launchy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Launchy.exe', source_url='https://ninite.com/launchy/ninite.exe') + try_and_print(message='RealVNC.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='RealVNC.exe', source_url='https://ninite.com/realvnc/ninite.exe') + try_and_print(message='Revo Uninstaller.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Revo Uninstaller.exe', source_url='https://ninite.com/revo/ninite.exe') + try_and_print(message='TeamViewer 11.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='TeamViewer 11.exe', source_url='https://ninite.com/teamviewer11/ninite.exe') + try_and_print(message='TeraCopy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='TeraCopy.exe', source_url='https://ninite.com/teracopy/ninite.exe') + try_and_print(message='WinDirStat.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinDirStat.exe', source_url='https://ninite.com/windirstat/ninite.exe') + + # Ninite - Web Browsers + print_success(' '*4 + 'Web Browsers') + _path = '{BaseDir}\\Installers\\Extras\\Web Browsers'.format(**global_vars) + try_and_print(message='Google Chrome.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Chrome.exe', source_url='https://ninite.com/chrome/ninite.exe') + try_and_print(message='Mozilla Firefox.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Mozilla Firefox.exe', source_url='https://ninite.com/firefox/ninite.exe') + try_and_print(message='Opera Chromium.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Opera Chromium.exe', source_url='https://ninite.com/operaChromium/ninite.exe') + + # Misc + print_info('Misc') + try_and_print(message='SysinternalsSuite...', function=update_sysinternalssuite, other_results=other_results) + + # Done + print_standard('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/user_checklist.py b/.bin/Scripts/user_checklist.py index 86687a32..88a9cfb8 100644 --- a/.bin/Scripts/user_checklist.py +++ b/.bin/Scripts/user_checklist.py @@ -1,87 +1,94 @@ # Wizard Kit: User Checklist import os +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: User Checklist Tool') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\User Checklist ({USERNAME}).log'.format(**global_vars, **global_vars['Env'])) +global_vars['LogFile'] = '{LogDir}\\User Checklist ({USERNAME}).log'.format(**global_vars, **global_vars['Env']) def abort(): print_warning('Aborted.') exit_script() if __name__ == '__main__': - stay_awake() - os.system('cls') - other_results = { - 'Warning': { - 'NotInstalledError': 'Not installed', - 'NoProfilesError': 'No profiles found', - }} - answer_config_browsers = ask('Configure Browsers to WK Standards?') - if answer_config_browsers: - answer_reset_browsers = ask('Reset browsers to safe defaults?') - if global_vars['OS']['Version'] == '10': - answer_config_classicshell = ask('Configure ClassicShell to WK Standards?') - answer_config_explorer = ask('Configure Explorer to WK Standards?') - - # Cleanup - print_info('Cleanup') - try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done') - - # Homepages - print_info('Current homepages') - list_homepages() - - # Backup - print_info('Backing up browsers') - try_and_print(message='Chromium...', function=backup_chromium, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Google Chrome...', function=backup_chrome, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Google Chrome Canary...', function=backup_chrome_canary, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Internet Explorer...', function=backup_internet_explorer, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Mozilla Firefox (All)...', function=backup_firefox, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera...', function=backup_opera, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera Beta...', function=backup_opera_beta, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera Dev...', function=backup_opera_dev, cs='CS', ns='NS', other_results=other_results) - - # Reset - if answer_config_browsers and answer_reset_browsers: - print_info('Resetting browsers') - try_and_print(message='Internet Explorer...', function=clean_internet_explorer, cs='Done') - try_and_print(message='Google Chrome...', function=reset_google_chrome, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Google Chrome Canary...', function=reset_google_chrome_canary, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Mozilla Firefox...', function=reset_mozilla_firefox, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera...', function=reset_opera, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera Beta...', function=reset_opera_beta, cs='CS', ns='NS', other_results=other_results) - try_and_print(message='Opera Dev...', function=reset_opera_dev, cs='CS', ns='NS', other_results=other_results) - - # Configure - print_info('Configuring programs') - if answer_config_browsers: - try_and_print(message='Internet Explorer...', function=config_internet_explorer, cs='Done') - try_and_print(message='Google Chrome...', function=config_google_chrome, cs='Done', other_results=other_results) - try_and_print(message='Google Chrome Canary...', function=config_google_chrome_canary, cs='Done', other_results=other_results) - try_and_print(message='Mozilla Firefox...', function=config_mozilla_firefox, cs='Done', other_results=other_results) - try_and_print(message='Mozilla Firefox Dev...', function=config_mozilla_firefox_dev, cs='Done', other_results=other_results) - try_and_print(message='Opera...', function=config_opera, cs='Done', other_results=other_results) - try_and_print(message='Opera Beta...', function=config_opera_beta, cs='Done', other_results=other_results) - try_and_print(message='Opera Dev...', function=config_opera_dev, cs='Done', other_results=other_results) - try_and_print(message='Set default browser...', function=set_chrome_as_default, cs='Done', other_results=other_results) - if global_vars['OS']['Version'] == '10': - if answer_config_classicshell: - try_and_print(message='ClassicStart...', function=config_classicstart, cs='Done') - # if answer_config_explorer: - # try_and_print(message='Explorer...', function=config_explorer, cs='Done') - if not answer_config_browsers and not answer_config_classicshell and not answer_config_explorer: - print_warning(' Skipped') - else: - if not answer_config_browsers: - print_warning(' Skipped') - - # Done - print_standard('\nDone.') - pause('Press Enter to exit...') - exit_script() + try: + stay_awake() + os.system('cls') + other_results = { + 'Warning': { + 'NotInstalledError': 'Not installed', + 'NoProfilesError': 'No profiles found', + }} + answer_config_browsers = ask('Configure Browsers to WK Standards?') + if answer_config_browsers: + answer_reset_browsers = ask('Reset browsers to safe defaults first?') + if global_vars['OS']['Version'] == '10': + answer_config_classicshell = ask('Configure ClassicShell to WK Standards?') + answer_config_explorer_user = ask('Configure Explorer to WK Standards?') + + # Cleanup + print_info('Cleanup') + try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done') + + # Homepages + print_info('Current homepages') + list_homepages() + + # Backup + print_info('Backing up browsers') + try_and_print(message='Chromium...', function=backup_chromium, other_results=other_results) + try_and_print(message='Google Chrome...', function=backup_chrome, other_results=other_results) + try_and_print(message='Google Chrome Canary...', function=backup_chrome_canary, other_results=other_results) + try_and_print(message='Internet Explorer...', function=backup_internet_explorer, other_results=other_results) + try_and_print(message='Mozilla Firefox (All)...', function=backup_firefox, other_results=other_results) + try_and_print(message='Opera...', function=backup_opera, other_results=other_results) + try_and_print(message='Opera Beta...', function=backup_opera_beta, other_results=other_results) + try_and_print(message='Opera Dev...', function=backup_opera_dev, other_results=other_results) + + # Reset + if answer_config_browsers and answer_reset_browsers: + print_info('Resetting browsers') + try_and_print(message='Internet Explorer...', function=clean_internet_explorer, cs='Done') + try_and_print(message='Google Chrome...', function=reset_google_chrome, other_results=other_results) + try_and_print(message='Google Chrome Canary...', function=reset_google_chrome_canary, other_results=other_results) + try_and_print(message='Mozilla Firefox...', function=reset_mozilla_firefox, other_results=other_results) + try_and_print(message='Opera...', function=reset_opera, other_results=other_results) + try_and_print(message='Opera Beta...', function=reset_opera_beta, other_results=other_results) + try_and_print(message='Opera Dev...', function=reset_opera_dev, other_results=other_results) + + # Configure + print_info('Configuring programs') + if answer_config_browsers: + try_and_print(message='Internet Explorer...', function=config_internet_explorer, cs='Done') + try_and_print(message='Google Chrome...', function=config_google_chrome, cs='Done', other_results=other_results) + try_and_print(message='Google Chrome Canary...', function=config_google_chrome_canary, cs='Done', other_results=other_results) + try_and_print(message='Mozilla Firefox...', function=config_mozilla_firefox, cs='Done', other_results=other_results) + try_and_print(message='Mozilla Firefox Dev...', function=config_mozilla_firefox_dev, cs='Done', other_results=other_results) + try_and_print(message='Opera...', function=config_opera, cs='Done', other_results=other_results) + try_and_print(message='Opera Beta...', function=config_opera_beta, cs='Done', other_results=other_results) + try_and_print(message='Opera Dev...', function=config_opera_dev, cs='Done', other_results=other_results) + try_and_print(message='Set default browser...', function=set_chrome_as_default, cs='Done', other_results=other_results) + if global_vars['OS']['Version'] == '10': + if answer_config_classicshell: + try_and_print(message='ClassicStart...', function=config_classicstart, cs='Done') + if answer_config_explorer_user: + try_and_print(message='Explorer...', function=config_explorer_user, cs='Done') + if not answer_config_browsers and not answer_config_classicshell and not answer_config_explorer_user: + print_warning(' Skipped') + else: + if not answer_config_browsers: + print_warning(' Skipped') + + # Done + print_standard('\nDone.') + pause('Press Enter to exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/.bin/Scripts/user_data_transfer.py b/.bin/Scripts/user_data_transfer.py index 775493f3..35b00bc3 100644 --- a/.bin/Scripts/user_data_transfer.py +++ b/.bin/Scripts/user_data_transfer.py @@ -1,198 +1,54 @@ # Wizard Kit: Copy user data to the system over the network import os -import re -from operator import itemgetter +import sys # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) os.system('title Wizard Kit: Data 1') +sys.path.append(os.getcwd()) from functions import * init_global_vars() -set_global_vars(LogFile='{LogDir}\\Data 1.log'.format(**global_vars)) -set_global_vars(TransferDir='{ClientDir}\\Transfer'.format(**global_vars)) +global_vars['LogFile'] = '{LogDir}\\Data 1.log'.format(**global_vars) +global_vars['Data'] = {} def abort(): + umount_backup_shares() print_warning('Aborted.') - exit_script(global_vars) - -def transfer_file_based(source_path, subdir=None): - # Set Destination - if subdir is None: - dest_path = global_vars['TransferDir'] - else: - dest_path = '{TransferDir}\\{subdir}'.format(subdir=subdir, **global_vars) - os.makedirs(dest_path, exist_ok=True) - - # Main copy - selected_items = [] - for item in os.scandir(source_path): - if REGEX_INCL_ROOT_ITEMS.search(item.name): - selected_items.append(item.path) - elif not REGEX_EXCL_ROOT_ITEMS.search(item.name): - if ask('Copy: "{name}" item?'.format(name=item.name)): - selected_items.append(item.path) - if len(selected_items) > 0: - _args = global_vars['FastCopyArgs'].copy() + selected_items - _args.append('/to={dest_path}\\'.format(dest_path=dest_path)) - try: - print_standard('Copying main user data...') - run_program(global_vars['FastCopy'], _args, check=True) - except subprocess.CalledProcessError: - print_warning('WARNING: Errors encountered while copying main user data') - else: - print_error('ERROR: No files selected for transfer?') - abort() - - # Fonts - selected_items = [] - if os.path.exists('{source}\\Windows\\Fonts'.format(source=source_path)): - selected_items.append('{source}\\Windows\\Fonts'.format(source=source_path)) - if len(selected_items) > 0: - _args = global_vars['FastCopyArgs'].copy() + selected_items - _args.append('/to={dest_path}\\Windows\\'.format(dest_path=dest_path)) - try: - print_standard('Copying Fonts...') - run_program(global_vars['FastCopy'], _args, check=True) - except subprocess.CalledProcessError: - print_warning('WARNING: Errors encountered while copying Fonts') - - # Registry - selected_items = [] - if os.path.exists('{source}\\Windows\\System32\\config'.format(source=source_path)): - selected_items.append('{source}\\Windows\\System32\\config'.format(source=source_path)) - if os.path.exists('{source}\\Windows\\System32\\OEM'.format(source=source_path)): - selected_items.append('{source}\\Windows\\System32\\OEM'.format(source=source_path)) - if len(selected_items) > 0: - _args = global_vars['FastCopyArgs'].copy() + selected_items - _args.append('/to={dest_path}\\Windows\\System32\\'.format(dest_path=dest_path)) - try: - print_standard('Copying Registry...') - run_program(global_vars['FastCopy'], _args, check=True) - except subprocess.CalledProcessError: - print_warning('WARNING: Errors encountered while copying registry') - -def transfer_image_based(source_path): - print_standard('Assessing image...') - os.makedirs(global_vars['TransferDir'], exist_ok=True) - - # Scan source - _args = [ - 'dir', - '{source}'.format(source=source_path), '1'] - try: - _list = run_program(global_vars['Tools']['wimlib-imagex'], _args, check=True) - except subprocess.CalledProcessError as err: - print_error('ERROR: Failed to get file list.') - print(err) - abort() - - # Add items to list - selected_items = [] - root_items = [i.strip() for i in _list.stdout.decode('utf-8', 'ignore').splitlines() if i.count('\\') == 1 and i.strip() != '\\'] - for item in root_items: - if REGEX_INCL_ROOT_ITEMS.search(item): - selected_items.append(item) - elif not REGEX_EXCL_ROOT_ITEMS.search(item): - if ask('Extract: "{name}" item?'.format(name=item)): - selected_items.append(item) - - # Extract files - if len(selected_items) > 0: - # Write files.txt - with open('{TmpDir}\\wim_files.txt'.format(**global_vars), 'w') as f: - # Defaults - for item in EXTRA_INCL_WIM_ITEMS: - f.write('{item}\n'.format(item=item)) - for item in selected_items: - f.write('{item}\n'.format(item=item)) - try: - print_standard('Extracting user data...') - _args = [ - 'extract', - '{source}'.format(source=source_path), '1', - '@{TmpDir}\\wim_files.txt'.format(**global_vars), - '--dest-dir={TransferDir}\\'.format(**global_vars), - '--no-acls', - '--nullglob'] - run_program(global_vars['Tools']['wimlib-imagex'], _args, check=True) - except subprocess.CalledProcessError: - print_warning('WARNING: Errors encountered while extracting user data') - else: - print_error('ERROR: No files selected for extraction?') - abort() + pause("Press Enter to exit...") + exit_script() if __name__ == '__main__': - stay_awake(global_vars) - # Check for existing TransferDir - if os.path.exists(global_vars['TransferDir']): - print_warning('Folder "{TransferDir}" exists. This script will rename the existing folder in order to avoid overwriting data.'.format(**global_vars)) - if (ask('Rename existing folder and proceed?')): - _old_transfer = '{TransferDir}.old'.format(**global_vars) - _i = 1; - while os.path.exists(_old_transfer): - _old_transfer = '{TransferDir}.old{i}'.format(i=_i, **global_vars) - _i += 1 - print_info('Renaming "{TransferDir}" to "{old_transfer}"'.format(old_transfer=_old_transfer, **global_vars)) - os.rename(global_vars['TransferDir'], _old_transfer) - else: + try: + # Prep + stay_awake() + get_ticket_number() + os.system('cls') + select_destination() + select_backup() + scan_backup() + + # Transfer + os.system('cls') + print_info('Transfer Details:\n') + show_info('Ticket:', global_vars['TicketNumber']) + show_info('Source:', global_vars['Data']['Source'].path) + show_info('Destination:', global_vars['Data']['Destination']) + + if (not ask('Proceed with transfer?')): abort() - - # Set ticket number - ticket = None - while ticket is None: - tmp = input('Enter ticket number: ') - if re.match(r'^([0-9]+([-_]?\w+|))$', tmp): - ticket = tmp - - # Get backup - backup_source = select_backup(ticket) - if backup_source is None: - abort() - - # Determine restore method - extract_item('wimlib', global_vars, silent=True) - restore_source = None - restore_options = [] - _file_based = False - for item in os.scandir(backup_source.path): - if item.is_dir(): - _file_based = True - restore_options.append({'Name': 'File-Based:\t{source}'.format(source=item.name), 'Source': item}) - for _subitem in os.scandir(item.path): - if is_valid_wim_image(_subitem): - restore_options.append({'Name': 'Image-Based: {dir}\\{source}'.format(dir=item.name, source=_subitem.name), 'Source': _subitem}) - elif is_valid_wim_image(item): - restore_options.append({'Name': 'Image-Based:\t{source}'.format(source=item.name), 'Source': item}) - if _file_based: - restore_options.append({'Name': 'File-Based:\t.', 'Source': backup_source}) - restore_options = sorted(restore_options, key=itemgetter('Name')) - actions = [{'Name': 'Quit', 'Letter': 'Q'}] - if len(restore_options) > 0: - selection = menu_select('Which backup are we using? (Path: {path})'.format(path=backup_source.path), restore_options, actions) - if selection == 'Q': - abort() - else: - restore_source = restore_options[int(selection)-1]['Source'] - else: - print_error('ERROR: No restoration options detected.') - abort() - - # Start transfer - print_info('Using backup: {path}'.format(path=restore_source.path)) - if restore_source.is_dir(): - transfer_file_based(restore_source.path) - # Check for Windows.old* - for item in os.scandir(restore_source.path): - if item.is_dir() and re.search(r'^Windows.old', item.name, re.IGNORECASE): - transfer_file_based(item.path, subdir=item.name) - if restore_source.is_file(): - transfer_image_based(restore_source.path) - cleanup_transfer() - - # Done - umount_backup_shares() - print_success('Done.') - run_kvrt() - pause("Press Enter to exit...") - exit_script(global_vars) + + print_info('Transferring Data') + transfer_backup() + try_and_print(message='Removing extra files...', function=cleanup_transfer, cs='Done') + umount_backup_shares() + + # Done + run_kvrt() + print_standard('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() diff --git a/Copy WizardKit.cmd b/Copy WizardKit.cmd index 21b251a9..797d1110 100644 --- a/Copy WizardKit.cmd +++ b/Copy WizardKit.cmd @@ -71,15 +71,15 @@ set _sources=%_sources% "%source%\Uninstallers" set _sources=%_sources% "%source%\Activate Windows.cmd" set _sources=%_sources% "%source%\Enter SafeMode.cmd" set _sources=%_sources% "%source%\Exit SafeMode.cmd" -set _sources=%_sources% "%source%\Reset Browsers.cmd" -set _sources=%_sources% "%source%\SW Diagnostics.cmd" -set _sources=%_sources% "%source%\SW Final Checklist.cmd" +set _sources=%_sources% "%source%\System Checklist.cmd" +set _sources=%_sources% "%source%\System Diagnostics.cmd" +set _sources=%_sources% "%source%\User Checklist.cmd" start "" /wait "%fastcopy%" %fastcopy_args% /exclude="Snappy Driver Installer.cmd;*.exe" %_sources% /to="%dest%\" start "" /wait "%fastcopy%" %fastcopy_args% "%source%\Installers\Extras\Office\Adobe Reader DC.exe" /to="%dest%\Installers\Extras\Office\" :Ninite echo Extracting Ninite installers... -"%SEVEN_ZIP%" x "%cbin%\_Ninite.7z" -aoa -bso0 -bse0 -bsp0 -p%ARCHIVE_PASS% -o"%dest%\Installers\Extras" || goto Abort +"%SEVEN_ZIP%" x "%cbin%\_Ninite.7z" -aos -bso0 -bse0 -bsp0 -p%ARCHIVE_PASS% -o"%dest%\Installers\Extras" || goto Abort :OpenFolder start "" explorer "%dest%" diff --git a/Data Transfers/FastCopy (as ADMIN).cmd b/Data Transfers/FastCopy (as ADMIN).cmd index 68b15d5f..ed567067 100644 --- a/Data Transfers/FastCopy (as ADMIN).cmd +++ b/Data Transfers/FastCopy (as ADMIN).cmd @@ -33,7 +33,7 @@ call "%bin%\Scripts\init_client_dir.cmd" /Info /Transfer set L_TYPE=Program set L_PATH=FastCopy set L_ITEM=FastCopy.exe -set L_ARGS=/logfile=%log_dir%\FastCopy.log /cmd=noexist_only /utf8 /skip_empty_dir /linkdest /exclude=$RECYCLE.BIN;$Recycle.Bin;.AppleDB;.AppleDesktop;.AppleDouble;.com.apple.timemachine.supported;.dbfseventsd;.DocumentRevisions-V100*;.DS_Store;.fseventsd;.PKInstallSandboxManager;.Spotlight*;.SymAV*;.symSchedScanLockxz;.TemporaryItems;.Trash*;.vol;.VolumeIcon.icns;desktop.ini;Desktop?DB;Desktop?DF;hiberfil.sys;lost+found;Network?Trash?Folder;pagefile.sys;Recycled;RECYCLER;System?Volume?Information;Temporary?Items;Thumbs.db /to=%client_dir%\Transfer\ +set L_ARGS=/logfile=%log_dir%\FastCopy.log /cmd=noexist_only /utf8 /skip_empty_dir /linkdest /exclude=$RECYCLE.BIN;$Recycle.Bin;.AppleDB;.AppleDesktop;.AppleDouble;.com.apple.timemachine.supported;.dbfseventsd;.DocumentRevisions-V100*;.DS_Store;.fseventsd;.PKInstallSandboxManager;.Spotlight*;.SymAV*;.symSchedScanLockxz;.TemporaryItems;.Trash*;.vol;.VolumeIcon.icns;desktop.ini;Desktop?DB;Desktop?DF;hiberfil.sys;lost+found;Network?Trash?Folder;pagefile.sys;Recycled;RECYCLER;System?Volume?Information;Temporary?Items;Thumbs.db /to=%client_dir%\Transfer_%iso_date%\ set L_7ZIP= set L_CHCK=True set L_ELEV=True @@ -109,4 +109,4 @@ goto Exit :: Cleanup and exit :: :Exit endlocal -exit /b %errorlevel% \ No newline at end of file +exit /b %errorlevel% diff --git a/Data Transfers/FastCopy.cmd b/Data Transfers/FastCopy.cmd index d4467aea..a446ae3b 100644 --- a/Data Transfers/FastCopy.cmd +++ b/Data Transfers/FastCopy.cmd @@ -33,7 +33,7 @@ call "%bin%\Scripts\init_client_dir.cmd" /Info /Transfer set L_TYPE=Program set L_PATH=FastCopy set L_ITEM=FastCopy.exe -set L_ARGS=/logfile=%log_dir%\FastCopy.log /cmd=noexist_only /utf8 /skip_empty_dir /linkdest /exclude=$RECYCLE.BIN;$Recycle.Bin;.AppleDB;.AppleDesktop;.AppleDouble;.com.apple.timemachine.supported;.dbfseventsd;.DocumentRevisions-V100*;.DS_Store;.fseventsd;.PKInstallSandboxManager;.Spotlight*;.SymAV*;.symSchedScanLockxz;.TemporaryItems;.Trash*;.vol;.VolumeIcon.icns;desktop.ini;Desktop?DB;Desktop?DF;hiberfil.sys;lost+found;Network?Trash?Folder;pagefile.sys;Recycled;RECYCLER;System?Volume?Information;Temporary?Items;Thumbs.db /to=%client_dir%\Transfer\ +set L_ARGS=/logfile=%log_dir%\FastCopy.log /cmd=noexist_only /utf8 /skip_empty_dir /linkdest /exclude=$RECYCLE.BIN;$Recycle.Bin;.AppleDB;.AppleDesktop;.AppleDouble;.com.apple.timemachine.supported;.dbfseventsd;.DocumentRevisions-V100*;.DS_Store;.fseventsd;.PKInstallSandboxManager;.Spotlight*;.SymAV*;.symSchedScanLockxz;.TemporaryItems;.Trash*;.vol;.VolumeIcon.icns;desktop.ini;Desktop?DB;Desktop?DF;hiberfil.sys;lost+found;Network?Trash?Folder;pagefile.sys;Recycled;RECYCLER;System?Volume?Information;Temporary?Items;Thumbs.db /to=%client_dir%\Transfer_%iso_date%\ set L_7ZIP= set L_CHCK=True set L_ELEV= @@ -109,4 +109,4 @@ goto Exit :: Cleanup and exit :: :Exit endlocal -exit /b %errorlevel% \ No newline at end of file +exit /b %errorlevel% diff --git a/Data Transfers/User Data Transfer.cmd b/Data Transfers/User Data Transfer.cmd index a40b82eb..7a55ff7a 100644 --- a/Data Transfers/User Data Transfer.cmd +++ b/Data Transfers/User Data Transfer.cmd @@ -35,7 +35,7 @@ set L_ITEM=user_data_transfer.py set L_ARGS= set L_7ZIP= set L_CHCK=True -set L_ELEV= +set L_ELEV=True set L_NCMD= set L_WAIT= diff --git a/Diagnostics/AIDA64.cmd b/Diagnostics/Extras/AIDA64.cmd similarity index 100% rename from Diagnostics/AIDA64.cmd rename to Diagnostics/Extras/AIDA64.cmd diff --git a/Diagnostics/BleachBit.cmd b/Diagnostics/Extras/BleachBit.cmd similarity index 100% rename from Diagnostics/BleachBit.cmd rename to Diagnostics/Extras/BleachBit.cmd diff --git a/Diagnostics/GpuTest.cmd b/Diagnostics/Extras/GpuTest.cmd similarity index 100% rename from Diagnostics/GpuTest.cmd rename to Diagnostics/Extras/GpuTest.cmd diff --git a/Diagnostics/HWiNFO (Sensors).cmd b/Diagnostics/Extras/HWiNFO (Sensors).cmd similarity index 100% rename from Diagnostics/HWiNFO (Sensors).cmd rename to Diagnostics/Extras/HWiNFO (Sensors).cmd diff --git a/Diagnostics/HitmanPro.cmd b/Diagnostics/Extras/HitmanPro.cmd similarity index 100% rename from Diagnostics/HitmanPro.cmd rename to Diagnostics/Extras/HitmanPro.cmd diff --git a/Diagnostics/Extras/HWiNFO.cmd b/Diagnostics/HWiNFO.cmd similarity index 100% rename from Diagnostics/Extras/HWiNFO.cmd rename to Diagnostics/HWiNFO.cmd diff --git a/Drivers/Acer.cmd b/Drivers/Extras/Acer.cmd similarity index 100% rename from Drivers/Acer.cmd rename to Drivers/Extras/Acer.cmd diff --git a/Drivers/Dell (FTP - Browse for Drivers).url b/Drivers/Extras/Dell (FTP - Browse for Drivers).url similarity index 100% rename from Drivers/Dell (FTP - Browse for Drivers).url rename to Drivers/Extras/Dell (FTP - Browse for Drivers).url diff --git a/Drivers/Dell (Simplified Interface).url b/Drivers/Extras/Dell (Simplified Interface).url similarity index 100% rename from Drivers/Dell (Simplified Interface).url rename to Drivers/Extras/Dell (Simplified Interface).url diff --git a/Drivers/Dell (Support Site).url b/Drivers/Extras/Dell (Support Site).url similarity index 100% rename from Drivers/Dell (Support Site).url rename to Drivers/Extras/Dell (Support Site).url diff --git a/Uninstallers/Removal Tools.cmd b/Drivers/Extras/Display Driver Uninstaller.cmd similarity index 96% rename from Uninstallers/Removal Tools.cmd rename to Drivers/Extras/Display Driver Uninstaller.cmd index 6c9a91c3..cc73a00e 100644 --- a/Uninstallers/Removal Tools.cmd +++ b/Drivers/Extras/Display Driver Uninstaller.cmd @@ -29,14 +29,14 @@ call :FindBin :: Set L_ELEV to True to launch with elevated permissions :: Set L_NCMD to True to stay in the native console window :: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Folder -set L_PATH=_Removal Tools -set L_ITEM=. +set L_TYPE=Program +set L_PATH=Display Driver Uninstaller +set L_ITEM=Display Driver Uninstaller.exe set L_ARGS= set L_7ZIP= set L_CHCK=True set L_ELEV= -set L_NCMD= +set L_NCMD=True set L_WAIT= ::::::::::::::::::::::::::::::::::::::::::: diff --git a/Drivers/HP.url b/Drivers/Extras/HP.url similarity index 100% rename from Drivers/HP.url rename to Drivers/Extras/HP.url diff --git a/Drivers/Lenovo.cmd b/Drivers/Extras/Lenovo.cmd similarity index 100% rename from Drivers/Lenovo.cmd rename to Drivers/Extras/Lenovo.cmd diff --git a/Drivers/Toshiba.cmd b/Drivers/Extras/Toshiba.cmd similarity index 100% rename from Drivers/Toshiba.cmd rename to Drivers/Extras/Toshiba.cmd diff --git a/Installers/Extras/Office/2007/2007 Microsoft Office system (SP3).cmd b/Installers/Extras/Office/2007/2007 Microsoft Office system (SP3).cmd deleted file mode 100644 index 3db0768c..00000000 --- a/Installers/Extras/Office/2007/2007 Microsoft Office system (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=2007 Microsoft Office system (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Access 2007 (SP3).cmd b/Installers/Extras/Office/2007/Access 2007 (SP3).cmd deleted file mode 100644 index 8eca620d..00000000 --- a/Installers/Extras/Office/2007/Access 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Access 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/AccessRuntime2007.cmd b/Installers/Extras/Office/2007/AccessRuntime2007.cmd deleted file mode 100644 index 2311671a..00000000 --- a/Installers/Extras/Office/2007/AccessRuntime2007.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=AccessRuntime2007.exe -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Home and Student 2007 (SP3).cmd b/Installers/Extras/Office/2007/Home and Student 2007 (SP3).cmd deleted file mode 100644 index 4d604f2a..00000000 --- a/Installers/Extras/Office/2007/Home and Student 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Home and Student 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Outlook 2007 (SP3).cmd b/Installers/Extras/Office/2007/Outlook 2007 (SP3).cmd deleted file mode 100644 index c86a1ea2..00000000 --- a/Installers/Extras/Office/2007/Outlook 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Outlook 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Professional 2007 (SP3).cmd b/Installers/Extras/Office/2007/Professional 2007 (SP3).cmd deleted file mode 100644 index ca8ef010..00000000 --- a/Installers/Extras/Office/2007/Professional 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Professional 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Publisher 2007 (SP3).cmd b/Installers/Extras/Office/2007/Publisher 2007 (SP3).cmd deleted file mode 100644 index dd7a4e8e..00000000 --- a/Installers/Extras/Office/2007/Publisher 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Publisher 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/Office/2007/Small Business 2007 (SP3).cmd b/Installers/Extras/Office/2007/Small Business 2007 (SP3).cmd deleted file mode 100644 index 579efd4b..00000000 --- a/Installers/Extras/Office/2007/Small Business 2007 (SP3).cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=Office -set L_PATH=2007 -set L_ITEM=Small Business 2007 (SP3) -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% \ No newline at end of file diff --git a/Installers/Extras/QuickBooks/2007/QuickBooksPremier2007_R13.cmd b/Installers/Extras/QuickBooks/2007/QuickBooksPremier2007_R13.cmd deleted file mode 100644 index a78b7881..00000000 --- a/Installers/Extras/QuickBooks/2007/QuickBooksPremier2007_R13.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2007 -set L_ITEM=QuickBooksPremier2007_R13 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Installers/Extras/QuickBooks/2007/QuickBooksPro2007_R13.cmd b/Installers/Extras/QuickBooks/2007/QuickBooksPro2007_R13.cmd deleted file mode 100644 index f34410a3..00000000 --- a/Installers/Extras/QuickBooks/2007/QuickBooksPro2007_R13.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2007 -set L_ITEM=QuickBooksPro2007_R13 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Installers/Extras/QuickBooks/2008/QuickBooksPremier2008_R10.cmd b/Installers/Extras/QuickBooks/2008/QuickBooksPremier2008_R10.cmd deleted file mode 100644 index 9575fa65..00000000 --- a/Installers/Extras/QuickBooks/2008/QuickBooksPremier2008_R10.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2008 -set L_ITEM=QuickBooksPremier2008_R10 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Installers/Extras/QuickBooks/2008/QuickBooksPro2008_R10.cmd b/Installers/Extras/QuickBooks/2008/QuickBooksPro2008_R10.cmd deleted file mode 100644 index da56a9d4..00000000 --- a/Installers/Extras/QuickBooks/2008/QuickBooksPro2008_R10.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2008 -set L_ITEM=QuickBooksPro2008_R10 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Installers/Extras/QuickBooks/2009/QuickBooksPremier2009_R13.cmd b/Installers/Extras/QuickBooks/2009/QuickBooksPremier2009_R13.cmd deleted file mode 100644 index c664c738..00000000 --- a/Installers/Extras/QuickBooks/2009/QuickBooksPremier2009_R13.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2009 -set L_ITEM=QuickBooksPremier2009_R13 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Installers/Extras/QuickBooks/2009/QuickBooksPro2009_R13.cmd b/Installers/Extras/QuickBooks/2009/QuickBooksPro2009_R13.cmd deleted file mode 100644 index 4cee10b0..00000000 --- a/Installers/Extras/QuickBooks/2009/QuickBooksPro2009_R13.cmd +++ /dev/null @@ -1,110 +0,0 @@ -:: Wizard Kit: Launcher Script :: -:: -:: This script works by setting env variables and then calling Launch.cmd -:: which inherits the variables. This bypasses batch file argument parsing -:: which is awful. -@echo off - -:Init -setlocal -title Wizard Kit: Launcher -call :CheckFlags %* -call :FindBin - -:DefineLaunch -:: Set L_TYPE to one of these options: -:: Console -:: Office -:: Program -:: PSScript -:: PyScript -:: Set L_PATH to the path to the program folder -:: NOTE: Launch.cmd will test for L_PATH in the following order: -:: 1: %bin%\L_PATH -:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH) -:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path) -:: Set L_ITEM to the filename of the item to launch (or Office product to install) -:: Set L_ARGS to include any necessary arguments (if any) -:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered -:: Set L_ELEV to True to launch with elevated permissions -:: Set L_NCMD to True to stay in the native console window -:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted -set L_TYPE=QuickBooks -set L_PATH=2009 -set L_ITEM=QuickBooksPro2009_R13 -set L_ARGS= -set L_CHCK=True -set L_ELEV= -set L_NCMD= -set L_WAIT= - -::::::::::::::::::::::::::::::::::::::::::: -:: Do not edit anything below this line! :: -::::::::::::::::::::::::::::::::::::::::::: - -:LaunchPrep -rem Verifies the environment before launching item -if not defined bin (goto ErrorNoBin) -if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing) - -:Launch -rem Calls the Launch.cmd script using the variables defined above -call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD -goto Exit - -:: Functions :: -:CheckFlags -rem Loops through all arguments to check for accepted flags -set DEBUG= -for %%f in (%*) do ( - if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG") -) -@exit /b 0 - -:FindBin -rem Checks the current directory and all parents for the ".bin" folder -rem NOTE: Has not been tested for UNC paths -set bin= -pushd "%~dp0" -:FindBinInner -if exist ".bin" (goto FindBinDone) -if "%~d0\" == "%cd%" (popd & @exit /b 1) -cd .. -goto FindBinInner -:FindBinDone -set "bin=%cd%\.bin" -set "cbin=%cd%\.cbin" -popd -@exit /b 0 - -:: Errors :: -:ErrorLaunchCMD -echo. -echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag? -goto Abort - -:ErrorLaunchCMDMissing -echo. -echo ERROR: Launch.cmd script not found. -goto Abort - -:ErrorNoBin -echo. -echo ERROR: ".bin" folder not found. -goto Abort - -:Abort -color 4e -echo Aborted. -echo. -echo Press any key to exit... -pause>nul -color -rem Set errorlevel to 1 by calling color incorrectly -color 00 -goto Exit - -:: Cleanup and exit :: -:Exit -endlocal -exit /b %errorlevel% diff --git a/Misc/Hide Windows 10 Upgrade.reg b/Misc/Hide Windows 10 Upgrade.reg deleted file mode 100644 index 8017b020..00000000 Binary files a/Misc/Hide Windows 10 Upgrade.reg and /dev/null differ diff --git a/Diagnostics/Extras/MailPasswordView (as ADMIN).cmd b/Misc/MailPasswordView (as ADMIN).cmd similarity index 100% rename from Diagnostics/Extras/MailPasswordView (as ADMIN).cmd rename to Misc/MailPasswordView (as ADMIN).cmd diff --git a/Diagnostics/Extras/MailPasswordView.cmd b/Misc/MailPasswordView.cmd similarity index 100% rename from Diagnostics/Extras/MailPasswordView.cmd rename to Misc/MailPasswordView.cmd diff --git a/Diagnostics/Extras/NK2Edit.cmd b/Misc/NK2Edit.cmd similarity index 100% rename from Diagnostics/Extras/NK2Edit.cmd rename to Misc/NK2Edit.cmd diff --git a/Misc/Force Windows 10 Anniversary Update.url b/Misc/Windows 10 Update Assistant.url similarity index 100% rename from Misc/Force Windows 10 Anniversary Update.url rename to Misc/Windows 10 Update Assistant.url diff --git a/Repairs/Complete Internet Repair.cmd b/Repairs/Extras/Complete Internet Repair.cmd similarity index 100% rename from Repairs/Complete Internet Repair.cmd rename to Repairs/Extras/Complete Internet Repair.cmd diff --git a/Repairs/ESET.cmd b/Repairs/Extras/ESET.cmd similarity index 100% rename from Repairs/ESET.cmd rename to Repairs/Extras/ESET.cmd diff --git a/Repairs/TDSSKiller.cmd b/Repairs/Extras/TDSSKiller.cmd similarity index 100% rename from Repairs/TDSSKiller.cmd rename to Repairs/Extras/TDSSKiller.cmd diff --git a/SW Diagnostics.cmd b/System Checklist.cmd similarity index 98% rename from SW Diagnostics.cmd rename to System Checklist.cmd index c8f2a874..cbed9121 100644 --- a/SW Diagnostics.cmd +++ b/System Checklist.cmd @@ -31,7 +31,7 @@ call :FindBin :: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted set L_TYPE=PyScript set L_PATH=Scripts -set L_ITEM=sw_diagnostics.py +set L_ITEM=system_checklist.py set L_ARGS= set L_7ZIP= set L_CHCK=True diff --git a/SW Final Checklist.cmd b/System Diagnostics.cmd similarity index 98% rename from SW Final Checklist.cmd rename to System Diagnostics.cmd index 3da0b8e2..bd3abc2d 100644 --- a/SW Final Checklist.cmd +++ b/System Diagnostics.cmd @@ -31,7 +31,7 @@ call :FindBin :: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted set L_TYPE=PyScript set L_PATH=Scripts -set L_ITEM=sw_checklist.py +set L_ITEM=system_diagnostics.py set L_ARGS= set L_7ZIP= set L_CHCK=True diff --git a/Uninstallers/AV Removal Tools/AV Removal Tools.url b/Uninstallers/AV Removal Tools/AV Removal Tools.url new file mode 100644 index 00000000..b1415a2e --- /dev/null +++ b/Uninstallers/AV Removal Tools/AV Removal Tools.url @@ -0,0 +1,5 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://kb.eset.com/esetkb/index?page=content&id=SOLN146 +IDList= diff --git a/Uninstallers/AV Removal Tools/AVG.url b/Uninstallers/AV Removal Tools/AVG.url new file mode 100644 index 00000000..2b7defa4 --- /dev/null +++ b/Uninstallers/AV Removal Tools/AVG.url @@ -0,0 +1,5 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://www.avg.com/us-en/utilities +IDList= diff --git a/Uninstallers/AV Removal Tools/Avast.url b/Uninstallers/AV Removal Tools/Avast.url new file mode 100644 index 00000000..99b36e61 --- /dev/null +++ b/Uninstallers/AV Removal Tools/Avast.url @@ -0,0 +1,6 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://files.avast.com/iavs9x/avastclear.exe +IDList= +HotKey=0 diff --git a/Uninstallers/AV Removal Tools/Avira.url b/Uninstallers/AV Removal Tools/Avira.url new file mode 100644 index 00000000..32517145 --- /dev/null +++ b/Uninstallers/AV Removal Tools/Avira.url @@ -0,0 +1,6 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://dlpro.antivir.com/package/regcleaner/win32/en/avira_registry_cleaner_en.zip +IDList= +HotKey=0 diff --git a/Uninstallers/AV Removal Tools/ESET.url b/Uninstallers/AV Removal Tools/ESET.url new file mode 100644 index 00000000..e3023961 --- /dev/null +++ b/Uninstallers/AV Removal Tools/ESET.url @@ -0,0 +1,6 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://download.eset.com/special/ESETUninstaller.exe +IDList= +HotKey=0 diff --git a/Uninstallers/AV Removal Tools/Kaspersky.url b/Uninstallers/AV Removal Tools/Kaspersky.url new file mode 100644 index 00000000..78534652 --- /dev/null +++ b/Uninstallers/AV Removal Tools/Kaspersky.url @@ -0,0 +1,6 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://media.kaspersky.com/utilities/ConsumerUtilities/kavremvr.exe +IDList= +HotKey=0 diff --git a/Uninstallers/AV Removal Tools/MBAM.url b/Uninstallers/AV Removal Tools/MBAM.url new file mode 100644 index 00000000..3b28c32e --- /dev/null +++ b/Uninstallers/AV Removal Tools/MBAM.url @@ -0,0 +1,5 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://www.malwarebytes.org/mbam-clean.exe +IDList= diff --git a/Uninstallers/AV Removal Tools/McAfee.url b/Uninstallers/AV Removal Tools/McAfee.url new file mode 100644 index 00000000..5eab565f --- /dev/null +++ b/Uninstallers/AV Removal Tools/McAfee.url @@ -0,0 +1,5 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 +[InternetShortcut] +URL=http://download.mcafee.com/products/licensed/cust_support_patches/MCPR.exe +IDList= diff --git a/Uninstallers/AV Removal Tools/Norton.url b/Uninstallers/AV Removal Tools/Norton.url new file mode 100644 index 00000000..7fd58d33 --- /dev/null +++ b/Uninstallers/AV Removal Tools/Norton.url @@ -0,0 +1,5 @@ +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,1 +[InternetShortcut] +URL=ftp://ftp.symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe +IDList= diff --git a/Reset Browsers.cmd b/User Checklist.cmd similarity index 98% rename from Reset Browsers.cmd rename to User Checklist.cmd index 4b38cee5..77a8d4d7 100644 --- a/Reset Browsers.cmd +++ b/User Checklist.cmd @@ -31,7 +31,7 @@ call :FindBin :: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted set L_TYPE=PyScript set L_PATH=Scripts -set L_ITEM=reset_browsers.py +set L_ITEM=user_checklist.py set L_ARGS= set L_7ZIP= set L_CHCK=True @@ -108,4 +108,4 @@ goto Exit :: Cleanup and exit :: :Exit endlocal -exit /b %errorlevel% \ No newline at end of file +exit /b %errorlevel%