-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_oneapi.bat
More file actions
59 lines (52 loc) · 1.96 KB
/
install_oneapi.bat
File metadata and controls
59 lines (52 loc) · 1.96 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
@echo off
title Intel oneAPI Base Toolkit Installer
setlocal enabledelayedexpansion
echo ======================================================
echo Intel oneAPI Base Toolkit Silent Installer
echo ======================================================
echo.
:: Check for Administrator privileges
net session >nul 2>&1
if %errorLevel% neq 0 (
echo [ERROR] Please run this script as Administrator.
pause
exit /b 1
)
:: Set download URL and destination
set "ONEAPI_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f5881e61-dcdc-40f1-9bd9-717081ac623c/intel-oneapi-base-toolkit-2025.2.1.46_offline.exe"
set "INSTALLER_PATH=oneAPI_BaseKit_Installer.exe"
set "INSTALL_DIR=C:\Program Files (x86)\Intel\oneAPI"
echo Downloading Intel oneAPI Base Toolkit installer...
powershell -Command "Invoke-WebRequest -Uri '%ONEAPI_URL%' -OutFile '%INSTALLER_PATH%'"
if %errorLevel% neq 0 (
echo [ERROR] Failed to download the installer.
pause
exit /b 1
)
echo Download complete.
echo.
echo Installing Intel oneAPI Base Toolkit silently...
"%INSTALLER_PATH%" --silent --eula=accept --install-dir="%INSTALL_DIR%"
if %errorLevel% neq 0 (
echo [ERROR] Installation failed.
pause
exit /b 1
)
echo Installation complete.
:: Optional: Add oneAPI environment setup to user profile
set "SETVARS_PATH=%INSTALL_DIR%\setvars.bat"
if exist "%SETVARS_PATH%" (
echo Adding oneAPI environment setup to PowerShell profile...
powershell -Command "Add-Content -Path $PROFILE -Value ('`ncmd /c ""%SETVARS_PATH%""')"
echo Added successfully.
) else (
echo [WARNING] Could not find setvars.bat; please verify installation.
)
echo.
echo ======================================================
echo Intel oneAPI Base Toolkit installation completed!
echo To use oneAPI, open a new PowerShell window and run:
echo cmd /c "%SETVARS_PATH%"
echo ======================================================
pause
exit /b 0