Inital Commit

This commit is contained in:
2023-03-16 23:54:00 +01:00
commit 13ee0ecb2e
11 changed files with 227 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
@ECHO OFF
TITLE Preparing installation
REM load config
call MountConfig.cmd
ECHO --------------------------------
ECHO Welcome to WinPE SMB installer
ECHO\
ECHO by Brammp
ECHO --------------------------------
ECHO\
echo Waiting for network
REM Load network
wpeinit
wpeinit network
REM Test network
:TestNetworkConnection
ping -n 1 %SmbServer% | find "TTL=" >nul
if errorlevel 1 (
goto Retry
) else (
goto ExecSMB
)
:Retry
ping 192.0.2.1 -n 5 -w 2000 >nul
goto :TestNetworkConnection
:ExecSMB
rem echo "Connection OK."
rem Mount network share
set SmbRetry=0
ECHO Waiting for SMB
:SmbMount
net use I: \\%SmbServer%\%SmbFolder% /user:%SmbUser% %SmbPassword% >null 2>&1
IF not exist I:\ (
set /A SmbRetry+=1 >null
REM ECHO SMB Failed Count: %SmbRetry%
REM ECHO Retrying in 2sec
ping 127.0.0.1 -n 5 -w 2000 >nul
GOTO SmbMount
) ELSE (
GOTO ExecMenu
)
:ExecMenu
rem Go to network share
i:
setlocal EnableDelayedExpansion
rem Show menu with availible Versions
ECHO Available releases:
ECHO\
set i=0
for /D %%f in ("*") do (
set /A i+=1
echo !i!. %VersionPrefix%%%f
set "option[!i!]=%%f"
)
ECHO\
:getChoice
set /P "choice=Enter desired option: "
if "!option[%choice%]!" equ "" echo ERROR: no such option & goto getChoice
set "SelectedRelease=!option[%choice%]!"
echo | set /p=%SelectedRelease%>%TEMP%\SelectedRelease.var
ECHO\
ECHO Loading setup for %VersionPrefix%%SelectedRelease%
ping 192.0.2.1 -n 2 -w 2000 >nul
exit

View File

@@ -0,0 +1,20 @@
@ECHO OFF
TITLE Loading windows setup
REM load needed var(s)
set /p SelectedRelease=<%TEMP%\SelectedRelease.var
set SetupFound=FALSE
REM go to setUp location
I:
cd \%SelectedRelease%
REM Check if setup exists
IF exist setup.exe (
set SetupFound=TRUE
REM load setUp
start /wait setup.exe
)
echo | set /p=%SetupFound%>%TEMP%\SetupFound.var
REM exit

View File

@@ -0,0 +1,24 @@
@ECHO OFF
TITLE Power menu
REM load needed var(s)
set /p SetupFound=<%TEMP%\SetupFound.var
IF %SetupFound% == FALSE (
echo Setup not found
pause
)
:PowerMenu
ECHO\
ECHO ...............................................
ECHO PRESS 1 to poweroff, or 2 to reboot
ECHO ...............................................
ECHO\
ECHO 1 - Poweroff
ECHO 2 - Reboot
ECHO\
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 wpeutil shutdown
IF %M%==2 wpeutil reboot
GOTO PowerMenu

View File

@@ -0,0 +1,4 @@
[LaunchApps]
X:/SMBInstaller/InitMenu.cmd
X:/SMBInstaller/LoadSetup.cmd
X:/SMBInstaller/PowerMenu.cmd