Repository navigation
Expand file tree
/
Copy pathinstall.bat
More file actions
65 lines (55 loc) · 2.12 KB
/
Copy pathinstall.bat
File metadata and controls
65 lines (55 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@echo off
REM ************************************************************************************
REM Copyright (C) 2022-2026 rhctl Contributors
REM
REM SPDX-License-Identifier: Apache-2.0
REM ************************************************************************************
REM Install Docker Desktop locally on your Windows machine.
REM
REM Prerequisites:
REM 1. Open the Command Prompt with administrator privileges and navigate to the project root directory.
REM
REM Since: 1.0.0
REM Date: October 16, 2025
REM ************************************************************************************
@echo off
setlocal
REM Function: Ensure Chocolatey is available, install if missing
:ensure_chocolatey
REM Step 1: Check if choco command exists in PATH
where choco >nul 2>&1
if %errorlevel% equ 0 (
echo [INFO] Chocolatey is already available in PATH.
set "CHOCO_CMD=choco"
goto :choco_done
)
REM Step 2: If folder exists, use absolute path to choco.exe
if exist "C:\ProgramData\chocolatey\bin\choco.exe" (
echo [INFO] Using existing Chocolatey at C:\ProgramData\chocolatey\bin\choco.exe
set "CHOCO_CMD=C:\ProgramData\chocolatey\bin\choco.exe"
goto :choco_done
)
REM Step 3: Install Chocolatey
echo [INFO] Installing Chocolatey...
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
REM Step 4: Verify installation
if exist "C:\ProgramData\chocolatey\bin\choco.exe" (
set "CHOCO_CMD=C:\ProgramData\chocolatey\bin\choco.exe"
echo [INFO] Chocolatey installed successfully.
) else (
echo [ERROR] Chocolatey installation failed - choco.exe not found.
exit /b 1
)
REM Main script starts here
call :ensure_chocolatey
:choco_done
echo [INFO] Installing Docker Desktop...
%CHOCO_CMD% install docker-desktop -y
if %errorlevel% neq 0 (
echo [ERROR] Docker Desktop installation failed.
exit /b 1
)
echo [SUCCESS] Docker Desktop installation completed.
endlocal
pause