Notes/apps/server/tpl/trilium-safe-mode.bat

24 lines
666 B
Batchfile
Raw Normal View History

@echo off
:: Try to get powershell to launch Trilium since it deals with UTF-8 characters in current path
:: If there's no powershell available, fallback to unicode enabled command interpreter
WHERE powershell.exe > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
:POWERSHELL
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1; ./trilium.exe --disable-gpu"
GOTO END
:BATCH
:: Make sure we support UTF-8 characters
chcp 65001
:: Get Current Trilium executable directory and compute data directory
2021-05-27 21:29:23 +02:00
SET DIR=%~dp0
SET TRILIUM_SAFE_MODE=1
2025-03-14 14:19:11 +03:00
cd "%DIR%"
start trilium.exe --disable-gpu
GOTO END
:END