Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Use inline powershell launcher, add unicode support for batch
Orsiris de Jong87e833d373ec
diff --git a/bin/tpl/trilium-no-cert-check.bat b/bin/tpl/trilium-no-cert-check.batindex 01a3766850..360064bdc4 100644--- a/bin/tpl/trilium-no-cert-check.bat+++ b/bin/tpl/trilium-no-cert-check.bat@@ -1,5 +1,23 @@+@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:NODE_TLS_REJECT_UNAUTHORIZED -Value 0; ./trilium.exe"+GOTO END++:BATCH+:: Make sure we support UTF-8 characters+chcp 65001++:: Get Current Trilium executable directory and compute data directorySET DIR=%~dp0set NODE_TLS_REJECT_UNAUTHORIZED=0cd %DIR%-WHERE powershell.exe-IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-no-cert-check.ps1)\ No newline at end of file+start trilium.exe+GOTO END++:ENDdiff --git a/bin/tpl/trilium-portable.bat b/bin/tpl/trilium-portable.batindex 668872d038..a89476ae0f 100644--- a/bin/tpl/trilium-portable.bat+++ b/bin/tpl/trilium-portable.bat@@ -1,5 +1,23 @@+@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_DATA_DIR -Value './trilium-data'; ./trilium.exe"+GOTO END++:BATCH+:: Make sure we support UTF-8 characters+chcp 65001++:: Get Current Trilium executable directory and compute data directorySET DIR=%~dp0SET TRILIUM_DATA_DIR=%DIR%\trilium-datacd %DIR%-WHERE powershell.exe-IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1)\ No newline at end of file+start trilium.exe+GOTO END++:ENDdiff --git a/bin/tpl/trilium-safe-mode.bat b/bin/tpl/trilium-safe-mode.batindex 7a56993692..7692ec7dc3 100644--- a/bin/tpl/trilium-safe-mode.bat+++ b/bin/tpl/trilium-safe-mode.bat@@ -1,5 +1,23 @@+@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 directorySET DIR=%~dp0SET TRILIUM_SAFE_MODE=1cd %DIR%-WHERE powershell.exe-IF %ERRORLEVEL% NEQ 0 (start trilium.exe --disable-gpu) ELSE (powershell.exe ./trilium-safe-mode.ps1)+start trilium.exe --disable-gpu+GOTO END++:END