v0.0.8-alpha

Remove: unnecessary powershell initialization
This commit is contained in:
abbodi1406 2019-11-20 03:16:12 +03:00
parent f70a978f73
commit 503ebaa288

View file

@ -201,7 +201,7 @@ for /f "tokens=2 delims==" %%# in ('findstr /i /b /c:"set KMS_ActivationInterval
if %ActWindows% EQU 0 if %ActOffice% EQU 0 set ActWindows=1 if %ActWindows% EQU 0 if %ActOffice% EQU 0 set ActWindows=1
if %_Debug% EQU 1 if not defined fAUR set fAUR=0&set External=0 if %_Debug% EQU 1 if not defined fAUR set fAUR=0&set External=0
if %Unattend% EQU 1 if not defined fAUR set fAUR=0&set External=0 if %Unattend% EQU 1 if not defined fAUR set fAUR=0&set External=0
if not defined fAUR goto :cmdUI if not defined fAUR goto :MainMenu
set Unattend=1 set Unattend=1
set AUR=0 set AUR=0
if exist %_Hook% dir /b /al %_Hook% %_Nul3% || ( if exist %_Hook% dir /b /al %_Hook% %_Nul3% || (
@ -212,18 +212,9 @@ if %fAUR% EQU 1 (if %AUR% EQU 0 (set AUR=1&set _verb=1&set _rtr=DoActivate&cls&g
if %External% EQU 0 (set AUR=0&cls&goto :DoActivate) if %External% EQU 0 (set AUR=0&cls&goto :DoActivate)
cls&goto :DoActivate cls&goto :DoActivate
:cmdUI
:: Set buffer height independently of window height
:: https://stackoverflow.com/a/13351373
:: Written by @dbenham (stackoverflow)
echo.
echo Initializing...
mode con cols=80 lines=35
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
if %errorlevel% NEQ 0 goto :E_PS
:MainMenu :MainMenu
cls cls
mode con cols=80 lines=35
color 07 color 07
title KMS_VL_ALL title KMS_VL_ALL
set AUR=0 set AUR=0
@ -328,6 +319,9 @@ if %_Debug% EQU 0 (title KMS_VL_ALL) else (title KMS_VL_ALL %mode%)
if %winbuild% GEQ 9600 ( if %winbuild% GEQ 9600 (
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /f /v NoGenTicket /t REG_DWORD /d 1 %_Nul3% reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /f /v NoGenTicket /t REG_DWORD /d 1 %_Nul3%
) )
if %Silent% EQU 0 if %_Debug% EQU 0 (
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
)
echo. echo.
echo Activation Mode: %mode% echo Activation Mode: %mode%
call :StopService sppsvc call :StopService sppsvc
@ -392,7 +386,7 @@ if %Unattend% NEQ 0 goto :TheEnd
echo. echo.
echo Press any key to continue... echo Press any key to continue...
pause >nul pause >nul
if %_verb% EQU 1 (goto :cmdUI) else (goto :MainMenu) goto :MainMenu
:RunSPP :RunSPP
set spp=SoftwareLicensingProduct set spp=SoftwareLicensingProduct
@ -827,7 +821,7 @@ goto :eof
:InstallHook :InstallHook
if %_verb% EQU 1 ( if %_verb% EQU 1 (
if %Silent% EQU 0 if %_Debug% EQU 0 ( if %Silent% EQU 0 if %_Debug% EQU 0 (
mode con cols=100 lines=35 mode con cols=100
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}" %_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
) )
echo. echo.
@ -885,8 +879,7 @@ if %winbuild% GEQ 9600 (
) )
if %_verb% EQU 1 ( if %_verb% EQU 1 (
if %Silent% EQU 0 if %_Debug% EQU 0 ( if %Silent% EQU 0 if %_Debug% EQU 0 (
mode con cols=100 lines=35 mode con cols=100
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
) )
echo. echo.
echo Uninstalling Local KMS Emulator... echo Uninstalling Local KMS Emulator...
@ -1006,7 +999,7 @@ call :cREG %_Nul3%
echo. echo.
echo Press any key to continue... echo Press any key to continue...
pause >nul pause >nul
if %_verb% EQU 1 (goto :cmdUI) else (goto :MainMenu) goto :MainMenu
:CreateTask :CreateTask
schtasks /query /tn "%_TaskEx%" %_Nul3% || ( schtasks /query /tn "%_TaskEx%" %_Nul3% || (
@ -1035,6 +1028,7 @@ goto :eof
:casVm :casVm
cls cls
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
echo %line2% echo %line2%
echo *** Windows Status *** echo *** Windows Status ***
@ -1161,6 +1155,7 @@ goto :eof
:casWm :casWm
cls cls
%_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}"
setlocal setlocal
set wspp=SoftwareLicensingProduct set wspp=SoftwareLicensingProduct
set wsps=SoftwareLicensingService set wsps=SoftwareLicensingService