Skip to content

Commit df4a266

Browse files
authored
Upgrade DeployWorkstation Launcher to v6.0
Updated launcher version and improved error messages.
1 parent de60b79 commit df4a266

1 file changed

Lines changed: 11 additions & 88 deletions

File tree

DeployWorkstation.bat

Lines changed: 11 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,44 @@
22
setlocal EnableExtensions EnableDelayedExpansion
33

44
echo.
5-
echo ===== DeployWorkstation Launcher v5.1 =====
5+
echo ===== DeployWorkstation Launcher v6.0 =====
66
echo.
77

8-
REM --------------------------------------------------------
9-
REM 1) Elevation check
10-
REM --------------------------------------------------------
8+
rem Relaunch elevated if needed
119
net session >nul 2>&1
1210
if errorlevel 1 (
1311
echo Requesting administrative privileges...
14-
echo Please click "Yes" in the UAC prompt.
15-
echo.
1612
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ^
1713
"Start-Process -FilePath '%~f0' -Verb RunAs"
1814
exit /b
1915
)
2016

21-
echo [OK] Running as Administrator.
22-
echo.
23-
24-
REM --------------------------------------------------------
25-
REM 2) Change to script directory
26-
REM --------------------------------------------------------
2717
pushd "%~dp0" || (
28-
echo [ERROR] Failed to access script folder.
18+
echo [ERROR] Could not access script folder.
2919
pause
3020
exit /b 1
3121
)
3222

33-
REM --------------------------------------------------------
34-
REM 3) Verify PowerShell script exists
35-
REM --------------------------------------------------------
3623
if not exist "%~dp0DeployWorkstation.ps1" (
3724
echo [ERROR] DeployWorkstation.ps1 not found.
38-
echo Expected: %~dp0DeployWorkstation.ps1
39-
echo.
40-
goto :error_exit
41-
)
42-
43-
REM --------------------------------------------------------
44-
REM 4) Menu
45-
REM --------------------------------------------------------
46-
:menu
47-
echo Select deployment mode:
48-
echo.
49-
echo 1. Full deployment (remove bloatware + install apps + configure system)
50-
echo 2. Remove bloatware only
51-
echo 3. Install apps only
52-
echo 4. System configuration only
53-
echo 5. Exit
54-
echo.
55-
set "choice="
56-
set /p "choice=Enter choice (1-5): "
57-
58-
set "ps_params="
59-
60-
if "%choice%"=="1" (
61-
echo.
62-
echo [*] Full deployment selected.
63-
) else if "%choice%"=="2" (
64-
echo.
65-
echo [*] Bloatware removal only.
66-
set "ps_params=-SkipAppInstall -SkipSystemConfig"
67-
) else if "%choice%"=="3" (
68-
echo.
69-
echo [*] App installation only.
70-
set "ps_params=-SkipBloatwareRemoval -SkipSystemConfig"
71-
) else if "%choice%"=="4" (
72-
echo.
73-
echo [*] System configuration only.
74-
set "ps_params=-SkipBloatwareRemoval -SkipAppInstall"
75-
) else if "%choice%"=="5" (
76-
set "ps_exit=0"
77-
goto :normal_exit
78-
) else (
79-
echo [!] Invalid choice - please try again.
80-
echo.
81-
goto :menu
25+
echo Expected: %~dp0DeployWorkstation.ps1
26+
set "ps_exit=1"
27+
goto :done
8228
)
8329

84-
REM --------------------------------------------------------
85-
REM 5) Show what will run, then launch
86-
REM --------------------------------------------------------
87-
echo.
88-
if defined ps_params (
89-
echo Parameters : !ps_params!
90-
) else (
91-
echo Parameters : (none - full run)
92-
)
93-
echo.
94-
echo Starting Windows PowerShell 5.1...
95-
echo.
96-
97-
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0DeployWorkstation.ps1" !ps_params!
30+
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0DeployWorkstation.ps1"
9831
set "ps_exit=%errorlevel%"
9932

100-
REM --------------------------------------------------------
101-
REM 6) Result
102-
REM --------------------------------------------------------
10333
echo.
10434
if "%ps_exit%"=="0" (
10535
echo ===== Deployment completed successfully =====
10636
) else (
107-
echo ===== Deployment finished with errors =====
108-
echo Exit code : %ps_exit%
109-
echo Check DeployWorkstation.log in this folder for details.
37+
echo ===== Deployment completed with warnings or errors =====
38+
echo Exit code: %ps_exit%
39+
echo Review DeployWorkstation.log and DeployWorkstation.html in this folder.
11040
)
11141

112-
goto :normal_exit
113-
114-
:error_exit
115-
echo.
116-
echo ===== Launch aborted =====
117-
set "ps_exit=1"
118-
119-
:normal_exit
42+
:done
12043
popd
12144
echo.
12245
echo Press any key to close...

0 commit comments

Comments
 (0)