Introduced log and minor fix to Windows deploy script

This commit is contained in:
Marco
2019-06-28 16:27:48 +02:00
parent 54f31a9b6a
commit 2832f3f4df

View File

@@ -1,4 +1,8 @@
@echo off @echo off
echo ===================================
echo Artemis 3 Deploy Script
echo WINDOWS
echo ===================================
REM Check and gain admin permissions REM Check and gain admin permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
@@ -23,23 +27,30 @@ if '%errorlevel%' NEQ '0' (
:gotAdmin :gotAdmin
pushd "%CD%" pushd "%CD%"
CD /D "%~dp0" CD /D "%~dp0"
echo:
REM Set the correct permissions for Artemis folder REM Set the correct permissions for Artemis folder
set artemis_path=%~dp0..\.. set artemis_path=%~dp0..\..
icacls "%artemis_path%" /grant %USERNAME%:(OI)(CI)F /T > nul icacls "%artemis_path%" /grant %USERNAME%:(OI)(CI)F /T > log
echo Gaining admin privileges and set folder read/write permission... DONE!
REM Download necessary libraries with pip3 REM Download necessary libraries with pip3
set choice=Y
set /p choice=Download necessary Python libraries? [Y]/N
if /I '%choice%'=='Y' pip3 install -r %~dp0requirements_win.txt
echo: echo:
set choice=Y
set /p choice=Install the necessary Python libraries? [Y,N]...
echo:
if /I '%choice%'=='Y' pip3 install -r %~dp0requirements_win.txt --no-color >> log
REM Generation of shortcut REM Generation of shortcut
echo:
set choice=Y set choice=Y
set /p choice=Create a desktop shortcut? [Y]/N set /p choice=Create a desktop shortcut? [Y/N]...
if /I '%choice%'=='N' goto end if /I '%choice%'=='N' goto end
IF EXIST "%artemis_path%\Artemis.py" (
ren "%artemis_path%\Artemis.py" "Artemis.pyw" ren "%artemis_path%\Artemis.py" "Artemis.pyw"
)
echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs
echo sLinkFile = "%USERPROFILE%\Desktop\Artemis.lnk" >> CreateShortcut.vbs echo sLinkFile = "%USERPROFILE%\Desktop\Artemis.lnk" >> CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
@@ -51,6 +62,8 @@ cscript /nologo CreateShortcut.vbs
del CreateShortcut.vbs del CreateShortcut.vbs
:end :end
echo: echo:
echo SETTING COMPLETE! echo ================================
echo SETTING COMPLETE
echo ================================
echo: echo:
pause pause