Inital Commit
This commit is contained in:
77
Overlay/SMBInstaller/InitMenu.cmd
Normal file
77
Overlay/SMBInstaller/InitMenu.cmd
Normal 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
|
||||
Reference in New Issue
Block a user