find extractor
This commit is contained in:
parent
b475e7363b
commit
965f8914ac
1 changed files with 17 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||||
|
|
||||||
:: Start as administrator
|
:: Start as administrator
|
||||||
fltmc >NUL 2>&1 || (
|
fltmc >NUL 2>&1 || (
|
||||||
|
@ -8,6 +9,21 @@ fltmc >NUL 2>&1 || (
|
||||||
EXIT 0
|
EXIT 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:: Find .7z extractor
|
||||||
|
SET "7ZIP=%ProgramFiles%\7-Zip\7z.exe"
|
||||||
|
SET "NANAZIP=%LOCALAPPDATA%\Microsoft\WindowsApps\NanaZipC.exe"
|
||||||
|
|
||||||
|
IF EXIST !7ZIP! (
|
||||||
|
SET "extractor=!7ZIP!"
|
||||||
|
)
|
||||||
|
IF NOT DEFINED extractor IF EXIST !NANAZIP! (
|
||||||
|
SET "extractor=!NANAZIP!"
|
||||||
|
)
|
||||||
|
IF NOT DEFINED extractor (
|
||||||
|
ECHO No extractor for 7z files found.
|
||||||
|
EXIT /B 1
|
||||||
|
)
|
||||||
|
|
||||||
ECHO LosslessCut...
|
ECHO LosslessCut...
|
||||||
PowerShell -Command "" ^
|
PowerShell -Command "" ^
|
||||||
"$archive = 'LosslessCut-win-x64.7z';" ^
|
"$archive = 'LosslessCut-win-x64.7z';" ^
|
||||||
|
@ -15,7 +31,7 @@ PowerShell -Command "" ^
|
||||||
"$outfile = Join-Path -Path $env:TEMP -ChildPath $archive;" ^
|
"$outfile = Join-Path -Path $env:TEMP -ChildPath $archive;" ^
|
||||||
"Invoke-WebRequest -Uri $link -OutFile $outfile;" ^
|
"Invoke-WebRequest -Uri $link -OutFile $outfile;" ^
|
||||||
"cd $env:TEMP;" ^
|
"cd $env:TEMP;" ^
|
||||||
"& $env:ProgramFiles\7-Zip\7z.exe x $archive -o'%ProgramFiles%\LosslessCut' -y;" ^
|
"& !extractor! x $archive -o'%ProgramFiles%\LosslessCut' -y;" ^
|
||||||
"$WshShell = New-Object -comObject WScript.Shell;" ^
|
"$WshShell = New-Object -comObject WScript.Shell;" ^
|
||||||
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\LosslessCut.lnk');" ^
|
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\LosslessCut.lnk');" ^
|
||||||
"$Shortcut.TargetPath = '%ProgramFiles%\LosslessCut\LosslessCut.exe';" ^
|
"$Shortcut.TargetPath = '%ProgramFiles%\LosslessCut\LosslessCut.exe';" ^
|
||||||
|
|
Loading…
Reference in a new issue