v1.5.0 - Early Summer Update

Main Kit
* `mount-all-volumes` will now recognize LVM and RAID volumes
* Local sources supported by "User Data Transfer.cmd"
* Ticket numbers are now optional _(enabled/disabled via main.py)_
  * If disabled some sections will ask for a "search" prefix instead
  * If disabled some sections will use date/time instead
* AV check added to System Checklist and Diagnostics
* Adjusted the summary order in System Checklist and Diagnostics
* Reworked OS detection
  * Insider Previews are now properly detected
  * Windows 10 1803/April Update is now recognized
  * CurrentBuild number is displayed for unrecognized builds
  * Codenames are displayed for all recognized builds
* Bumped tool versions
  * Current Intel RST is now 16.0
* Moved SafeMode scripts to the Misc folder
* General bugfixes, including:
  * "Copy WizardKit.cmd"
  * "Build Kit.cmd"
  * "Enter SafeMode.cmd"
  * "Exit SafeMode.cmd"
  * Several scripts will now show a file/program missing error instead of crashing

Linux
* Deprecated `inxi` and will be removed in a future build.
* Added new `hw-drive-info` script to replace `inxi` command
* Added new `hw-info` script to replace `inxi` command
* Added several graphical viewers for file browsing (archives, images, PDfs, etc)
* Trimmed image size by removing unnecessary packages _(mostly dialup/networking packages)_
* `build-ufd` logs are now saved in the current user's $HOME/Logs folder
* `build-ufd` names UFDs as "${KIT_NAME_SHORT}_UFD" _(e.g. WK_UFD)_
* General bugfixes

WinPE
* Added VirtIO drivers
* Local sources are working again for Windows installs
* WinPE.log is now copied to new Windows installations
* General bugfixes, including:
  * "Build PE.cmd"
This commit is contained in:
2Shirt 2018-05-25 14:28:48 -06:00
commit 38934027a4
38 changed files with 909 additions and 353 deletions

View file

@ -67,7 +67,7 @@ start "" /wait "%fastcopy%" %fastcopy_args% %_sources% /to="%dest%\.bin\"
echo Copying .cbin...
mkdir "%dest%\.cbin" >nul 2>&1
attrib +h "%dest%\.cbin"
start "" /wait "%fastcopy%" %fastcopy_args% %cbin%\* /to="%dest%\.cbin\"
start "" /wait "%fastcopy%" %fastcopy_args% "%cbin%"\* /to="%dest%\.cbin\"
:CopyMainData
echo Copying Main Kit...
@ -149,4 +149,4 @@ goto Exit
:: Cleanup and exit ::
:Exit
endlocal
exit /b %errorlevel%
exit /b %errorlevel%

View file

@ -29,7 +29,7 @@ if __name__ == '__main__':
activation_methods = [
{'Name': 'Activate with BIOS key', 'Function': activate_with_bios},
]
if global_vars['OS']['Version'] not in ['8', '10']:
if global_vars['OS']['Version'] not in ('8', '8.1', '10'):
activation_methods[0]['Disabled'] = True
actions = [
{'Name': 'Quit', 'Letter': 'Q'},

View file

@ -436,13 +436,15 @@ function ask() {
# VARIABLES
DEST_DEV="${arg_u}"
DEST_PAR="${DEST_DEV}1"
LOG_FILE="${HOME}/build-ufd_${DEST_DEV##*/}_$(date +%Y-%m-%d_%H%M_%z).log"
LOG_FILE="$(getent passwd "$SUDO_USER" | cut -d: -f6)/Logs/build-ufd_${DEST_DEV##*/}_$(date +%Y-%m-%d_%H%M_%z).log"
MAIN_PY="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/settings/main.py"
RSYNC_ARGS="-hrtuvS --modify-window=1 --progress"
MAIN_KIT="$(realpath "${arg_m:-}" 2>/dev/null || true)"
LINUX_ISO="$(realpath "${arg_l:-}" 2>/dev/null || true)"
WINPE_ISO="$(realpath "${arg_w:-}" 2>/dev/null || true)"
EXTRA_DIR="$(realpath "${arg_e:-}" 2>/dev/null || true)"
mkdir -p "$(dirname "$LOG_FILE")"
chown "$SUDO_USER:$SUDO_USER" -R "$(dirname "$LOG_FILE")"
# COLORS
CLEAR="\e[0m"
@ -467,7 +469,8 @@ if [ -z ${KIT_NAME_FULL+x} ]; then
echo -e "${RED}ERROR${CLEAR}: failed to load settings from ${MAIN_PY}"
abort
fi
UFD_LABEL="${KIT_NAME_SHORT}_LINUX"
ISO_LABEL="${KIT_NAME_SHORT}_LINUX"
UFD_LABEL="${KIT_NAME_SHORT}_UFD"
# Check if root
if [[ "$EUID" -ne 0 ]]; then
@ -553,6 +556,8 @@ mount "${WINPE_ISO}" /mnt/WinPE -r >> "${LOG_FILE}" 2>&1
# Copy files
echo "Copying Linux files..."
rsync ${RSYNC_ARGS} /mnt/Linux/* /mnt/Dest/ >> "${LOG_FILE}" 2>&1
sed -i "s/${ISO_LABEL}/${UFD_LABEL}/" /mnt/Dest/EFI/boot/refind.conf
sed -i "s/${ISO_LABEL}/${UFD_LABEL}/" /mnt/Dest/arch/boot/syslinux/*cfg
echo "Copying WinPE files..."
rsync ${RSYNC_ARGS} /mnt/WinPE/{Boot,bootmgr{,.efi},en-us,sources} /mnt/Dest/ >> "${LOG_FILE}" 2>&1
@ -590,7 +595,7 @@ sync
echo "Hiding boot files..."
echo "drive s: file=\"${DEST_PAR}\"" > /root/.mtoolsrc
echo 'mtools_skip_check=1' >> /root/.mtoolsrc
for item in boot{,mgr,mgr.efi} efi en-us images isolinux sources "${KIT_NAME_FULL}"/{.bin,.cbin}; do
for item in arch Boot bootmgr{,.efi} EFI en-us images isolinux sources "${KIT_NAME_FULL}"/{.bin,.cbin}; do
yes | mattrib +h "S:/${item}" >> "${LOG_FILE}" 2>&1 || true
done
sync

View file

@ -34,7 +34,7 @@ function DownloadFile ($Path, $Name, $Url) {
}
catch {
Write-Host (" ERROR: Failed to download file." ) -ForegroundColor "Red"
$DownloadErrors += 1
$global:DownloadErrors += 1
}
}
function FindDynamicUrl ($SourcePage, $RegEx) {
@ -78,11 +78,11 @@ if ($MyInvocation.InvocationName -ne ".") {
$Path = $Temp
# 7-Zip
DownloadFile -Path $Path -Name "7z-installer.msi" -Url "http://www.7-zip.org/a/7z1801.msi"
DownloadFile -Path $Path -Name "7z-extra.7z" -Url "http://www.7-zip.org/a/7z1801-extra.7z"
DownloadFile -Path $Path -Name "7z-installer.msi" -Url "https://www.7-zip.org/a/7z1805.msi"
DownloadFile -Path $Path -Name "7z-extra.7z" -Url "https://www.7-zip.org/a/7z1805-extra.7z"
# ConEmu
$Url = "https://github.com/Maximus5/ConEmu/releases/download/v18.02.06/ConEmuPack.180206.7z"
$Url = "https://github.com/Maximus5/ConEmu/releases/download/v18.05.06/ConEmuPack.180506.7z"
DownloadFile -Path $Path -Name "ConEmuPack.7z" -Url $Url
# Notepad++
@ -90,9 +90,9 @@ if ($MyInvocation.InvocationName -ne ".") {
DownloadFile -Path $Path -Name "npp.7z" -Url $Url
# Python
$Url = "https://www.python.org/ftp/python/3.6.4/python-3.6.4-embed-win32.zip"
$Url = "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-win32.zip"
DownloadFile -Path $Path -Name "python32.zip" -Url $Url
$Url = "https://www.python.org/ftp/python/3.6.4/python-3.6.4-embed-amd64.zip"
$Url = "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-amd64.zip"
DownloadFile -Path $Path -Name "python64.zip" -Url $Url
# Python: psutil

View file

@ -70,7 +70,7 @@ function DownloadFile ($Path, $Name, $Url) {
}
catch {
Write-Host (" ERROR: Failed to download file." ) -ForegroundColor "Red"
$DownloadErrors += 1
$global:DownloadErrors += 1
}
}
function FindDynamicUrl ($SourcePage, $RegEx) {
@ -130,16 +130,16 @@ if ($MyInvocation.InvocationName -ne ".") {
## Download Tools ##
$ToolSources = @(
# 7-Zip
@("7z-installer.msi", "http://www.7-zip.org/a/7z1801.msi"),
@("7z-extra.7z", "http://www.7-zip.org/a/7z1801-extra.7z"),
@("7z-installer.msi", "https://www.7-zip.org/a/7z1805.msi"),
@("7z-extra.7z", "https://www.7-zip.org/a/7z1805-extra.7z"),
# Blue Screen View
@("bluescreenview64.zip", "http://www.nirsoft.net/utils/bluescreenview-x64.zip"),
@("bluescreenview32.zip", "http://www.nirsoft.net/utils/bluescreenview.zip"),
@("bluescreenview64.zip", "http://www.nirsoft.net/utils/bluescreenview-x64.zip"),
# ConEmu
@("ConEmuPack.7z", "https://github.com/Maximus5/ConEmu/releases/download/v18.02.06/ConEmuPack.180206.7z"),
@("ConEmuPack.7z", "https://github.com/Maximus5/ConEmu/releases/download/v18.05.06/ConEmuPack.180506.7z"),
# Fast Copy
@("fastcopy64.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip"),
@("fastcopy32.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341.zip"),
@("fastcopy64.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip"),
# HWiNFO
@("hwinfo.zip", "http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip"),
# Killer Network Drivers
@ -148,19 +148,19 @@ if ($MyInvocation.InvocationName -ne ".") {
("http://www.killernetworking.com"+(FindDynamicUrl "http://www.killernetworking.com/driver-downloads/item/killer-drivers-inf" "Download Killer-Ethernet").replace('&', '&'))
),
# Notepad++
@("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.x64.7z"),
@("npp_x86.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z"),
@("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.x64.7z"),
# NT Password Editor
@("ntpwed.zip", "http://cdslow.org.ru/files/ntpwedit/ntpwed07.zip"),
# Prime95
@("prime95_64.zip", "http://www.mersenne.org/ftp_root/gimps/p95v294b8.win64.zip"),
@("prime95_32.zip", "http://www.mersenne.org/ftp_root/gimps/p95v294b7.win32.zip"),
@("prime95_64.zip", "http://www.mersenne.org/ftp_root/gimps/p95v294b8.win64.zip"),
# ProduKey
@("produkey64.zip", "http://www.nirsoft.net/utils/produkey-x64.zip"),
@("produkey32.zip", "http://www.nirsoft.net/utils/produkey.zip"),
@("produkey64.zip", "http://www.nirsoft.net/utils/produkey-x64.zip"),
# Python
@("python64.zip", "https://www.python.org/ftp/python/3.6.4/python-3.6.4-embed-amd64.zip"),
@("python32.zip", "https://www.python.org/ftp/python/3.6.4/python-3.6.4-embed-win32.zip"),
@("python32.zip", "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-win32.zip"),
@("python64.zip", "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-amd64.zip"),
# Python: psutil
@(
"psutil64.whl",
@ -171,14 +171,16 @@ if ($MyInvocation.InvocationName -ne ".") {
(FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win32.whl")
),
# Q-Dir
@("qdir64.zip", "https://www.softwareok.com/Download/Q-Dir_Portable_x64.zip"),
@("qdir32.zip", "https://www.softwareok.com/Download/Q-Dir_Portable.zip"),
@("qdir64.zip", "https://www.softwareok.com/Download/Q-Dir_Portable_x64.zip"),
# TestDisk / PhotoRec
@("testdisk64.zip", "https://www.cgsecurity.org/testdisk-7.1-WIP.win64.zip"),
@("testdisk32.zip", "https://www.cgsecurity.org/testdisk-7.1-WIP.win.zip"),
@("testdisk64.zip", "https://www.cgsecurity.org/testdisk-7.1-WIP.win64.zip"),
# VirtIO drivers
@("virtio-win.iso", "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso"),
# wimlib-imagex
@("wimlib64.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-x86_64-bin.zip"),
@("wimlib32.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-i686-bin.zip")
@("wimlib32.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-i686-bin.zip"),
@("wimlib64.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-x86_64-bin.zip")
)
foreach ($Tool in $ToolSources) {
DownloadFile -Path $Temp -Name $Tool[0] -Url $Tool[1]
@ -207,8 +209,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"-aoa", "-bso0", "-bse0", "-bsp0",
"7za.exe", "*.txt")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\7z*" -Recurse
$SevenZip = "$Build\bin\x86\7-Zip\7za.exe"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -225,7 +225,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\bluescreenview32.zip", "-o$Build\bin\x86\BlueScreenView",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\bluescreenview*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -248,7 +247,6 @@ if ($MyInvocation.InvocationName -ne ".") {
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Build\bin\x86\ConEmu\ConEmu64.exe"
Remove-Item "$Build\bin\x86\ConEmu\ConEmu64.map"
Remove-Item "$Temp\ConEmuPack*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -267,7 +265,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"-aoa", "-bso0", "-bse0", "-bsp0",
"-x!setup.exe", "-x!*.dll")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\fastcopy*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -286,7 +283,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"-aoa", "-bso0", "-bse0", "-bsp0",
"Production\Windows10-x86\Eth\*")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\killerinf*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -303,7 +299,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"e", "$Temp\hwinfo.zip", "-o$Build\bin\x86\HWiNFO",
"-aoa", "-bso0", "-bse0", "-bsp0", "HWiNFO32.exe")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
# Remove-Item "$Temp\hwinfo.zip"
Move-Item "$Build\bin\amd64\HWiNFO\HWiNFO64.exe" "$Build\bin\amd64\HWiNFO\HWiNFO.exe" -Force
Move-Item "$Build\bin\x86\HWiNFO\HWiNFO32.exe" "$Build\bin\x86\HWiNFO\HWiNFO.exe" -Force
}
@ -322,7 +317,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\npp_x86.7z", "-o$Build\bin\x86\NotepadPlusPlus",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\npp*"
Move-Item "$Build\bin\amd64\NotepadPlusPlus\notepad++.exe" "$Build\bin\amd64\NotepadPlusPlus\notepadplusplus.exe" -Force
Move-Item "$Build\bin\x86\NotepadPlusPlus\notepad++.exe" "$Build\bin\x86\NotepadPlusPlus\notepadplusplus.exe" -Force
}
@ -344,7 +338,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"-aoa", "-bso0", "-bse0", "-bsp0",
"ntpwedit.exe", "*.txt")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\ntpwed*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -369,7 +362,6 @@ if ($MyInvocation.InvocationName -ne ".") {
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Move-Item "$Build\bin\x86\TestDisk\testdisk-7.1-WIP\*" "$Build\bin\x86\TestDisk" -Force
Remove-Item "$Build\bin\x86\TestDisk\testdisk-7.1-WIP" -Recurse -Force
Remove-Item "$Temp\testdisk*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -386,7 +378,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\prime95_32.zip", "-o$Build\bin\x86\Prime95",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\prime95*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -402,7 +393,6 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\produkey32.zip", "-o$Build\bin\x86\ProduKey",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\produkey*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -441,8 +431,6 @@ if ($MyInvocation.InvocationName -ne ".") {
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
}
Remove-Item "$Temp\python*"
Remove-Item "$Temp\*.whl"
# Q-Dir
Write-Host "Extracting: Q-Dir"
@ -456,7 +444,24 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\qdir32.zip", "-o$Build\bin\x86",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\qdir*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
}
# VirtIO Drivers
Write-Host "Extracting: VirtIO Drivers"
try {
$ArgumentList = @(
"e", "$Temp\virtio-win.iso", "-o$Build\Drivers\amd64\VirtIO",
"-aoa", "-bso0", "-bse0", "-bsp0",
"*\w10\amd64\*")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
$ArgumentList = @(
"e", "$Temp\virtio-win.iso", "-o$Build\Drivers\x86\VirtIO",
"-aoa", "-bso0", "-bse0", "-bsp0",
"*\w10\x86\*")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
@ -472,11 +477,15 @@ if ($MyInvocation.InvocationName -ne ".") {
"x", "$Temp\wimlib32.zip", "-o$Build\bin\x86\wimlib",
"-aoa", "-bso0", "-bse0", "-bsp0")
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
Remove-Item "$Temp\wimlib*"
}
catch {
Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"
}
## Cleanup ##
if (Ask-User "Delete temp files?") {
Remove-Item "$Temp" -Recurse
}
}
## Build ##

View file

@ -23,7 +23,7 @@ if __name__ == '__main__':
'GenericRepair': 'Repaired',
'UnsupportedOSError': 'Unsupported OS',
}}
disabled = bool(global_vars['OS']['Version'] not in ['8', '10'])
disabled = bool(global_vars['OS']['Version'] not in ('8', '8.1', '10'))
options = [
{'Name': 'Check Health', 'Repair': False, 'Disabled': disabled},
{'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}]

View file

@ -1,5 +1,7 @@
# Wizard Kit: Functions - Backup
import ctypes
from functions.disk import *
# Regex
@ -30,9 +32,41 @@ def backup_partition(disk, par):
def fix_path(path):
"""Replace invalid filename characters with underscores."""
return REGEX_BAD_PATH_NAMES.sub('_', path)
local_drive = path[1:2] == ':'
new_path = REGEX_BAD_PATH_NAMES.sub('_', path)
if local_drive:
new_path = '{}:{}'.format(new_path[0:1], new_path[2:])
return new_path
def prep_disk_for_backup(destination, disk, ticket_number):
def get_volume_display_name(mountpoint):
"""Get display name from volume mountpoint and label, returns str."""
name = mountpoint
try:
kernel32 = ctypes.windll.kernel32
vol_name_buffer = ctypes.create_unicode_buffer(1024)
fs_name_buffer = ctypes.create_unicode_buffer(1024)
serial_number = None
max_component_length = None
file_system_flags = None
vol_info = kernel32.GetVolumeInformationW(
ctypes.c_wchar_p(mountpoint),
vol_name_buffer,
ctypes.sizeof(vol_name_buffer),
serial_number,
max_component_length,
file_system_flags,
fs_name_buffer,
ctypes.sizeof(fs_name_buffer)
)
name = '{} "{}"'.format(name, vol_name_buffer.value)
except:
pass
return name
def prep_disk_for_backup(destination, disk, backup_prefix):
"""Gather details about the disk and its partitions.
This includes partitions that can't be backed up,
@ -71,10 +105,10 @@ def prep_disk_for_backup(destination, disk, ticket_number):
par['Image Name'] = par['Name'] if par['Name'] else 'Unknown'
if 'IP' in destination:
par['Image Path'] = r'\\{}\{}\{}'.format(
destination['IP'], destination['Share'], ticket_number)
destination['IP'], destination['Share'], backup_prefix)
else:
par['Image Path'] = r'{}:\{}'.format(
ticket_number, destination['Letter'])
destination['Letter'], backup_prefix)
par['Image Path'] += r'\{}_{}.wim'.format(
par['Number'], par['Image Name'])
par['Image Path'] = fix_path(par['Image Path'])
@ -114,7 +148,20 @@ def select_backup_destination(auto_select=True):
actions = [
{'Name': 'Main Menu', 'Letter': 'M'},
]
# Add local disks
for d in psutil.disk_partitions():
if re.search(r'^{}'.format(global_vars['Env']['SYSTEMDRIVE']), d.mountpoint, re.IGNORECASE):
# Skip current OS drive
pass
elif 'fixed' in d.opts:
# Skip DVD, etc
destinations.append({
'Name': 'Local Disk - {}'.format(
get_volume_display_name(d.mountpoint)),
'Letter': re.sub(r'^(\w):\\.*$', r'\1', d.mountpoint),
})
# Size check
for dest in destinations:
if 'IP' in dest:

View file

@ -18,6 +18,7 @@ from subprocess import CalledProcessError
from settings.main import *
from settings.tools import *
from settings.windows_builds import *
# Global variables
global_vars = {}
@ -189,12 +190,17 @@ def extract_item(item, filter='', silent=False):
print_standard('Extracting "{item}"...'.format(item=item))
try:
run_program(cmd)
except FileNotFoundError:
if not silent:
print_warning('WARNING: Archive not found')
except subprocess.CalledProcessError:
if not silent:
print_warning('WARNING: Errors encountered while exctracting data')
def get_ticket_number():
"""Get TicketNumber from user, save in LogDir, and return as str."""
if not ENABLED_TICKET_NUMBERS:
return None
ticket_number = None
while ticket_number is None:
_input = input('Enter ticket number: ')
@ -207,6 +213,15 @@ def get_ticket_number():
f.write(ticket_number)
return ticket_number
def get_simple_string(prompt='Enter string'):
"""Get string from user (only alphanumeric/space chars) and return as str."""
simple_string = None
while simple_string is None:
_input = input('{}: '.format(prompt))
if re.match(r'^(\w|-| )+$', _input, re.ASCII):
simple_string = _input.strip()
return simple_string
def human_readable_size(size, decimals=0):
"""Convert size in bytes to a human-readable format and return a str."""
# Prep string formatting
@ -469,7 +484,12 @@ def stay_awake():
def get_exception(s):
"""Get exception by name, returns Exception object."""
return getattr(sys.modules[__name__], s)
try:
obj = getattr(sys.modules[__name__], s)
except AttributeError:
# Try builtin classes
obj = getattr(sys.modules['builtins'], s)
return obj
def try_and_print(message='Trying...',
function=None, cs='CS', ns='NS', other_results={},
@ -620,88 +640,47 @@ def check_os():
tmp[name] = winreg.QueryValueEx(key, name)[0]
except FileNotFoundError:
tmp[name] = 'Unknown'
try:
tmp['CurrentBuild'] = int(tmp['CurrentBuild'])
except ValueError:
# This should be interesting...
tmp['CurrentBuild'] = -1
try:
tmp['CurrentVersion'] = float(tmp['CurrentVersion'])
except ValueError:
# This should also be interesting...
tmp['CurrentVersion'] = -1
# Handle CurrentBuild collision
if tmp['CurrentBuild'] == '9200':
if tmp['CurrentVersion'] == '6.2':
# Windown 8, set to fake build number
tmp['CurrentBuild'] = '9199'
else:
# Windows 8.1, leave alone
pass
# Check bit depth
tmp['Arch'] = 32
if 'PROGRAMFILES(X86)' in global_vars['Env']:
tmp['Arch'] = 64
# Get Windows build info
build_info = WINDOWS_BUILDS.get(
tmp['CurrentBuild'],
('Unknown', 'Build {}'.format(tmp['CurrentBuild']), None, None, 'unrecognized'))
build_info = list(build_info)
tmp['Version'] = build_info.pop(0)
tmp['Release'] = build_info.pop(0)
tmp['Codename'] = build_info.pop(0)
tmp['Marketing Name'] = build_info.pop(0)
tmp['Notes'] = build_info.pop(0)
# Set name
tmp['Name'] = tmp['ProductName']
if tmp['CurrentBuild'] == 7601:
tmp['Name'] += ' SP1' # Win 7
if tmp['CurrentBuild'] == 9600:
tmp['Name'] += ' Update' # Win 8.1u
if tmp['CurrentBuild'] == 10240:
tmp['Name'] += ' Release 1507 "Threshold 1"'
if tmp['CurrentBuild'] == 10586:
tmp['Name'] += ' Release 1511 "Threshold 2"'
if tmp['CurrentBuild'] == 14393:
tmp['Name'] += ' Release 1607 "Redstone 1" / "Anniversary Update"'
if tmp['CurrentBuild'] == 15063:
tmp['Name'] += ' Release 1703 "Redstone 2" / "Creators Update"'
if tmp['CurrentBuild'] == 16299:
tmp['Name'] += ' Release 1709 "Redstone 3" / "Fall Creators Update"'
if tmp['Release']:
tmp['Name'] += ' {}'.format(tmp['Release'])
if tmp['Codename']:
tmp['Name'] += ' "{}"'.format(tmp['Codename'])
if tmp['Marketing Name']:
tmp['Name'] += ' / "{}"'.format(tmp['Marketing Name'])
tmp['Name'] = re.sub(r'\s+', ' ', tmp['Name'])
# Set display name
tmp['DisplayName'] = '{} x{}'.format(tmp['Name'], tmp['Arch'])
if tmp['CurrentBuild'] in [7600, 9200, 10240, 10586]:
tmp['DisplayName'] += ' (very outdated)'
elif tmp['CurrentBuild'] in [7601, 9600, 14393, 15063]:
tmp['DisplayName'] += ' (outdated)'
elif tmp['CurrentBuild'] == 16299:
pass # Current Win10 release
else:
tmp['DisplayName'] += ' (unrecognized)'
# Set version
if tmp['CurrentVersion'] == 6.0:
tmp['Version'] = 'Vista'
elif tmp['CurrentVersion'] == 6.1:
tmp['Version'] = '7'
elif 6.2 <= tmp['CurrentVersion'] <= 6.3:
if tmp['CurrentBuild'] <= 9600:
tmp['Version'] = '8'
elif tmp['CurrentBuild'] >= 10240:
tmp['Version'] = '10'
else:
tmp['Version'] = 'Unknown'
if tmp['Notes']:
tmp['DisplayName'] += ' ({})'.format(tmp['Notes'])
# == vista ==
# 6.0.6000
# 6.0.6001 # SP1
# 6.0.6002 # SP2
# ==== 7 ====
# 6.1.7600
# 6.1.7601 # SP1
# 6.1.7602 # Umm.. where'd this come from?
# ==== 8 ====
# 6.2.9200
# === 8.1 ===
# 6.3.9200
# === 8.1u ==
# 6.3.9600
# === 10 v1507 "Threshold 1" ==
# 6.3.10240
# === 10 v1511 "Threshold 2" ==
# 6.3.10586
# === 10 v1607 "Redstone 1" "Anniversary Update" ==
# 6.3.14393
# === 10 v1703 "Redstone 2" "Creators Update" ==
# 6.3.15063
# === 10 v1709 "Redstone 3" "Fall Creators Update" ==
# 6.3.16299
global_vars['OS'] = tmp
def check_tools():

View file

@ -16,6 +16,9 @@ class LocalDisk():
def is_dir(self):
# Should always be true
return True
def is_file(self):
# Should always be false
return False
class SourceItem():
def __init__(self, name, path):
@ -167,93 +170,106 @@ def is_valid_wim_file(item):
print_log('WARNING: Image "{}" damaged.'.format(item.name))
return valid
def get_mounted_data():
def get_mounted_volumes():
"""Get mounted volumes, returns dict."""
cmd = [
'findmnt', '-J', '-b', '-i',
't', (
'autofs,binfmt_misc,cgroup,cgroup2,configfs,debugfs,devpts,devtmpfs,'
'-t', (
'autofs,binfmt_misc,bpf,cgroup,cgroup2,configfs,debugfs,devpts,devtmpfs,'
'hugetlbfs,mqueue,proc,pstore,securityfs,sysfs,tmpfs'
),
'-o', 'SOURCE,TARGET,FSTYPE,LABEL,SIZE,AVAIL,USED']
result = run_program(cmd)
json_data = json.loads(result.stdout.decode())
mounted_data = []
mounted_volumes = []
for item in json_data.get('filesystems', []):
mounted_data.append(item)
mounted_data.extend(item.get('children', []))
return {item['source']: item for item in mounted_data}
mounted_volumes.append(item)
mounted_volumes.extend(item.get('children', []))
return {item['source']: item for item in mounted_volumes}
def mount_all_volumes():
"""Mount all attached devices with recognized filesystems."""
report = []
"""Mount all detected filesystems."""
report = {}
# Get list of block devices
cmd = ['lsblk', '-J', '-o', 'NAME,FSTYPE,LABEL,UUID,PARTTYPE,TYPE,SIZE']
cmd = [
'lsblk', '-J', '-p',
'-o', 'NAME,FSTYPE,LABEL,UUID,PARTTYPE,TYPE,SIZE']
result = run_program(cmd)
json_data = json.loads(result.stdout.decode())
devs = json_data.get('blockdevices', [])
# Get list of mounted devices
mounted_data = get_mounted_data()
mounted_list = [m['source'] for m in mounted_data.values()]
# Loop over devices
# Get list of volumes
volumes = {}
for dev in devs:
dev_path = '/dev/{}'.format(dev['name'])
if re.search(r'^(loop|sr)', dev['name'], re.IGNORECASE):
# Skip loopback devices and optical media
report.append([dev_path, 'Skipped'])
continue
for child in dev.get('children', []):
child_path = '/dev/{}'.format(child['name'])
if child_path in mounted_list:
report.append([child_path, 'Already Mounted'])
else:
try:
run_program(['udevil', 'mount', '-o', 'ro', child_path])
report.append([child_path, 'CS'])
except subprocess.CalledProcessError:
report.append([child_path, 'NS'])
volumes.update({child['name']: child})
for grandchild in child.get('children', []):
volumes.update({grandchild['name']: grandchild})
# Get list of mounted volumes
mounted_volumes = get_mounted_volumes()
# Update list of mounted devices
mounted_data = get_mounted_data()
mounted_list = [m['source'] for m in mounted_data.values()]
# Update report lines for show_data()
for line in report:
_path = line[0]
_result = line[1]
info = {'message': '{}:'.format(_path)}
if _path in mounted_list:
info['data'] = 'Mounted on {}'.format(
mounted_data[_path]['target'])
info['data'] = '{:40} ({} used, {} free)'.format(
info['data'],
human_readable_size(mounted_data[_path]['used']),
human_readable_size(mounted_data[_path]['avail']))
if _result == 'Already Mounted':
info['warning'] = True
elif _result == 'Skipped':
info['data'] = 'Skipped'
info['warning'] = True
# Loop over volumes
for vol_path, vol_data in volumes.items():
vol_data['show_data'] = {
'message': vol_path.replace('/dev/mapper/', ''),
'data': None,
}
if re.search(r'^loop\d', vol_path, re.IGNORECASE):
# Skip loopback devices
vol_data['show_data']['data'] = 'Skipped'
vol_data['show_data']['warning'] = True
report[vol_path] = vol_data
elif 'children' in vol_data:
# Skip LVM/RAID partitions (the real volume is mounted separately)
vol_data['show_data']['data'] = vol_data.get('fstype', 'UNKNOWN')
if vol_data.get('label', None):
vol_data['show_data']['data'] += ' "{}"'.format(vol_data['label'])
vol_data['show_data']['info'] = True
report[vol_path] = vol_data
else:
info['data'] = 'Failed to mount'
info['error'] = True
line.append(info)
if vol_path in mounted_volumes:
vol_data['show_data']['warning'] = True
else:
# Mount volume
try:
run_program(['udevil', 'mount', '-o', 'ro', vol_path])
except subprocess.CalledProcessError:
vol_data['show_data']['data'] = 'Failed to mount'
vol_data['show_data']['error'] = True
# Update mounted_volumes data
mounted_volumes = get_mounted_volumes()
# Format pretty result string
if vol_data['show_data']['data'] != 'Failed to mount':
size_used = human_readable_size(
mounted_volumes[vol_path]['used'])
size_avail = human_readable_size(
mounted_volumes[vol_path]['avail'])
vol_data['show_data']['data'] = 'Mounted on {}'.format(
mounted_volumes[vol_path]['target'])
vol_data['show_data']['data'] = '{:40} ({} used, {} free)'.format(
vol_data['show_data']['data'],
size_used,
size_avail)
# Update report
report[vol_path] = vol_data
return report
def mount_backup_shares(read_write=False):
"""Mount the backup shares unless labeled as already mounted."""
if psutil.LINUX:
mounted_data = get_mounted_data()
mounted_volumes = get_mounted_volumes()
for server in BACKUP_SERVERS:
if psutil.LINUX:
# Update mounted status
source = '//{IP}/{Share}'.format(**server)
dest = '/Backups/{Name}'.format(**server)
mounted_str = '(Already) Mounted {}'.format(dest)
data = mounted_data.get(source, {})
data = mounted_volumes.get(source, {})
if dest == data.get('target', ''):
server['Mounted'] = True
elif psutil.WINDOWS:
@ -404,7 +420,13 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
root_items = []
item_list = list_source_items(source_obj, rel_path)
for item in item_list:
if REGEX_INCL_ROOT_ITEMS.search(item.name):
if REGEX_WINDOWS_OLD.search(item.name):
item.name = '{}{}{}'.format(
rel_path,
os.sep if rel_path else '',
item.name)
win_olds.append(item)
elif REGEX_INCL_ROOT_ITEMS.search(item.name):
print_success('Auto-Selected: {}'.format(item.path))
root_items.append('{}'.format(item.path))
elif not REGEX_EXCL_ROOT_ITEMS.search(item.name):
@ -424,12 +446,6 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
interactive = False
if answer in ['Yes', 'All']:
root_items.append('{}'.format(item.path))
if REGEX_WINDOWS_OLD.search(item.name):
item.name = '{}{}{}'.format(
rel_path,
os.sep if rel_path else '',
item.name)
win_olds.append(item)
if root_items:
selected_items.append({
'Message': '{}{}Root Items...'.format(
@ -446,7 +462,8 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
rel_path,
' ' if rel_path else ''),
'Items': [font_obj.path],
'Destination': dest_path})
'Destination': '{}{}Windows'.format(
dest_path, os.sep)})
# Registry
registry_items = []
@ -461,13 +478,14 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
rel_path,
' ' if rel_path else ''),
'Items': registry_items.copy(),
'Destination': dest_path})
'Destination': '{}{}Windows{}System32'.format(
dest_path, os.sep, os.sep)})
# Windows.old(s)
for old in win_olds:
selected_items.extend(scan_source(
source_obj,
dest_path,
'{}{}{}'.format(dest_path, os.sep, old.name),
rel_path=old.name,
interactive=False))
@ -529,21 +547,21 @@ def select_destination(folder_path, prompt='Select destination'):
return path
def select_source(ticket_number):
"""Select backup from those found on the BACKUP_SERVERS for the ticket."""
def select_source(backup_prefix):
"""Select backup from those found on the BACKUP_SERVERS matching the prefix."""
selected_source = None
local_sources = []
remote_sources = []
sources = []
mount_backup_shares(read_write=False)
# Check for ticket folders on servers
# Check for prefix folders on servers
for server in BACKUP_SERVERS:
if server['Mounted']:
print_standard('Scanning {}...'.format(server['Name']))
for d in os.scandir(r'\\{IP}\{Share}'.format(**server)):
if (d.is_dir()
and d.name.lower().startswith(ticket_number.lower())):
and d.name.lower().startswith(backup_prefix.lower())):
# Add folder to remote_sources
remote_sources.append({
'Name': '{:9}| File-Based: [DIR] {}'.format(
@ -553,19 +571,19 @@ def select_source(ticket_number):
'Source': d})
# Check for images and subfolders
for ticket_path in remote_sources.copy():
for item in os.scandir(ticket_path['Source'].path):
for prefix_path in remote_sources.copy():
for item in os.scandir(prefix_path['Source'].path):
if item.is_dir():
# Add folder to remote_sources
remote_sources.append({
'Name': r'{:9}| File-Based: [DIR] {}\{}'.format(
ticket_path['Server']['Name'], # Server
ticket_path['Source'].name, # Ticket folder
prefix_path['Server']['Name'], # Server
prefix_path['Source'].name, # Prefix folder
item.name, # Sub-folder
),
'Server': ticket_path['Server'],
'Server': prefix_path['Server'],
'Sort': r'{}\{}'.format(
ticket_path['Source'].name, # Ticket folder
prefix_path['Source'].name, # Prefix folder
item.name, # Sub-folder
),
'Source': item})
@ -581,15 +599,15 @@ def select_source(ticket_number):
remote_sources.append({
'Disabled': bool(not is_valid_wim_file(subitem)),
'Name': r'{:9}| Image-Based: {:>7} {}\{}\{}'.format(
ticket_path['Server']['Name'], # Server
prefix_path['Server']['Name'], # Server
size, # Size (duh)
ticket_path['Source'].name, # Ticket folder
prefix_path['Source'].name, # Prefix folder
item.name, # Sub-folder
subitem.name, # Image file
),
'Server': ticket_path['Server'],
'Server': prefix_path['Server'],
'Sort': r'{}\{}\{}'.format(
ticket_path['Source'].name, # Ticket folder
prefix_path['Source'].name, # Prefix folder
item.name, # Sub-folder
subitem.name, # Image file
),
@ -603,14 +621,14 @@ def select_source(ticket_number):
remote_sources.append({
'Disabled': bool(not is_valid_wim_file(item)),
'Name': r'{:9}| Image-Based: {:>7} {}\{}'.format(
ticket_path['Server']['Name'], # Server
prefix_path['Server']['Name'], # Server
size, # Size (duh)
ticket_path['Source'].name, # Ticket folder
prefix_path['Source'].name, # Prefix folder
item.name, # Image file
),
'Server': ticket_path['Server'],
'Server': prefix_path['Server'],
'Sort': r'{}\{}'.format(
ticket_path['Source'].name, # Ticket folder
prefix_path['Source'].name, # Prefix folder
item.name, # Image file
),
'Source': item})
@ -630,6 +648,31 @@ def select_source(ticket_number):
' Local', d.mountpoint),
'Sort': d.mountpoint,
'Source': LocalDisk(d)})
# Check for images and subfolders
for item in os.scandir(d.mountpoint):
if REGEX_WIM_FILE.search(item.name):
try:
size = human_readable_size(item.stat().st_size)
except Exception:
size = ' ? ?' # unknown
local_sources.append({
'Disabled': bool(not is_valid_wim_file(item)),
'Name': r'{:9}| Image-Based: {:>7} {}{}'.format(
' Local', size, d.mountpoint, item.name),
'Sort': r'{}{}'.format(d.mountpoint, item.name),
'Source': item})
elif REGEX_EXCL_ROOT_ITEMS.search(item.name):
pass
elif REGEX_EXCL_ITEMS.search(item.name):
pass
elif item.is_dir():
# Add folder to local_sources
local_sources.append({
'Name': r'{:9}| File-Based: [DIR] {}{}'.format(
' Local', d.mountpoint, item.name),
'Sort': r'{}{}'.format(d.mountpoint, item.name),
'Source': item})
set_thread_error_mode(silent=False) # Return to normal
# Build Menu
@ -652,8 +695,8 @@ def select_source(ticket_number):
else:
selected_source = sources[int(selection)-1]['Source']
else:
print_error('ERROR: No backups found for ticket: {}.'.format(
ticket_number))
print_error('ERROR: No backups found using prefix: {}.'.format(
backup_prefix))
umount_backup_shares()
pause("Press Enter to exit...")
exit_script()
@ -736,7 +779,7 @@ def transfer_source(source_obj, dest_path, selected_items):
function=run_wimextract, cs='Done',
source=source_obj.path,
items=group['Items'],
dest=group['Destination'])
dest=dest_path)
else:
print_error('ERROR: Unsupported image: {}'.format(source_obj.path))
raise GenericError

View file

@ -125,9 +125,9 @@ def menu_diags(*args):
if diag_modes[int(selection)-1]['Name'] != 'Quick drive test':
# Save log for non-quick tests
ticket_number = get_ticket_number()
global_vars['LogDir'] = '{}/Tickets/{}'.format(
global_vars['LogDir'] = '{}/Logs/{}'.format(
global_vars['Env']['HOME'],
ticket_number)
ticket_number if ticket_number else global_vars['Date-Time'])
os.makedirs(global_vars['LogDir'], exist_ok=True)
global_vars['LogFile'] = '{}/Hardware Diagnostics.log'.format(
global_vars['LogDir'])
@ -503,7 +503,7 @@ def run_tests(tests):
# Open log
if not TESTS['NVMe/SMART']['Quick']:
try:
popen_program(['nohup', 'leafpad', global_vars['LogFile']])
popen_program(['nohup', 'leafpad', global_vars['LogFile']], pipe=True)
except Exception:
print_error('ERROR: Failed to open log: {}'.format(
global_vars['LogFile']))

View file

@ -116,6 +116,36 @@ def get_folder_size(path):
size = human_readable_size(size)
return size
def get_installed_antivirus():
"""Get list of installed Antivirus programs."""
programs = []
cmd = ['WMIC', r'/namespace:\\root\SecurityCenter2',
'path', 'AntivirusProduct',
'get', 'displayName', '/value']
out = run_program(cmd)
out = out.stdout.decode().strip()
products = out.splitlines()
products = [p.split('=')[1] for p in products if p]
for prod in sorted(products):
# Get product state and check if it's enabled
# credit: https://jdhitsolutions.com/blog/powershell/5187/get-antivirus-product-status-with-powershell/
cmd = ['WMIC', r'/namespace:\\root\SecurityCenter2',
'path', 'AntivirusProduct',
'where', 'displayName="{}"'.format(prod),
'get', 'productState', '/value']
out = run_program(cmd)
out = out.stdout.decode().strip()
state = out.split('=')[1]
state = hex(int(state))
if str(state)[3:5] != '10':
programs.append('[Disabled] {}'.format(prod))
else:
programs.append(prod)
if len(programs) == 0:
programs = ['No programs found']
return programs
def get_installed_office():
"""Get list of installed Office programs."""
programs = []
@ -419,7 +449,7 @@ def show_os_name():
# Show all 32-bit installs as an error message
print_error(os_name, timestamp=False)
else:
if re.search(r'(unrecognized|very outdated)', os_name, re.IGNORECASE):
if re.search(r'(preview build|unrecognized|unsupported)', os_name, re.IGNORECASE):
print_error(os_name, timestamp=False)
elif re.search(r'outdated', os_name, re.IGNORECASE):
print_warning(os_name, timestamp=False)

View file

@ -11,7 +11,7 @@ def run_chkdsk(repair=False):
def run_chkdsk_scan():
"""Run CHKDSK in a "split window" and report errors."""
if global_vars['OS']['Version'] in ['8', '10']:
if global_vars['OS']['Version'] in ('8', '8.1', '10'):
cmd = ['chkdsk', global_vars['Env']['SYSTEMDRIVE'], '/scan', '/perf']
else:
cmd = ['chkdsk', global_vars['Env']['SYSTEMDRIVE']]
@ -44,7 +44,7 @@ def run_chkdsk_offline():
def run_dism(repair=False):
"""Run DISM /RestoreHealth, then /CheckHealth, and then report errors."""
if global_vars['OS']['Version'] in ['8', '10']:
if global_vars['OS']['Version'] in ('8', '8.1', '10'):
if repair:
# Restore Health
cmd = [

View file

@ -0,0 +1,36 @@
# Wizard Kit: Functions - SafeMode
from functions.common import *
# STATIC VARIABLES
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
def disable_safemode_msi():
"""Disable MSI access under safemode."""
cmd = ['reg', 'delete', REG_MSISERVER, '/f']
run_program(cmd)
def disable_safemode():
"""Edit BCD to remove safeboot value."""
cmd = ['bcdedit', '/deletevalue', '{default}', 'safeboot']
run_program(cmd)
def enable_safemode_msi():
"""Enable MSI access under safemode."""
cmd = ['reg', 'add', REG_MSISERVER, '/f']
run_program(cmd)
cmd = ['reg', 'add', REG_MSISERVER, '/ve',
'/t', 'REG_SZ', '/d', 'Service', '/f']
run_program(cmd)
def enable_safemode():
"""Edit BCD to set safeboot as default."""
cmd = ['bcdedit', '/set', '{default}', 'safeboot', 'network']
run_program(cmd)
def reboot(delay=3):
cmd = ['shutdown', '-r', '-t', '{}'.format(delay)]
run_program(cmd, check=False)
if __name__ == '__main__':
print("This file is not meant to be called directly.")

View file

@ -5,6 +5,12 @@ from functions.common import *
# STATIC VARIABLES
HKCU = winreg.HKEY_CURRENT_USER
HKLM = winreg.HKEY_LOCAL_MACHINE
OTHER_RESULTS = {
'Error': {
'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found',
},
'Warning': {}}
SETTINGS_CLASSIC_START = {
r'Software\IvoSoft\ClassicShell\Settings': {},
r'Software\IvoSoft\ClassicStartMenu': {
@ -212,7 +218,7 @@ def install_adobe_reader():
'/msi', '/norestart', '/quiet',
'ALLUSERS=1',
'EULA_ACCEPT=YES']
try_and_print(message='Adobe Reader DC...', function=run_program, cmd=cmd)
run_program(cmd)
def install_chrome_extensions():
"""Update registry to 'install' Google Chrome extensions for all users."""
@ -220,7 +226,7 @@ def install_chrome_extensions():
def install_classicstart_skin():
"""Extract ClassicStart skin to installation folder."""
if global_vars['OS']['Version'] not in ['8', '10']:
if global_vars['OS']['Version'] not in ('8', '8.1', '10'):
raise UnsupportedOSError
extract_item('ClassicStartSkin', silent=True)
source = r'{BinDir}\ClassicStartSkin\Metro-Win10-Black.skin7'.format(
@ -235,17 +241,21 @@ def install_firefox_extensions():
"""Extract Firefox extensions to installation folder."""
dist_path = r'{PROGRAMFILES}\Mozilla Firefox\distribution\extensions'.format(
**global_vars['Env'])
source_path = r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars)
if not os.path.exists(source_path):
raise FileNotFoundError
# Extract extension(s) to distribution folder
cmd = [
global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0',
'-p{ArchivePassword}'.format(**global_vars),
'-o{dist_path}'.format(dist_path=dist_path),
r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars)]
source_path]
run_program(cmd)
def install_ninite_bundle(mse=False):
"""Run Ninite file(s) based on OS version."""
if global_vars['OS']['Version'] in ['8', '10']:
if global_vars['OS']['Version'] in ('8', '8.1', '10'):
# Modern selection
popen_program(r'{BaseDir}\Installers\Extras\Bundles\Modern.exe'.format(
**global_vars))
@ -262,11 +272,26 @@ def install_vcredists():
"""Install all supported Visual C++ runtimes."""
extract_item('_vcredists', silent=True)
prev_dir = os.getcwd()
os.chdir(r'{BinDir}\_vcredists'.format(**global_vars))
try:
os.chdir(r'{BinDir}\_vcredists'.format(**global_vars))
except FileNotFoundError:
# Ignored since the loop below will report the errors
pass
for vcr in VCR_REDISTS:
try_and_print(message=vcr['Name'], function=run_program, cmd=vcr['Cmd'])
try_and_print(message=vcr['Name'], function=run_program,
cmd=vcr['Cmd'], other_results=OTHER_RESULTS)
os.chdir(prev_dir)
# Misc
def open_device_manager():
popen_program(['mmc', 'devmgmt.msc'])
def open_windows_activation():
popen_program(['slui'])
def open_windows_updates():
popen_program(['control', '/name', 'Microsoft.WindowsUpdate'])
if __name__ == '__main__':
print("This file is not meant to be called directly.")

View file

@ -50,7 +50,8 @@ def find_windows_image(windows_version):
path = '{}images\{}.{}'.format(d.mountpoint, imagefile, ext)
if os.path.isfile(path) and wim_contains_image(path, imagename):
image['Path'] = path
image['Source'] = d.mountpoint[:1]
image['Letter'] = d.mountpoint[:1].upper()
image['Local'] = True
if ext == 'swm':
image['Glob'] = '--ref="{}*.swm"'.format(image['Path'][:-4])
break
@ -68,7 +69,8 @@ def find_windows_image(windows_version):
ext)
if os.path.isfile(path) and wim_contains_image(path, imagename):
image['Path'] = path
image['Source'] = None
image['Letter'] = None
image['Local'] = False
if ext == 'swm':
image['Glob'] = '--ref="{}*.swm"'.format(
image['Path'][:-4])

View file

@ -75,11 +75,22 @@ def menu_backup():
}}
set_title('{}: Backup Menu'.format(KIT_NAME_FULL))
# Set ticket Number
# Set backup prefix
clear_screen()
print_standard('{}\n'.format(global_vars['Title']))
ticket_number = get_ticket_number()
if ENABLED_TICKET_NUMBERS:
backup_prefix = ticket_number
else:
backup_prefix = get_simple_string(prompt='Enter backup name prefix')
backup_prefix = backup_prefix.replace(' ', '_')
# Assign drive letters
try_and_print(
message = 'Assigning letters...',
function = assign_volume_letters,
other_results = other_results)
# Mount backup shares
mount_backup_shares(read_write=True)
@ -87,10 +98,6 @@ def menu_backup():
destination = select_backup_destination(auto_select=False)
# Scan disks
try_and_print(
message = 'Assigning letters...',
function = assign_volume_letters,
other_results = other_results)
result = try_and_print(
message = 'Getting disk info...',
function = scan_disks,
@ -107,12 +114,13 @@ def menu_backup():
raise GenericAbort
# "Prep" disk
prep_disk_for_backup(destination, disk, ticket_number)
prep_disk_for_backup(destination, disk, backup_prefix)
# Display details for backup task
clear_screen()
print_info('Create Backup - Details:\n')
show_data(message='Ticket:', data=ticket_number)
if ENABLED_TICKET_NUMBERS:
show_data(message='Ticket:', data=ticket_number)
show_data(
message = 'Source:',
data = '[{}] ({}) {} {}'.format(
@ -264,13 +272,14 @@ def menu_setup():
windows_version = select_windows_version()
# Find Windows image
# NOTE: Reassign volume letters to ensure all devices are scanned
try_and_print(
message = 'Assigning volume letters...',
function = assign_volume_letters,
other_results = other_results)
windows_image = find_windows_image(windows_version)
# Scan disks
try_and_print(
message = 'Assigning letters...',
function = assign_volume_letters,
other_results = other_results)
result = try_and_print(
message = 'Getting disk info...',
function = scan_disks,
@ -292,7 +301,8 @@ def menu_setup():
# Display details for setup task
clear_screen()
print_info('Setup Windows - Details:\n')
show_data(message='Ticket:', data=ticket_number)
if ENABLED_TICKET_NUMBERS:
show_data(message='Ticket:', data=ticket_number)
show_data(message='Installing:', data=windows_version['Name'])
show_data(
message = 'Boot Method:',
@ -327,10 +337,22 @@ def menu_setup():
raise GenericAbort
# Remove volume letters so S, T, & W can be used below
remove_volume_letters(keep=windows_image['Source'])
new_letter = reassign_volume_letter(letter=windows_image['Source'])
if new_letter:
windows_image['Source'] = new_letter
try_and_print(
message = 'Removing volume letters...',
function = remove_volume_letters,
other_results = other_results,
keep=windows_image['Letter'])
# Assign new letter for local source if necessary
if windows_image['Local'] and windows_image['Letter'] in ['S', 'T', 'W']:
new_letter = try_and_print(
message = 'Reassigning source volume letter...',
function = reassign_volume_letter,
other_results = other_results,
letter=windows_image['Letter'])
windows_image['Path'] = '{}{}'.format(
new_letter, windows_image['Path'][1:])
windows_image['Letter'] = new_letter
# Format and partition disk
result = try_and_print(
@ -369,6 +391,11 @@ def menu_setup():
other_results = other_results,
windows_version = windows_version)
# Copy WinPE log(s)
source = r'{}\Info'.format(global_vars['ClientDir'])
dest = r'W:\{}\Info'.format(KIT_NAME_SHORT)
shutil.copytree(source, dest)
# Print summary
print_standard('\nDone.')
if 'LogFile' in global_vars and ask('\nReview log?'):

27
.bin/Scripts/hw-drive-info Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
#
BLUE='\033[34m'
CLEAR='\033[0m'
# List devices
IFS=$'\n'
for line in $(lsblk -do NAME,TRAN,SIZE,VENDOR,MODEL,SERIAL); do
if [[ "${line:0:4}" == "NAME" ]]; then
echo -e "${BLUE}${line}${CLEAR}"
else
echo "${line}"
fi
done
echo ""
# List partitions
for line in $(lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT); do
if [[ "${line:0:4}" == "NAME" ]]; then
echo -e "${BLUE}${line}${CLEAR}"
else
echo "${line}"
fi
done
echo ""

112
.bin/Scripts/hw-info Executable file
View file

@ -0,0 +1,112 @@
#!/bin/bash
#
# COLORS
CLEAR="\e[0m"
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
function print_in_columns() {
string="$1"
label="$(echo "$string" | sed -r 's/^\s*(.*:).*/\1/')"
value="$(echo "$string" | sed -r 's/^\s*.*:\s*(.*)/\1/')"
printf ' %-18s%s\n' "$label" "$value"
}
function print_dmi_value() {
name="$1"
file="/sys/devices/virtual/dmi/id/$2"
value="UNKNOWN"
if [[ -e "$file" ]]; then
value="$(cat "$file")"
fi
print_in_columns "$name: $value"
}
# System
echo -e "${BLUE}System Information${CLEAR}"
print_dmi_value "Vendor" "sys_vendor"
print_dmi_value "Name" "product_name"
print_dmi_value "Serial" "product_serial"
echo ""
# Motherboard
echo -e "${BLUE}Motherboard${CLEAR}"
print_dmi_value "Vendor" "board_vendor"
print_dmi_value "Name" "board_name"
print_dmi_value "Version" "board_version"
print_dmi_value "Serial" "board_serial"
echo ""
# BIOS
echo -e "${BLUE}BIOS${CLEAR}"
print_dmi_value "Vendor" "bios_vendor"
print_dmi_value "Version" "bios_version"
print_dmi_value "Release Date" "bios_date"
echo ""
# Processor
echo -e "${BLUE}Processor${CLEAR}"
lscpu | grep -E '^(Arch|CPU.s.|Core|Thread|Model name|Virt)' \
| sed -r 's/\(s\)(.*:)/s\1 /' \
| sed -r 's/CPUs: /Threads:/' \
| sed -r 's/^(.*:) / \1/'
echo ""
# Memory
echo -e "${BLUE}Memory${CLEAR}"
first_device="True"
while read -r line; do
if [[ "$line" == "Memory Device" ]]; then
if [[ "$first_device" == "True" ]]; then
first_device="False"
else
# Add space between devices
echo ""
fi
else
print_in_columns "$line"
fi
done <<< $(sudo dmidecode -t memory \
| grep -E '^(Memory Device|\s+(Type|Size|Speed|Manuf.*|Locator|Part Number):)')
echo ""
# Graphics
echo -e "${BLUE}Graphics${CLEAR}"
lspci | grep 'VGA' | sed -r 's/^.*:/ Device: /' \
| sed 's/Intel Corporation/Intel/' \
| sed 's/Generation Core Processor Family/Gen/' \
| sed 's/Integrated Graphics Controller.*/iGPU/'
glxinfo 2>/dev/null | grep 'OpenGL renderer' | sed -r 's/^.*:/ OpenGL Renderer: /' \
| sed 's/Mesa DRI //'
echo ""
# Audio
echo -e "${BLUE}Audio${CLEAR}"
while read -r line; do
if [[ "$line" =~ .*no.soundcards.found.* ]]; then
echo " No soundcards found"
else
print_in_columns "$line"
fi
done <<< $(aplay -l 2>&1 | grep -Ei '(^card|no soundcards found)' | sed -r 's/.*\[(.*)\].*\[(.*)\].*/\1: \2/')
echo ""
# Network
echo -e "${BLUE}Network${CLEAR}"
lspci | grep -Ei '(ethernet|network|wireless|wifi)' \
| sed -r 's/.*: (.*)$/ \1/'
echo ""
# Drives
echo -e "${BLUE}Drives${CLEAR}"
hw-drive-info | sed 's/^/ /'
echo ""
# Sensors
echo -e "${BLUE}Sensors${CLEAR}"
hw-sensors | sed 's/^/ /'
echo ""

View file

@ -19,6 +19,7 @@ if __name__ == '__main__':
other_results = {
'Error': {
'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found',
},
'Warning': {
'GenericRepair': 'Repaired',
@ -36,12 +37,14 @@ if __name__ == '__main__':
print_info('Installing Programs')
if answer_adobe_reader:
install_adobe_reader()
try_and_print(message='Adobe Reader DC...',
function=install_adobe_reader, other_results=other_results)
if answer_vcr:
install_vcredists()
if answer_ninite:
try_and_print(message='Ninite bundle...',
function=install_ninite_bundle, cs='Started', mse=answer_mse)
function=install_ninite_bundle, cs='Started',
mse=answer_mse, other_results=other_results)
if answer_extensions:
wait_for_process('ninite.exe')
print_info('Installing Extensions')
@ -51,7 +54,8 @@ if __name__ == '__main__':
try_and_print(message='Google Chrome extensions...',
function=install_chrome_extensions)
try_and_print(message='Mozilla Firefox extensions...',
function=install_firefox_extensions)
function=install_firefox_extensions,
other_results=other_results)
print_standard('\nDone.')
exit_script()
except SystemExit:

View file

@ -22,14 +22,14 @@ if __name__ == '__main__':
# Print report
print_info('\nResults')
for line in report:
show_data(indent=4, width=16, **line[-1])
for vol_name, vol_data in sorted(report.items()):
show_data(indent=4, width=20, **vol_data['show_data'])
# Done
print_standard('\nDone.')
if 'gui' in sys.argv:
pause("Press Enter to exit...")
popen_program(['nohup', 'thunar', '/media'])
popen_program(['nohup', 'thunar', '/media'], pipe=True)
exit_script()
except SystemExit:
pass

View file

@ -3,13 +3,10 @@
import os
import sys
# STATIC VARIABLES
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
# Init
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
from functions.common import *
from functions.safemode import *
init_global_vars()
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
@ -17,26 +14,23 @@ if __name__ == '__main__':
try:
clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {'CalledProcessError': 'Unknown Error'},
'Warning': {}}
if not ask('Enable booting to SafeMode (with Networking)?'):
abort()
# Edit BCD to set safeboot as default
cmd = ['bcdedit', '/set', '{default}', 'safeboot', 'network']
run_program(cmd, check=False)
# Enable MSI access under safemode
cmd = ['reg', 'add', REG_MSISERVER, '/f']
run_program(cmd, check=False)
cmd = ['reg', 'add', REG_MSISERVER, '/ve',
'/t', 'REG_SZ', '/d', 'Service', '/f']
run_program(cmd, check=False)
## Done ##
pause('Press Enter to reboot...')
cmd = ['shutdown', '-r', '-t', '3']
run_program(cmd, check=False)
# Configure SafeMode
try_and_print(message='Set BCD option...',
function=enable_safemode, other_results=other_results)
try_and_print(message='Enable MSI in SafeMode...',
function=enable_safemode_msi, other_results=other_results)
# Done
print_standard('\nDone.')
pause('Press Enter to reboot...')
reboot()
exit_script()
except SystemExit:
pass

View file

@ -3,13 +3,10 @@
import os
import sys
# STATIC VARIABLES
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
# Init
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
from functions.common import *
from functions.safemode import *
init_global_vars()
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
@ -17,24 +14,23 @@ if __name__ == '__main__':
try:
clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {'CalledProcessError': 'Unknown Error'},
'Warning': {}}
if not ask('Disable booting to SafeMode?'):
abort()
# Edit BCD to remove safeboot value
for boot in ['{current}', '{default}']:
cmd = ['bcdedit', '/deletevalue', boot, 'safeboot']
run_program(cmd, check=False)
# Disable MSI access under safemode
cmd = ['reg', 'delete', REG_MSISERVER, '/f']
run_program(cmd, check=False)
## Done ##
pause('Press Enter to reboot...')
cmd = ['shutdown', '-r', '-t', '3']
run_program(cmd, check=False)
# Configure SafeMode
try_and_print(message='Remove BCD option...',
function=disable_safemode, other_results=other_results)
try_and_print(message='Disable MSI in SafeMode...',
function=disable_safemode_msi, other_results=other_results)
# Done
print_standard('\nDone.')
pause('Press Enter to reboot...')
reboot()
exit_script()
except SystemExit:
pass

View file

@ -8,18 +8,6 @@ LAUNCHERS = {
'L_ITEM': 'activate.py',
'L_ELEV': 'True',
},
'Enter SafeMode': {
'L_TYPE': 'PyScript',
'L_PATH': 'Scripts',
'L_ITEM': 'safemode_enter.py',
'L_ELEV': 'True',
},
'Exit SafeMode': {
'L_TYPE': 'PyScript',
'L_PATH': 'Scripts',
'L_ITEM': 'safemode_exit.py',
'L_ELEV': 'True',
},
'System Checklist': {
'L_TYPE': 'PyScript',
'L_PATH': 'Scripts',
@ -294,8 +282,8 @@ LAUNCHERS = {
'Intel RST (Current Release)': {
'L_TYPE': 'Executable',
'L_PATH': '_Drivers\Intel RST',
'L_ITEM': 'SetupRST_15.9.exe',
'L_7ZIP': 'SetupRST_15.9.exe',
'L_ITEM': 'SetupRST_16.0.exe',
'L_7ZIP': 'SetupRST_16.0.exe',
},
'Intel RST (Previous Releases)': {
'L_TYPE': 'Folder',
@ -458,6 +446,12 @@ LAUNCHERS = {
'L_PATH': 'ConEmu',
'L_ITEM': 'ConEmu.exe',
},
'Enter SafeMode': {
'L_TYPE': 'PyScript',
'L_PATH': 'Scripts',
'L_ITEM': 'safemode_enter.py',
'L_ELEV': 'True',
},
'Everything': {
'L_TYPE': 'Executable',
'L_PATH': 'Everything',
@ -465,6 +459,12 @@ LAUNCHERS = {
'L_ARGS': '-nodb',
'L_ELEV': 'True',
},
'Exit SafeMode': {
'L_TYPE': 'PyScript',
'L_PATH': 'Scripts',
'L_ITEM': 'safemode_exit.py',
'L_ELEV': 'True',
},
'Notepad++': {
'L_TYPE': 'Executable',
'L_PATH': 'notepadplusplus',

View file

@ -2,6 +2,7 @@
# Features
ENABLED_UPLOAD_DATA = False
ENABLED_TICKET_NUMBERS = False
# STATIC VARIABLES (also used by BASH and BATCH files)
## NOTE: There are no spaces around the = for easier parsing in BASH and BATCH

View file

@ -2,7 +2,7 @@
SOURCE_URLS = {
'AIDA64': 'http://download.aida64.com/aida64engineer597.zip',
'Adobe Reader DC': 'http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1801120035/AcroRdrDC1801120035_en_US.exe',
'Adobe Reader DC': 'http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1801120040/AcroRdrDC1801120040_en_US.exe',
'AdwCleaner': 'https://toolslib.net/downloads/finish/1-adwcleaner/',
'Autoruns': 'https://download.sysinternals.com/files/Autoruns.zip',
'BleachBit': 'https://download.bleachbit.org/BleachBit-2.0-portable.zip',
@ -16,7 +16,7 @@ SOURCE_URLS = {
'Everything64': 'https://www.voidtools.com/Everything-1.4.1.895.x64.zip',
'FastCopy32': 'http://ftp.vector.co.jp/69/93/2323/FastCopy341.zip',
'FastCopy64': 'http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip',
'Firefox uBO': 'https://addons.cdn.mozilla.net/user-media/addons/607454/ublock_origin-1.15.10-an+fx.xpi?filehash=sha256%3A30b258803fd6cd988c5ba479f2f6ff5b4e9b40110c81e3421a6867b20ec718a6',
'Firefox uBO': 'https://addons.mozilla.org/firefox/downloads/file/956394/ublock_origin-1.16.6-an+fx.xpi',
'HWiNFO': 'http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip',
'HitmanPro32': 'https://dl.surfright.nl/HitmanPro.exe',
'HitmanPro64': 'https://dl.surfright.nl/HitmanPro_x64.exe',
@ -25,7 +25,7 @@ SOURCE_URLS = {
'KVRT': 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe',
'NotepadPlusPlus': 'https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z',
'Office Deployment Tool 2013': 'https://download.microsoft.com/download/6/2/3/6230F7A2-D8A9-478B-AC5C-57091B632FCF/officedeploymenttool_x86_4827-1000.exe',
'Office Deployment Tool 2016': 'https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_8529.3600.exe',
'Office Deployment Tool 2016': 'https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_9326.3600.exe',
'ProduKey32': 'http://www.nirsoft.net/utils/produkey.zip',
'ProduKey64': 'http://www.nirsoft.net/utils/produkey-x64.zip',
'PuTTY': 'https://the.earth.li/~sgtatham/putty/latest/w32/putty.zip',
@ -176,7 +176,7 @@ NINITE_SOURCES = {
'Launchy.exe': 'launchy',
'RealVNC.exe': 'realvnc',
'Revo Uninstaller.exe': 'revo',
'TeamViewer 12.exe': 'teamviewer12',
'TeamViewer 13.exe': 'teamviewer13',
'TeraCopy.exe': 'teracopy',
'WinDirStat.exe': 'windirstat',
},
@ -196,6 +196,7 @@ RST_SOURCES = {
'SetupRST_14.8.exe': 'https://downloadmirror.intel.com/26759/eng/setuprst.exe',
'SetupRST_15.8.exe': 'https://downloadmirror.intel.com/27442/eng/SetupRST.exe',
'SetupRST_15.9.exe': 'https://downloadmirror.intel.com/27400/eng/SetupRST.exe',
'SetupRST_16.0.exe': 'https://downloadmirror.intel.com/27681/eng/SetupRST.exe',
}

View file

@ -0,0 +1,155 @@
# Wizard Kit: Settings - Windows Builds
WINDOWS_BUILDS = {
# Build Version Release Codename Marketing Name Notes
'6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'),
'6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'),
'6001': ( 'Vista', 'SP1', 'Longhorn', None, 'unsupported'),
'6002': ( 'Vista', 'SP2', 'Longhorn', None, 'unsupported'),
'7600': ( '7', 'RTM', 'Vienna', None, 'unsupported'),
'7601': ( '7', 'SP1', 'Vienna', None, 'outdated'),
#9199 is a fake build since Win 8 is 6.2.9200 but that collides with Win 8.1 (6.3.9200)
'9199': ( '8', 'RTM', None, None, 'unsupported'),
'9200': ( '8.1', None, 'Blue', None, 'outdated'),
'9600': ( '8.1', None, 'Update', None, None),
'9841': ( '10', None, 'Threshold 1', None, 'preview build'),
'9860': ( '10', None, 'Threshold 1', None, 'preview build'),
'9879': ( '10', None, 'Threshold 1', None, 'preview build'),
'9926': ( '10', None, 'Threshold 1', None, 'preview build'),
'10041': ( '10', None, 'Threshold 1', None, 'preview build'),
'10049': ( '10', None, 'Threshold 1', None, 'preview build'),
'10061': ( '10', None, 'Threshold 1', None, 'preview build'),
'10074': ( '10', None, 'Threshold 1', None, 'preview build'),
'10122': ( '10', None, 'Threshold 1', None, 'preview build'),
'10130': ( '10', None, 'Threshold 1', None, 'preview build'),
'10158': ( '10', None, 'Threshold 1', None, 'preview build'),
'10159': ( '10', None, 'Threshold 1', None, 'preview build'),
'10162': ( '10', None, 'Threshold 1', None, 'preview build'),
'10166': ( '10', None, 'Threshold 1', None, 'preview build'),
'10240': ( '10', 'v1507', 'Threshold 1', None, 'unsupported'),
'10525': ( '10', None, 'Threshold 2', None, 'preview build'),
'10532': ( '10', None, 'Threshold 2', None, 'preview build'),
'10547': ( '10', None, 'Threshold 2', None, 'preview build'),
'10565': ( '10', None, 'Threshold 2', None, 'preview build'),
'10576': ( '10', None, 'Threshold 2', None, 'preview build'),
'10586': ( '10', 'v1511', 'Threshold 2', 'November Update', 'unsupported'),
'11082': ( '10', None, 'Redstone 1', None, 'preview build'),
'11099': ( '10', None, 'Redstone 1', None, 'preview build'),
'11102': ( '10', None, 'Redstone 1', None, 'preview build'),
'14251': ( '10', None, 'Redstone 1', None, 'preview build'),
'14257': ( '10', None, 'Redstone 1', None, 'preview build'),
'14271': ( '10', None, 'Redstone 1', None, 'preview build'),
'14279': ( '10', None, 'Redstone 1', None, 'preview build'),
'14291': ( '10', None, 'Redstone 1', None, 'preview build'),
'14295': ( '10', None, 'Redstone 1', None, 'preview build'),
'14316': ( '10', None, 'Redstone 1', None, 'preview build'),
'14328': ( '10', None, 'Redstone 1', None, 'preview build'),
'14332': ( '10', None, 'Redstone 1', None, 'preview build'),
'14342': ( '10', None, 'Redstone 1', None, 'preview build'),
'14352': ( '10', None, 'Redstone 1', None, 'preview build'),
'14361': ( '10', None, 'Redstone 1', None, 'preview build'),
'14366': ( '10', None, 'Redstone 1', None, 'preview build'),
'14367': ( '10', None, 'Redstone 1', None, 'preview build'),
'14371': ( '10', None, 'Redstone 1', None, 'preview build'),
'14372': ( '10', None, 'Redstone 1', None, 'preview build'),
'14376': ( '10', None, 'Redstone 1', None, 'preview build'),
'14379': ( '10', None, 'Redstone 1', None, 'preview build'),
'14383': ( '10', None, 'Redstone 1', None, 'preview build'),
'14385': ( '10', None, 'Redstone 1', None, 'preview build'),
'14388': ( '10', None, 'Redstone 1', None, 'preview build'),
'14390': ( '10', None, 'Redstone 1', None, 'preview build'),
'14393': ( '10', 'v1607', 'Redstone 1', 'Anniversary Update', 'unsupported'),
'14901': ( '10', None, 'Redstone 2', None, 'preview build'),
'14905': ( '10', None, 'Redstone 2', None, 'preview build'),
'14915': ( '10', None, 'Redstone 2', None, 'preview build'),
'14926': ( '10', None, 'Redstone 2', None, 'preview build'),
'14931': ( '10', None, 'Redstone 2', None, 'preview build'),
'14936': ( '10', None, 'Redstone 2', None, 'preview build'),
'14942': ( '10', None, 'Redstone 2', None, 'preview build'),
'14946': ( '10', None, 'Redstone 2', None, 'preview build'),
'14951': ( '10', None, 'Redstone 2', None, 'preview build'),
'14955': ( '10', None, 'Redstone 2', None, 'preview build'),
'14959': ( '10', None, 'Redstone 2', None, 'preview build'),
'14965': ( '10', None, 'Redstone 2', None, 'preview build'),
'14971': ( '10', None, 'Redstone 2', None, 'preview build'),
'14986': ( '10', None, 'Redstone 2', None, 'preview build'),
'15002': ( '10', None, 'Redstone 2', None, 'preview build'),
'15007': ( '10', None, 'Redstone 2', None, 'preview build'),
'15014': ( '10', None, 'Redstone 2', None, 'preview build'),
'15019': ( '10', None, 'Redstone 2', None, 'preview build'),
'15025': ( '10', None, 'Redstone 2', None, 'preview build'),
'15031': ( '10', None, 'Redstone 2', None, 'preview build'),
'15042': ( '10', None, 'Redstone 2', None, 'preview build'),
'15046': ( '10', None, 'Redstone 2', None, 'preview build'),
'15048': ( '10', None, 'Redstone 2', None, 'preview build'),
'15055': ( '10', None, 'Redstone 2', None, 'preview build'),
'15058': ( '10', None, 'Redstone 2', None, 'preview build'),
'15060': ( '10', None, 'Redstone 2', None, 'preview build'),
'15061': ( '10', None, 'Redstone 2', None, 'preview build'),
'15063': ( '10', 'v1703', 'Redstone 2', 'Creators Update', 'outdated'),
'16170': ( '10', None, 'Redstone 3', None, 'preview build'),
'16176': ( '10', None, 'Redstone 3', None, 'preview build'),
'16179': ( '10', None, 'Redstone 3', None, 'preview build'),
'16184': ( '10', None, 'Redstone 3', None, 'preview build'),
'16188': ( '10', None, 'Redstone 3', None, 'preview build'),
'16193': ( '10', None, 'Redstone 3', None, 'preview build'),
'16199': ( '10', None, 'Redstone 3', None, 'preview build'),
'16212': ( '10', None, 'Redstone 3', None, 'preview build'),
'16215': ( '10', None, 'Redstone 3', None, 'preview build'),
'16226': ( '10', None, 'Redstone 3', None, 'preview build'),
'16232': ( '10', None, 'Redstone 3', None, 'preview build'),
'16237': ( '10', None, 'Redstone 3', None, 'preview build'),
'16241': ( '10', None, 'Redstone 3', None, 'preview build'),
'16251': ( '10', None, 'Redstone 3', None, 'preview build'),
'16257': ( '10', None, 'Redstone 3', None, 'preview build'),
'16273': ( '10', None, 'Redstone 3', None, 'preview build'),
'16275': ( '10', None, 'Redstone 3', None, 'preview build'),
'16278': ( '10', None, 'Redstone 3', None, 'preview build'),
'16281': ( '10', None, 'Redstone 3', None, 'preview build'),
'16288': ( '10', None, 'Redstone 3', None, 'preview build'),
'16291': ( '10', None, 'Redstone 3', None, 'preview build'),
'16294': ( '10', None, 'Redstone 3', None, 'preview build'),
'16296': ( '10', None, 'Redstone 3', None, 'preview build'),
'16299': ( '10', 'v1709', 'Redstone 3', 'Fall Creators Update', 'outdated'),
'16353': ( '10', None, 'Redstone 4', None, 'preview build'),
'16362': ( '10', None, 'Redstone 4', None, 'preview build'),
'17004': ( '10', None, 'Redstone 4', None, 'preview build'),
'17017': ( '10', None, 'Redstone 4', None, 'preview build'),
'17025': ( '10', None, 'Redstone 4', None, 'preview build'),
'17035': ( '10', None, 'Redstone 4', None, 'preview build'),
'17040': ( '10', None, 'Redstone 4', None, 'preview build'),
'17046': ( '10', None, 'Redstone 4', None, 'preview build'),
'17063': ( '10', None, 'Redstone 4', None, 'preview build'),
'17074': ( '10', None, 'Redstone 4', None, 'preview build'),
'17083': ( '10', None, 'Redstone 4', None, 'preview build'),
'17093': ( '10', None, 'Redstone 4', None, 'preview build'),
'17101': ( '10', None, 'Redstone 4', None, 'preview build'),
'17107': ( '10', None, 'Redstone 4', None, 'preview build'),
'17110': ( '10', None, 'Redstone 4', None, 'preview build'),
'17112': ( '10', None, 'Redstone 4', None, 'preview build'),
'17115': ( '10', None, 'Redstone 4', None, 'preview build'),
'17120': ( '10', None, 'Redstone 4', None, 'preview build'),
'17123': ( '10', None, 'Redstone 4', None, 'preview build'),
'17127': ( '10', None, 'Redstone 4', None, 'preview build'),
'17128': ( '10', None, 'Redstone 4', None, 'preview build'),
'17133': ( '10', None, 'Redstone 4', None, 'preview build'),
'17134': ( '10', 'v1803', 'Redstone 4', 'April 2018 Update', None),
'17604': ( '10', None, 'Redstone 5', None, 'preview build'),
'17618': ( '10', None, 'Redstone 5', None, 'preview build'),
'17623': ( '10', None, 'Redstone 5', None, 'preview build'),
'17627': ( '10', None, 'Redstone 5', None, 'preview build'),
'17634': ( '10', None, 'Redstone 5', None, 'preview build'),
'17639': ( '10', None, 'Redstone 5', None, 'preview build'),
'17643': ( '10', None, 'Redstone 5', None, 'preview build'),
'17650': ( '10', None, 'Redstone 5', None, 'preview build'),
'17655': ( '10', None, 'Redstone 5', None, 'preview build'),
'17661': ( '10', None, 'Redstone 5', None, 'preview build'),
'17666': ( '10', None, 'Redstone 5', None, 'preview build'),
}
if __name__ == '__main__':
print("This file is not meant to be called directly.")

View file

@ -26,10 +26,12 @@ if __name__ == '__main__':
'Error': {
'CalledProcessError': 'Unknown Error',
'BIOSKeyNotFoundError': 'BIOS key not found',
'FileNotFoundError': 'File not found',
},
'Warning': {}}
print_info('Starting System Checklist for Ticket #{}\n'.format(
ticket_number))
if ENABLED_TICKET_NUMBERS:
print_info('Starting System Checklist for Ticket #{}\n'.format(
ticket_number))
# Configure
print_info('Configure')
@ -44,20 +46,20 @@ if __name__ == '__main__':
try_and_print(message='Desktop...',
function=cleanup_desktop, cs='Done')
try_and_print(message='AdwCleaner...',
function=cleanup_adwcleaner, cs='Done')
function=cleanup_adwcleaner, cs='Done', other_results=other_results)
# Export system info
print_info('Backup System Information')
try_and_print(message='AIDA64 reports...',
function=run_aida64, cs='Done')
function=run_aida64, cs='Done', other_results=other_results)
try_and_print(message='File listing...',
function=backup_file_list, cs='Done')
function=backup_file_list, cs='Done', other_results=other_results)
try_and_print(message='Power plans...',
function=backup_power_plans, cs='Done')
try_and_print(message='Product Keys...',
try_and_print(message='Product Keys...', other_results=other_results,
function=run_produkey, cs='Done')
try_and_print(message='Registry...',
function=backup_registry, cs='Done')
function=backup_registry, cs='Done', other_results=other_results)
# User data
print_info('User Data')
@ -70,24 +72,33 @@ if __name__ == '__main__':
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')):
and global_vars['OS']['Version'] in ('8', '8.1', '10')):
try_and_print(message='BIOS Activation:',
function=activate_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)
show_free_space()
try_and_print(message='Installed Antivirus:',
function=get_installed_antivirus, ns='Unknown',
other_results=other_results, print_return=True)
try_and_print(message='Installed Office:',
function=get_installed_office, ns='Unknown',
other_results=other_results, print_return=True)
# Play audio, show devices, open Windows updates, and open Activation
popen_program(['mmc', 'devmgmt.msc'])
run_hwinfo_sensors()
popen_program(['control', '/name', 'Microsoft.WindowsUpdate'])
try_and_print(message='Opening Device Manager...',
function=open_device_manager, cs='Started')
try_and_print(message='Opening HWiNFO (Sensors)...',
function=run_hwinfo_sensors, cs='Started', other_results=other_results)
try_and_print(message='Opening Windows Updates...',
function=open_windows_updates, cs='Started')
if not windows_is_activated():
popen_program('slui')
try_and_print(message='Opening Windows Activation...',
function=open_windows_activation, cs='Started')
sleep(3)
run_xmplay()
try_and_print(message='Running XMPlay...',
function=run_xmplay, cs='Started', other_results=other_results)
# Done
print_standard('\nDone.')

View file

@ -25,22 +25,24 @@ if __name__ == '__main__':
other_results = {
'Error': {
'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found',
},
'Warning': {
'GenericRepair': 'Repaired',
'UnsupportedOSError': 'Unsupported OS',
}}
print_info('Starting System Diagnostics for Ticket #{}\n'.format(
ticket_number))
if ENABLED_TICKET_NUMBERS:
print_info('Starting System Diagnostics for Ticket #{}\n'.format(
ticket_number))
# 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')
function=run_rkill, cs='Done', other_results=other_results)
try_and_print(message='Running TDSSKiller...',
function=run_tdsskiller, cs='Done')
function=run_tdsskiller, cs='Done', other_results=other_results)
# Re-run if earlier process was stopped.
stay_awake()
@ -49,9 +51,9 @@ if __name__ == '__main__':
print_info('Starting Background Scans')
check_connection()
try_and_print(message='Running HitmanPro...',
function=run_hitmanpro, cs='Started')
function=run_hitmanpro, cs='Started', other_results=other_results)
try_and_print(message='Running Autoruns...',
function=run_autoruns, cs='Started')
function=run_autoruns, cs='Started', other_results=other_results)
# OS Health Checks
print_info('OS Health Checks')
@ -70,34 +72,38 @@ if __name__ == '__main__':
# Export system info
print_info('Backup System Information')
try_and_print(message='AIDA64 reports...',
function=run_aida64, cs='Done')
function=run_aida64, cs='Done', other_results=other_results)
try_and_print(message='BleachBit report...',
function=run_bleachbit, cs='Done')
function=run_bleachbit, cs='Done', other_results=other_results)
backup_browsers()
try_and_print(message='File listing...',
function=backup_file_list, cs='Done')
function=backup_file_list, cs='Done', other_results=other_results)
try_and_print(message='Power plans...',
function=backup_power_plans, cs='Done')
try_and_print(message='Product Keys...',
function=run_produkey, cs='Done')
function=run_produkey, cs='Done', other_results=other_results)
try_and_print(message='Registry...',
function=backup_registry, cs='Done')
function=backup_registry, cs='Done', other_results=other_results)
# 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='',
try_and_print(message='Activation:',
function=show_os_activation, ns='Unknown', silent_function=False)
try_and_print(message='Installed RAM:',
function=show_installed_ram, ns='Unknown', silent_function=False)
show_free_space()
try_and_print(message='Temp Size:',
function=show_temp_files_size, silent_function=False)
try_and_print(message='Installed Antivirus:',
function=get_installed_antivirus, ns='Unknown',
other_results=other_results, print_return=True)
try_and_print(message='Installed Office:',
function=get_installed_office, ns='Unknown',
other_results=other_results, print_return=True)
try_and_print(message='Product Keys:',
function=get_product_keys, ns='Unknown', print_return=True)
# User data
print_info('User Data')

View file

@ -18,17 +18,29 @@ if __name__ == '__main__':
stay_awake()
clear_screen()
print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL))
# Get backup name prefix
ticket_number = get_ticket_number()
if ENABLED_TICKET_NUMBERS:
backup_prefix = ticket_number
else:
backup_prefix = get_simple_string(prompt='Enter backup name prefix')
backup_prefix = backup_prefix.replace(' ', '_')
# Set destination
folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT)
dest = select_destination(folder_path=folder_path,
prompt='Which disk are we transferring to?')
source = select_source(ticket_number)
# Set source items
source = select_source(backup_prefix)
items = scan_source(source, dest)
# Transfer
clear_screen()
print_info('Transfer Details:\n')
show_data('Ticket:', ticket_number)
if ENABLED_TICKET_NUMBERS:
show_data('Ticket:', ticket_number)
show_data('Source:', source.path)
show_data('Destination:', dest)
@ -43,7 +55,8 @@ if __name__ == '__main__':
umount_backup_shares()
# Done
run_kvrt()
try_and_print(message='Running KVRT...',
function=run_kvrt, cs='Started')
print_standard('\nDone.')
pause("Press Enter to exit...")
exit_script()

View file

@ -21,4 +21,4 @@
-uplimit:1
-connections:0
-expertmode -norestorepnt -showdrpnames2 -onlyupdates -preservecfg
-expertmode -norestorepnt -showdrpnames2 -onlyupdates -preservecfg -novirusalerts

View file

@ -7,7 +7,8 @@ alias 7z9='7z a -t7z -mx=9'
alias diff='colordiff -ur'
alias du='du -sch --apparent-size'
alias fix-perms='find -type d -exec chmod 755 "{}" \; && find -type f -exec chmod 644 "{}" \;'
alias hw-info='sudo inxi -ACDdGlMmNopRsxxc 25'
alias hw-info='sudo hw-info | less -S'
alias inxi='echo -e "\e[33mWARNING: inxi is being replaced and will be removed in a future WizardKit release\e[0m"; echo -e " \e[32mReplacements include:\e[0m 'hw-drive-info', 'hw-info', & 'hw-sensors'"; echo ""; inxi'
alias less='less -S'
alias ls='ls --color=auto'
alias mkdir='mkdir -p'

View file

@ -1,25 +1,27 @@
[Added Associations]
application/pdf=mupdf.desktop;
application/pdf=evince.desktop;
application/vnd.adobe.flash.movie=mpv.desktop;
application/vnd.ms-asf=mpv.desktop;
application/x-desktop=leafpad.desktop;
audio/flac=mpv.desktop;
audio/mp4=mpv.desktop;
audio/mpeg=mpv.desktop;
audio/x-vorbis+ogg=mpv.desktop;
image/bmp=ristretto.desktop;
image/gif=ristretto.desktop;
image/jpeg=ristretto.desktop;
image/png=ristretto.desktop;
image/vnd.microsoft.icon=ristretto.desktop;
image/bmp=gpicview.desktop;
image/gif=gpicview.desktop;
image/jpeg=gpicview.desktop;
image/png=gpicview.desktop;
image/vnd.microsoft.icon=gpicview.desktop;
inode/directory=exo-file-manager.desktop
text/plain=mousepad.desktop;
text/plain=leafpad.desktop;
text/x-log=leafpad.desktop;
video/mp4=mpv.desktop;
video/mpeg=mpv.desktop;
video/quicktime=mpv.desktop;
video/x-flv=mpv.desktop;
video/x-matroska=mpv.desktop;
video/x-msvideo=mpv.desktop;
video/x-ms-wmv=mpv.desktop;
video/x-msvideo=mpv.desktop;
x-scheme-handler/http=exo-web-browser.desktop
x-scheme-handler/https=exo-web-browser.desktop
x-scheme-handler/trash=exo-file-manager.desktop

View file

@ -6,7 +6,7 @@ xset s off
xset -dpms
eval $(ssh-agent)
export SSH_AUTH_SOCK
compton --backend xrender &
compton --backend xrender --xrender-sync --xrender-sync-fence &
sleep 1s
conky -d
nm-applet &

View file

@ -119,7 +119,7 @@ allowed_media_dirs = /media
# allowed_devices = /dev/*
# WARNING: ALLOWING USERS TO MOUNT DEVICES OUTSIDE OF /dev CAN CAUSE SERIOUS
# SECURITY PROBLEMS. DO NOT ALLOW DEVICES IN /dev/shm
allowed_devices = /dev/*
allowed_devices = /dev/*, /dev/mapper/*
# allowed_internal_devices causes udevil to treat any listed block devices as
@ -133,7 +133,7 @@ allowed_devices = /dev/*
# Some removable esata drives look like internal drives to udevil. To avoid
# this problem, they can be treated as removable with this setting.
# WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS.
allowed_internal_devices = /dev/*
allowed_internal_devices = /dev/*, /dev/mapper/*
# allowed_internal_uuids and allowed_internal_uuids_FSTYPE work similarly to

View file

@ -6,7 +6,6 @@ inxi
mprime
nvme-cli
openbox-patched
papirus-icon-theme
smartmontools-svn
testdisk-wip
ttf-font-awesome-4

View file

@ -1,6 +1,7 @@
aic94xx-firmware
alsa-utils
antiword
arandr
arc-gtk-theme
bash-pipes
bc
@ -12,16 +13,19 @@ cmatrix
colordiff
compton
conky
cpio
curl
dmidecode
dos2unix
dunst
e2fsprogs
evince
feh
ffmpeg
firefox
gnome-keyring
gparted
gpicview-gtk3
gsmartcontrol
hardinfo
hexedit
@ -33,17 +37,18 @@ i3status
inxi
ldns
leafpad
lha
libewf
libinput
linux-firmware
lm_sensors
lzip
mdadm
mediainfo
mesa-demos
mkvtoolnix-cli
mprime
mpv
mupdf
ncdu
network-manager-applet
networkmanager
@ -80,6 +85,8 @@ ttf-inconsolata
udevil
udisks2
ufw
unarj
unrar
unzip
util-linux
veracrypt
@ -89,6 +96,7 @@ virtualbox-guest-utils
volumeicon
wd719x-firmware
wimlib
xarchiver
xf86-input-libinput
xf86-video-amdgpu
xf86-video-fbdev
@ -99,4 +107,5 @@ xorg-xdpyinfo
xorg-xev
xorg-xinit
xorg-xinput
zip
zsh

View file

@ -0,0 +1,20 @@
arch-install-scripts
b43-fwcutter
darkhttpd
gpm
grml-zsh-config
grub
irssi
mc
openvpn
ppp
pptpclient
refind-efi
rp-pppoe
smartmontools
speedtouch
testdisk
vim-minimal
vpnc
wvdial
xl2tpd

View file

@ -189,8 +189,10 @@ function update_live_env() {
echo "127.0.1.1 $hostname.localdomain $hostname" >> "$LIVE_DIR/airootfs/etc/hosts"
# Live packages
sed -i -r 's/^(b43|clonezilla|gpm|grml|refind|testdisk|vim)/#\1/' "$LIVE_DIR/packages.both"
cat "$ROOT_DIR/.linux_items/packages/live" >> "$LIVE_DIR/packages.both"
while read -r p; do
sed -i "/$p/d" "$LIVE_DIR/packages.both"
done < "$ROOT_DIR/.linux_items/packages/live_remove"
cat "$ROOT_DIR/.linux_items/packages/live_add" >> "$LIVE_DIR/packages.both"
echo "[custom]" >> "$LIVE_DIR/pacman.conf"
echo "SigLevel = Optional TrustAll" >> "$LIVE_DIR/pacman.conf"
echo "Server = file://$REPO_DIR" >> "$LIVE_DIR/pacman.conf"