From 22bde273f2d9ac89520a1072097bcc45c095e83e Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 22:36:39 -0600 Subject: [PATCH 1/6] Add warning that WinPE is under development --- setup/build_pe.cmd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup/build_pe.cmd b/setup/build_pe.cmd index ab3d4da4..44903d91 100644 --- a/setup/build_pe.cmd +++ b/setup/build_pe.cmd @@ -4,8 +4,12 @@ :Init setlocal EnableDelayedExpansion -title WizardKit: Windows PE Build Tool +title WizardKit: Build Tool call :CheckFlags %* +rem TODO: Remove warning +echo "Windows PE build is currently under development" +echo " Proceeding will likely result in errors so be warned" +pause call :CheckElevation || goto Exit call :FindKitsRoot || goto ErrorKitNotFound From c66c39669ccd55ebeabbb6b4bf71b5d9f0a2de9b Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 22:38:04 -0600 Subject: [PATCH 2/6] Fix typo --- scripts/wk/repairs/win.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wk/repairs/win.py b/scripts/wk/repairs/win.py index 586f759a..7387ed02 100644 --- a/scripts/wk/repairs/win.py +++ b/scripts/wk/repairs/win.py @@ -186,7 +186,7 @@ def end_session(): cmd = ['reg', 'delete', fr'HKCU\{AUTO_REPAIR_KEY}', '/f'] run_program(cmd) except CalledProcessError: - LOG.error('Failed to remote Auto Repairs session settings') + LOG.error('Failed to remove Auto Repairs session settings') def get_entry_settings(group, name): From ca45fe800f370c09bf24b05c704a1bd68245d062 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 23:24:04 -0600 Subject: [PATCH 3/6] Remove unused build_additions --- setup/linux/build_additions.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 setup/linux/build_additions.txt diff --git a/setup/linux/build_additions.txt b/setup/linux/build_additions.txt deleted file mode 100644 index 3abfa39b..00000000 --- a/setup/linux/build_additions.txt +++ /dev/null @@ -1,5 +0,0 @@ -rsync -aI "${script_path}/${install_dir}/" "${work_dir}/iso/${install_dir}/" -rm "${work_dir}/iso/EFI" -R -rm "${work_dir}/iso/loader" -R -rsync -aI "${script_path}/EFI/" "${work_dir}/iso/EFI/" - From 5d54b6de4ba9837b19a0b56e11c10d1d894516b4 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 23:55:12 -0600 Subject: [PATCH 4/6] Use correct bit-depth tools when building the kit If you use the 32-bit version of ConEmu and/or? Python on a 64-bit OS then psutil will throw access denied errors when trying to wait for processes. --- setup/windows/build.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup/windows/build.ps1 b/setup/windows/build.ps1 index 11a06069..5ef7685d 100644 --- a/setup/windows/build.ps1 +++ b/setup/windows/build.ps1 @@ -192,6 +192,13 @@ if ($MyInvocation.InvocationName -ne ".") { ## Done ## Pop-Location - $ArgumentList = @("-run", "$Bin\Python\x32\python.exe", "$Bin\Scripts\build_kit_windows.py", "-new_console:n") - Start-Process -FilePath "$Bin\ConEmu\ConEmu.exe" -ArgumentList $ArgumentList -verb RunAs + if ([System.Environment]::Is64BitOperatingSystem) { + $ConEmu = "$Bin\ConEmu\ConEmu64.exe" + $Python = "$Bin\Python\x64\python.exe" + } else { + $ConEmu = "$Bin\ConEmu\ConEmu.exe" + $Python = "$Bin\Python\x32\python.exe" + } + $ArgumentList = @("-run", "$Python", "$Bin\Scripts\build_kit_windows.py", "-new_console:n") + Start-Process -FilePath "$ConEmu" -ArgumentList $ArgumentList -verb RunAs } From 7388d94c5023c3c2f48966708d55784fa598580c Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 23:58:46 -0600 Subject: [PATCH 5/6] Fix bugs --- scripts/wk/kit/build_win.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/wk/kit/build_win.py b/scripts/wk/kit/build_win.py index 2a11ece2..e2fcd441 100644 --- a/scripts/wk/kit/build_win.py +++ b/scripts/wk/kit/build_win.py @@ -277,7 +277,7 @@ def download_openshell(): """Download OpenShell installer and Fluent-Metro skin.""" for name in ('OpenShell.exe', 'Fluent-Metro.zip'): out_path = BIN_DIR.joinpath(f'OpenShell/{name}') - download_file(out_path, SOURCES[name]) + download_file(out_path, SOURCES[name[:-4]]) def download_putty(): @@ -364,6 +364,7 @@ def download_testdisk(): tmp_path = TMP_DIR.joinpath('TestDisk') extract_archive(archive, tmp_path) rename_item(tmp_path.joinpath('testdisk-7.2-WIP'), out_path) + delete_from_temp('TestDisk') delete_from_temp('testdisk_wip.zip') From cc95bbe68b18ae9de4b5475d22db960264a2d8d0 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 14 Oct 2021 23:59:26 -0600 Subject: [PATCH 6/6] Add embedded_python_env.py Allows for faster debugging when using the embedded version of Python. --- scripts/embedded_python_env.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/embedded_python_env.py diff --git a/scripts/embedded_python_env.py b/scripts/embedded_python_env.py new file mode 100644 index 00000000..bfba36bf --- /dev/null +++ b/scripts/embedded_python_env.py @@ -0,0 +1,13 @@ +"""WizardKit: Embedded Python helper. + +This saves the keystrokes needed to fix the path and import wk. To use: +python.exe -i embedded_python_env.py +""" +# vim: sts=2 sw=2 ts=2 + +import os +import sys + +os.chdir(os.path.dirname(os.path.realpath(__file__))) +sys.path.append(os.getcwd()) +import wk # pylint: disable=wrong-import-position