자유 게시판

제목ㄹ4ㄱ4ㄱ2026-08-05 14:03
작성자

@echo off

setlocal enabledelayedexpansion

title WebView2 Fixed Version Setup


:: 1. Admin Privilege Check

net session >nul 2>&1

if %errorLevel% neq 0 (

    echo [INFO] Requesting Administrator Privileges...

    powershell -Command "Start-Process '%~f0' -Verb RunAs"

    exit /b

)


cd /d "%~dp0"


echo.

echo ============================================================

echo   WebView2 Fixed Version Runtime Setup

echo ============================================================

echo.


set "CAB_FILE=%~dp0Microsoft.WebView2.FixedVersionRuntime.150.0.4078.105.x64.cab"

set "TARGET_DIR=C:\YSR2000\YSRKiosk"

set "RUNTIME_DIR=C:\YSR2000\YSRKiosk\Microsoft.WebView2.FixedVersionRuntime.150.0.4078.105.x64"


:: 2. Check CAB File

if not exist "%CAB_FILE%" (

    echo [ERROR] CAB File not found!

    echo Path: %CAB_FILE%

    echo.

    echo Please make sure the .cab file is in the same directory.

    echo.

    pause

    exit /b 1

)


:: 3. Create Directory

if not exist "%TARGET_DIR%" (

    echo [1/3] Creating directory: %TARGET_DIR%

    mkdir "%TARGET_DIR%"

) else (

    echo [1/3] Directory already exists: %TARGET_DIR%

)


:: 4. Extract CAB File

echo [2/3] Extracting WebView2 Runtime CAB File... Please wait.

expand -F:* "%CAB_FILE%" "%TARGET_DIR%"


if %errorLevel% neq 0 (

    echo.

    echo [ERROR] Extraction failed.

    pause

    exit /b 1

)

echo [OK] Extraction Complete!


:: 5. Registry Additions

echo [3/3] Registering WebView2 BrowserExecutableFolder in Registry...


reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder" /v "YsrKiosk_Kiosk_App.exe" /t REG_SZ /d "%RUNTIME_DIR%" /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder" /v "YsrKiosk_Manager_App.exe" /t REG_SZ /d "%RUNTIME_DIR%" /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder" /v "YsrKiosk_Manager_Launcher.exe" /t REG_SZ /d "%RUNTIME_DIR%" /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder" /v "YsrKiosk_Manager_LChanger.exe" /t REG_SZ /d "%RUNTIME_DIR%" /f


echo.

echo ============================================================

echo   SUCCESS! All tasks completed.

echo   Please restart the Kiosk application.

echo ============================================================

echo.

pause

댓글

(자동등록방지 숫자를 입력해 주세요)