diff --git a/bin/build-win-x64.sh b/bin/build-win-x64.sh index 68ce53001..c1b8030e4 100755 --- a/bin/build-win-x64.sh +++ b/bin/build-win-x64.sh @@ -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` diff --git a/bin/tpl/trilium-no-cert-check.bat b/bin/tpl/trilium-no-cert-check.bat index e10fa90ac..01a376685 100644 --- a/bin/tpl/trilium-no-cert-check.bat +++ b/bin/tpl/trilium-no-cert-check.bat @@ -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) \ No newline at end of file diff --git a/bin/tpl/trilium-no-cert-check.ps1 b/bin/tpl/trilium-no-cert-check.ps1 new file mode 100644 index 000000000..43ea010b9 --- /dev/null +++ b/bin/tpl/trilium-no-cert-check.ps1 @@ -0,0 +1,2 @@ +Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0 +./trilium.exe \ No newline at end of file diff --git a/bin/tpl/trilium-portable.bat b/bin/tpl/trilium-portable.bat index ac6555599..668872d03 100644 --- a/bin/tpl/trilium-portable.bat +++ b/bin/tpl/trilium-portable.bat @@ -1,4 +1,5 @@ SET DIR=%~dp0 SET TRILIUM_DATA_DIR=%DIR%\trilium-data cd %DIR% -start trilium.exe \ No newline at end of file +WHERE powershell.exe +IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1) \ No newline at end of file diff --git a/bin/tpl/trilium-portable.ps1 b/bin/tpl/trilium-portable.ps1 new file mode 100644 index 000000000..98bd36cb6 --- /dev/null +++ b/bin/tpl/trilium-portable.ps1 @@ -0,0 +1,2 @@ +Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data' +./trilium.exe \ No newline at end of file diff --git a/bin/tpl/trilium-safe-mode.bat b/bin/tpl/trilium-safe-mode.bat index a40f03bd8..45fb21c07 100644 --- a/bin/tpl/trilium-safe-mode.bat +++ b/bin/tpl/trilium-safe-mode.bat @@ -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) \ No newline at end of file diff --git a/bin/tpl/trilium-safe-mode.ps1 b/bin/tpl/trilium-safe-mode.ps1 new file mode 100644 index 000000000..5fafd5c3e --- /dev/null +++ b/bin/tpl/trilium-safe-mode.ps1 @@ -0,0 +1,2 @@ +Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1 +./trilium.exe \ No newline at end of file