WizardKit/.bin/Scripts/install_sw_bundle.py
Alan Mason 7616f2ea5f 2016-11: Retroactive Updates
* NEW: CompressedBin folder .cbin
  * This folder holds compressed versions of what was in .bin
    * These files are 7-zip compressed using file + header encryption
    * (This is to avoid false-positive AV alerts)

* NEW: Python conversion
  * All scripts rewritten / ported to Python
  * All PoSH scripts removed
  * All scripts adjusted to no longer use vars as a variable
    * This is because vars is a built-in function
    * Also, slightly more clear as vars_wk == variables for Wizard Kit
  * vars_os merged with vars_wk for since both are based on the current system
  * Launch.cmd no longer uses %path% and instead directly modifies L_PATH
    * fixes bug where an empty %PATH% would halt various scripts

* Copy WizardKit
  * Now only copies the required folders in .bin
    * Avoids potentially massive slowdowns on often-used UFDs
  * Updated to support the new .cbin folder

* User Data Transfer expanded
  * File-based main data selection is now done first
  * Default inclusions and exclusions adjusted
  * Cleanup should now unhide TransferDir

* Launch.cmd and Launchers updated
  * Launch and Launcher_Template reworked to support the new .cbin method
    * Launch will extract the archive (if exists) and then launch the item
  * Launch.cmd now automatically reloads inside ConEmu
  * Launch.cmd now runs from L_ITEM's dir in most cases
  * Added L_NCMD to use the native command window instead of ConEmu
  * Added PywScript mode that uses Python native console window
  * Launchers are customized at the top of the files now
    * FindBin and Flags functions have been moved to the end of the file
  * Launchers and Launch.cmd now use more descriptive variable names
    * Helps readability and troubleshooting
  * Ported code from copy_office.cmd into Launch.cmd
    * Office setup local folders now have better naming
  * Scripts should now print details about the ENV when aborting
    * Should help diagnose future breaks, typos, etc..
  * Added a gen_office.bash script for creating the Office Setup Launchers
  * Fixed Office variable issue (needed delayedexpansion)

* SW Diagnostics / SW Checklist
  * (Re)added Kill All Processes section using ProcessKiller 2.0 from Tron
  * Added Everything - dumps a file listing of the %systemdrive%
  * Added Opera to the browser backup section
  * AdwCleaner is no longer removed during the checklist
  * HWiNFO has replaced HWMonitor due to false AMD/ATI readings
  * HWiNFO is not opened until after Enter is pressed to exit the checklist
  * Installed OS warnings expanded to mark many more versions as outdated
  * SAS is no longer force-removed at the end of the script
  * The new user data size function is reading data for all users
2017-11-17 00:54:34 -07:00

87 lines
3.1 KiB
Python

# Wizard Kit: Install the standard SW bundle based on the OS version
import os
import re
# Init
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.system('title Wizard Kit: SW Bundle Tool')
from functions import *
vars_wk = init_vars_wk()
vars_wk.update(init_vars_os())
if __name__ == '__main__':
stay_awake(vars_wk)
errors = False
# Adobe Reader
if vars_wk['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['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['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...")
kill_process('caffeine.exe')
quit()