use delayedexpansion
This commit is contained in:
parent
6bed72ad60
commit
d11d47a068
2 changed files with 16 additions and 14 deletions
|
@ -1,4 +1,5 @@
|
|||
@ECHO off
|
||||
@ECHO OFF
|
||||
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||
|
||||
IF NOT EXIST .\hazedumper.exe (
|
||||
ECHO Download latest release of hazedumper
|
||||
|
@ -14,16 +15,16 @@ IF NOT EXIST .\hazedumper.exe (
|
|||
|
||||
:: Unzip the file
|
||||
PowerShell -NoLogo -NoProfile -Command "& { $shell = New-Object -COM" ^
|
||||
"Shell.Application; $target = $shell.NameSpace('%CD%'); $zip =" ^
|
||||
"$shell.NameSpace('%CD%\%dir%.zip'); $target.CopyHere($zip.Items(), 16); }" ^
|
||||
"%dir%"
|
||||
"Shell.Application; $target = $shell.NameSpace('%CD%'); $zip =" ^
|
||||
"$shell.NameSpace('%CD%\!dir!.zip'); $target.CopyHere($zip.Items()," ^
|
||||
"16); }" "!dir!"
|
||||
|
||||
:: Move the binary to the current directory
|
||||
MOVE .\%dir%\*.exe .\
|
||||
MOVE .\!dir!\*.exe .\
|
||||
|
||||
:: Delete unnecessary file and directory
|
||||
DEL %dir%.zip
|
||||
RMDIR %dir%\
|
||||
DEL !dir!.zip
|
||||
RMDIR !dir!\
|
||||
)
|
||||
|
||||
IF NOT EXIST .\config.json (
|
||||
|
|
15
run.bat
15
run.bat
|
@ -1,11 +1,12 @@
|
|||
@ECHO off
|
||||
@ECHO OFF
|
||||
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||
|
||||
:: Variables
|
||||
SET "pipR=pip install -r .\requirements.txt"
|
||||
SET "py=python.exe"
|
||||
|
||||
:: Check python installation
|
||||
%py% --version > NUL
|
||||
!py! --version > NUL
|
||||
|
||||
:: Clean potential error or python version
|
||||
CLS
|
||||
|
@ -19,19 +20,19 @@ IF ERRORLEVEL 1 (
|
|||
ECHO Download and installation of dependencies...
|
||||
|
||||
:: Location of Python
|
||||
SET "py=%LOCALAPPDATA%\Microsoft\WindowsApps\%py%"
|
||||
SET "py=%LOCALAPPDATA%\Microsoft\WindowsApps\!py!"
|
||||
|
||||
:: Update pip
|
||||
%py% -m pip install --upgrade pip
|
||||
!py! -m pip install --upgrade pip
|
||||
|
||||
:: Install dependencies
|
||||
%py% -m %pipR%
|
||||
!py! -m !pipR!
|
||||
) ELSE (
|
||||
:: Check dependencies
|
||||
%py% -m %pipR% > NUL
|
||||
!py! -m !pipR! > NUL
|
||||
)
|
||||
|
||||
:: Run app
|
||||
%py% .\main.py
|
||||
!py! .\main.py
|
||||
|
||||
EXIT /b
|
||||
|
|
Reference in a new issue