fix: add Windows launcher for JDBC plugin (os error 193)

This commit is contained in:
t8y2
2026-05-13 14:27:47 +08:00
parent fa0dfc9383
commit 6be7170dfb
3 changed files with 37 additions and 4 deletions
+12 -4
View File
@@ -349,9 +349,17 @@ where
fn resolve_plugin_executable(plugin_dir: &Path, executable: &str) -> PathBuf {
let path = PathBuf::from(executable);
if path.is_absolute() {
path
} else {
plugin_dir.join(path)
let resolved = if path.is_absolute() { path } else { plugin_dir.join(path) };
#[cfg(windows)]
{
if !resolved.exists() {
let bat = resolved.with_extension("bat");
if bat.exists() {
return bat;
}
}
}
resolved
}
+24
View File
@@ -0,0 +1,24 @@
@echo off
setlocal
if defined JAVA_HOME (
if exist "%JAVA_HOME%\bin\java.exe" (
set "JAVA_BIN=%JAVA_HOME%\bin\java.exe"
goto :run
)
)
where java >nul 2>nul
if %errorlevel% equ 0 (
java -version >nul 2>nul
if %errorlevel% equ 0 (
set "JAVA_BIN=java"
goto :run
)
)
echo Java runtime not found. Install Java or the optional DBX JDBC runtime. >&2
exit /b 127
:run
"%JAVA_BIN%" -jar "%~dp0..\lib\dbx-jdbc-plugin.jar"
+1
View File
@@ -13,6 +13,7 @@ rm -rf "$PACKAGE_DIR" "$ZIP_PATH"
mkdir -p "$PACKAGE_DIR/bin" "$PACKAGE_DIR/lib"
cp "$ROOT/manifest.json" "$PACKAGE_DIR/manifest.json"
cp "$ROOT/bin/dbx-jdbc-plugin" "$PACKAGE_DIR/bin/dbx-jdbc-plugin"
cp "$ROOT/bin/dbx-jdbc-plugin.bat" "$PACKAGE_DIR/bin/dbx-jdbc-plugin.bat"
cp "$ROOT/target/dbx-jdbc-plugin-$VERSION-all.jar" "$PACKAGE_DIR/lib/dbx-jdbc-plugin.jar"
chmod +x "$PACKAGE_DIR/bin/dbx-jdbc-plugin"