-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayControlPlus_Installer.bat
More file actions
83 lines (70 loc) · 3.87 KB
/
DisplayControlPlus_Installer.bat
File metadata and controls
83 lines (70 loc) · 3.87 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@echo off
title Display Control+ Installer
color 0A
echo.
echo ===============================================
echo Display Control+ OLED Screen Protector
echo ===============================================
echo.
REM Check for existing installations
echo Checking for existing installations...
set EXISTING_FOUND=0
if exist "%APPDATA%\DisplayControlPlus" set EXISTING_FOUND=1
if exist "%APPDATA%\Display Control+" set EXISTING_FOUND=1
schtasks /query /tn "DisplayControlPlus_Background" >nul 2>&1 && set EXISTING_FOUND=1
if %EXISTING_FOUND%==1 (
echo.
echo WARNING: Existing Display Control+ installation detected!
echo.
echo For best results, please run "Complete_Cleanup.bat" first
echo to remove all previous installations, then run this installer again.
echo.
echo Continue anyway? ^(This may cause conflicts^)
choice /c YN /m "Press Y to continue or N to exit"
if errorlevel 2 exit /b 1
)
echo.
echo This installer will:
echo - Install Display Control+ to your system
echo - Create a desktop shortcut
echo - Set up automatic Windows startup
echo - Configure background monitoring
echo.
pause
echo.
echo Installing Display Control+...
echo.
REM Create installation directory
if not exist "%APPDATA%\DisplayControlPlus" mkdir "%APPDATA%\DisplayControlPlus"
REM Copy all files from installer\dist\DisplayControlPlus to %APPDATA%\DisplayControlPlus
echo Copying application files...
xcopy /E /I /Y "installer\dist\DisplayControlPlus\*" "%APPDATA%\DisplayControlPlus\"
REM Copy config file to installation directory
echo Copying configuration...
copy /Y "config.json" "%APPDATA%\DisplayControlPlus\config.json" >nul
REM Copy logo/icon
copy /Y "Display Control+ Logo.png" "%APPDATA%\DisplayControlPlus\Display Control+ Logo.png" >nul
if exist "installer\Display Control+ Logo.ico" copy /Y "installer\Display Control+ Logo.ico" "%APPDATA%\DisplayControlPlus\Display Control+ Logo.ico" >nul
REM Create desktop shortcut using PowerShell
echo Creating desktop shortcut...
powershell -Command "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut('%USERPROFILE%\Desktop\Display Control+.lnk'); $Shortcut.TargetPath = '%APPDATA%\DisplayControlPlus\DisplayControlPlus.exe'; $Shortcut.WorkingDirectory = '%APPDATA%\DisplayControlPlus'; $Shortcut.Description = 'OLED Screen Protector - Prevent burn-in with smart overlays'; if (Test-Path '%APPDATA%\DisplayControlPlus\Display Control+ Logo.ico') { $Shortcut.IconLocation = '%APPDATA%\DisplayControlPlus\Display Control+ Logo.ico' }; $Shortcut.Save()"
REM Register background service for Windows startup
echo Setting up Windows startup service...
powershell -Command "try { $action = New-ScheduledTaskAction -Execute '%APPDATA%\DisplayControlPlus\DisplayControlPlus.exe' -Argument '--background' -WorkingDirectory '%APPDATA%\DisplayControlPlus'; $trigger = New-ScheduledTaskTrigger -AtLogOn; $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable; $principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive; Register-ScheduledTask -TaskName 'DisplayControlPlus_Background' -Action $action -Trigger $trigger -Settings $settings -Principal $principal -Force | Out-Null; Write-Host 'Background service registered successfully' } catch { Write-Host 'Note: Background service registration requires admin rights' }"
echo.
echo ===============================================
echo Installation Complete!
echo ===============================================
echo.
echo Desktop shortcut: Display Control+.lnk
echo Installation location: %APPDATA%\DisplayControlPlus
echo Background monitoring: Enabled on Windows startup
echo.
echo To get started:
echo 1. Double-click the desktop shortcut
echo 2. Configure your timeout and overlay preferences
echo 3. Click 'Apply' to activate protection
echo.
echo Your OLED screen is now protected!
echo.
pause