diff --git a/scripts/Launch.cmd b/scripts/Launch.cmd index c6a91980..526ae4b3 100644 --- a/scripts/Launch.cmd +++ b/scripts/Launch.cmd @@ -31,13 +31,12 @@ for %%v in (ARCHIVE_PASSWORD KIT_NAME_FULL OFFICE_SERVER_IP QUICKBOOKS_SERVER_IP rem Set ARCH to 32 as a gross assumption and check for x86_64 status set ARCH=32 if /i "%PROCESSOR_ARCHITECTURE%" == "AMD64" set "ARCH=64" -set "SEVEN_ZIP=%bin%\7-Zip\7za.exe" +set "SEVEN_ZIP=%bin%\7-Zip\7z.exe" set "CON=%bin%\ConEmu\ConEmu.exe" set "FASTCOPY=%bin%\FastCopy\FastCopy.exe" set "POWERSHELL=%systemroot%\system32\WindowsPowerShell\v1.0\powershell.exe" set "PYTHON=%bin%\Python\x32\python.exe" if %ARCH% equ 64 ( - set "SEVEN_ZIP=%bin%\7-Zip\7za64.exe" set "CON=%bin%\ConEmu\ConEmu64.exe" set "FASTCOPY=%bin%\FastCopy\FastCopy64.exe" set "PYTHON=%bin%\Python\x64\python.exe" diff --git a/scripts/wk/kit/build_win.py b/scripts/wk/kit/build_win.py index 689e5ba6..97296458 100644 --- a/scripts/wk/kit/build_win.py +++ b/scripts/wk/kit/build_win.py @@ -47,8 +47,7 @@ REGEX_SDIO_NETWORK_DRIVERS = re.compile( re.IGNORECASE, ) REGEX_TORRENT_INDICES = re.compile(r'^(?P\d+)\|(?P.*)') -SEVEN_ZIP = get_tool_path('7-Zip', '7za') -SEVEN_ZIP_FULL = get_tool_path('7-Zip', '7z', check=False) # TODO: Replace with unrar from Pypi? +SEVEN_ZIP = get_tool_path('7-Zip', '7z') WIDTH = 50 @@ -427,17 +426,13 @@ def download_xmplay_music(): # Extract SNES archives for item in music_tmp.joinpath('SNES').iterdir(): cmd = [ - SEVEN_ZIP_FULL, + SEVEN_ZIP, 'x', item, f'-oSNES\\{item.stem}', '-bso0', '-bse0', '-bsp0', ] run_program(cmd) delete_item(item) - # Remove 7-Zip (Full) from kit - delete_item(SEVEN_ZIP_FULL) - delete_item(SEVEN_ZIP_FULL.with_name('7z.dll')) - # Remove bad songs for game, globs in MUSIC_SNES_BAD.items(): for glob in globs: diff --git a/scripts/wk/kit/tools.py b/scripts/wk/kit/tools.py index da3e69c4..b80cd3bb 100644 --- a/scripts/wk/kit/tools.py +++ b/scripts/wk/kit/tools.py @@ -104,7 +104,7 @@ def extract_archive(archive, out_path, *args, mode='x', silent=True): """Extract an archive to out_path.""" out_path = pathlib.Path(out_path).resolve() out_path.parent.mkdir(parents=True, exist_ok=True) - cmd = [get_tool_path('7-Zip', '7za'), mode, archive, f'-o{out_path}', *args] + cmd = [get_tool_path('7-Zip', '7z'), mode, archive, f'-o{out_path}', *args] if silent: cmd.extend(['-bso0', '-bse0', '-bsp0']) diff --git a/scripts/wk/repairs/win.py b/scripts/wk/repairs/win.py index 478bcb56..bbce546b 100644 --- a/scripts/wk/repairs/win.py +++ b/scripts/wk/repairs/win.py @@ -70,7 +70,7 @@ from wk.std import ( # STATIC VARIABLES LOG = logging.getLogger(__name__) BACKUP_BROWSER_BASE_CMD = ( - get_tool_path('7-Zip', '7za'), + get_tool_path('7-Zip', '7z'), 'a', '-t7z', '-mx=1', '-bso0', '-bse0', '-bsp0', ) CONEMU_EXE = get_tool_path('ConEmu', 'ConEmu', check=False) diff --git a/setup/windows/build.ps1 b/setup/windows/build.ps1 index 5ef7685d..e245356b 100644 --- a/setup/windows/build.ps1 +++ b/setup/windows/build.ps1 @@ -87,7 +87,6 @@ if ($MyInvocation.InvocationName -ne ".") { # 7-Zip DownloadFile -Path $Temp -Name "7z-installer.msi" -Url $Sources.'7-Zip Installer' - DownloadFile -Path $Temp -Name "7z-extra.7z" -Url $Sources.'7-Zip Extra' # ConEmu DownloadFile -Path $Temp -Name "ConEmuPack.7z" -Url $Sources.'ConEmu' @@ -125,24 +124,16 @@ if ($MyInvocation.InvocationName -ne ".") { ## Extract ## # 7-Zip - ## NOTE: 7z.exe & 7z.dll are left for build_kit_windows.py, they'll be removed by it Write-Host "Extracting: 7-Zip" try { $ArgumentList = @("/a", "$Temp\7z-installer.msi", "TARGETDIR=$Temp\7zi", "/qn") Start-Process -FilePath "$System32\msiexec.exe" -ArgumentList $ArgumentList -Wait - $SevenZip = "$Temp\7zi\Files\7-Zip\7z.exe" - $ArgumentList = @( - "x", "$Temp\7z-extra.7z", "-o$Bin\7-Zip", - "-aoa", "-bso0", "-bse0", "-bsp0", - "-x!x64\*.dll", "-x!Far", "-x!*.dll") - Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait - Start-Sleep 1 - Move-Item "$Temp\7zi\Files\7-Zip\7z.exe" "$Bin\7-Zip\7z.exe" + New-Item -Type Directory $Bin\7-Zip 2>&1 | Out-Null Move-Item "$Temp\7zi\Files\7-Zip\7z.dll" "$Bin\7-Zip\7z.dll" - Move-Item "$Bin\7-Zip\x64\7za.exe" "$Bin\7-Zip\7za64.exe" - Remove-Item "$Bin\7-Zip\x64" -Recurse + Move-Item "$Temp\7zi\Files\7-Zip\7z.exe" "$Bin\7-Zip\7z.exe" + Move-Item "$Temp\7zi\Files\7-Zip\License.txt" "$Bin\7-Zip\License.txt" Remove-Item "$Temp\7z*" -Recurse - $SevenZip = "$Bin\7-Zip\7za.exe" + $SevenZip = "$Bin\7-Zip\7z.exe" } catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red"