Add powershell equivalents to existing batch scripts (#2561)

* Add powershell equivalents to existing windows scripts

Each .bat will try to invoke its .ps1 version if powershell is available, or else will fallback on the behavior
previous to this commit.
Should help fix bugs with accents and non-ASCII characters (issue #2327).

* Add powershell equivalents to existing windows scripts

Each .bat will try to invoke its .ps1 version if powershell is available, or else will fallback on the behavior
previous to this commit.
Should help fix bugs with accents and non-ASCII characters (issue #2327).

Co-authored-by: zadam <zadam.apps@gmail.com>
This commit is contained in:
U-Bren 2022-01-17 23:51:25 +01:00 committed by GitHub
parent 3055ed86ec
commit 780b520506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 6 deletions

View File

@ -27,9 +27,7 @@ rm -r $BUILD_DIR/swiftshader
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
cp bin/tpl/trilium-portable.bat $BUILD_DIR/
cp bin/tpl/trilium-no-cert-check.bat $BUILD_DIR/
cp bin/tpl/trilium-safe-mode.bat $BUILD_DIR/
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.{bat,ps1} $BUILD_DIR/
echo "Zipping windows x64 electron distribution..."
VERSION=`jq -r ".version" package.json`

View File

@ -1,4 +1,5 @@
SET DIR=%~dp0
set NODE_TLS_REJECT_UNAUTHORIZED=0
cd %DIR%
start trilium.exe
WHERE powershell.exe
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-no-cert-check.ps1)

View File

@ -0,0 +1,2 @@
Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0
./trilium.exe

View File

@ -1,4 +1,5 @@
SET DIR=%~dp0
SET TRILIUM_DATA_DIR=%DIR%\trilium-data
cd %DIR%
start trilium.exe
WHERE powershell.exe
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1)

View File

@ -0,0 +1,2 @@
Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'
./trilium.exe

View File

@ -1,4 +1,5 @@
SET DIR=%~dp0
SET TRILIUM_SAFE_MODE=1
cd %DIR%
start trilium.exe
WHERE powershell.exe
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-safe-mode.ps1)

View File

@ -0,0 +1,2 @@
Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1
./trilium.exe