diff --git a/scripts/resources/Tachidesk-debug.bat b/scripts/resources/Tachidesk Debug Launcher.bat similarity index 100% rename from scripts/resources/Tachidesk-debug.bat rename to scripts/resources/Tachidesk Debug Launcher.bat diff --git a/scripts/resources/Tachidesk Launcher.bat b/scripts/resources/Tachidesk Launcher.bat new file mode 100644 index 0000000..45da249 --- /dev/null +++ b/scripts/resources/Tachidesk Launcher.bat @@ -0,0 +1 @@ +start "" jre/bin/javaw -jar Tachidesk.jar \ No newline at end of file diff --git a/scripts/resources/Tachidesk Launcher.c b/scripts/resources/Tachidesk Launcher.c new file mode 100644 index 0000000..8d941d9 --- /dev/null +++ b/scripts/resources/Tachidesk Launcher.c @@ -0,0 +1,5 @@ +#include + +int main() { + system("start jre\\bin\\javaw -jar Tachidesk.jar"); +} diff --git a/scripts/resources/Tachidesk Launcher.exe b/scripts/resources/Tachidesk Launcher.exe new file mode 100644 index 0000000..92476be Binary files /dev/null and b/scripts/resources/Tachidesk Launcher.exe differ diff --git a/scripts/resources/Tachidesk.bat b/scripts/resources/Tachidesk.bat deleted file mode 100644 index 76b616a..0000000 --- a/scripts/resources/Tachidesk.bat +++ /dev/null @@ -1 +0,0 @@ -start "" "jre/bin/javaw -jar Tachidesk.jar" \ No newline at end of file diff --git a/scripts/resources/readme.md b/scripts/resources/readme.md new file mode 100644 index 0000000..4c8dac9 --- /dev/null +++ b/scripts/resources/readme.md @@ -0,0 +1,3 @@ +# Building `Tachidesk Launcher.exe` +1. compile `Tachidesk Launcher.c` statically using GCC MinGW: `gcc -o "Tachidesk Launcher.exe" "Tachidesk Launcher.c"` +2. Add `server/src/main/resources/icon/faviconlogo.ico` into the exe with `rcedit` from the electron project: `rcedit "Tachidesk Launcher.exe" --set-icon "faviconlogo.ico"` diff --git a/scripts/windows-bundler.sh b/scripts/windows-bundler.sh index f969849..e46352a 100755 --- a/scripts/windows-bundler.sh +++ b/scripts/windows-bundler.sh @@ -27,10 +27,11 @@ mv jdk8u292-b10-jre $release_name/jre cp $jar $release_name/Tachidesk.jar -cp resources/Tachidesk.bat $release_name -cp resources/Tachidesk-debug.bat $release_name +cp "resources/Tachidesk Launcher.exe" $release_name +cp "resources/Tachidesk Launcher.bat" $release_name +cp "resources/Tachidesk Debug Launcher.bat" $release_name zip_name=$release_name.zip zip -9 -r $zip_name $release_name -cp $zip_name ../server/build/ +mv $zip_name ../server/build/ diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 3bf6725..9d48b7a 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -126,18 +126,8 @@ buildConfig { buildConfigField("boolean", "debug", project.hasProperty("debugApp").toString()) } -launch4j { //used for windows - mainClassName = MainClass - bundledJrePath = "jre" - bundledJre64Bit = true - jreMinVersion = "8" - outputDir = "${rootProject.name}-$tachideskVersion-$tachideskRevision-win64" - icon = "${projectDir}/src/main/resources/icon/faviconlogo.ico" - jar = "${projectDir}/build/${rootProject.name}-$tachideskVersion-$tachideskRevision.jar" -} - tasks { - jar { + shadowJar { manifest { attributes( mapOf( @@ -149,9 +139,6 @@ tasks { ) ) } - } - shadowJar { - manifest.inheritFrom(jar.get().manifest) //will make your shadowJar (produced by jar task) runnable archiveBaseName.set(rootProject.name) archiveVersion.set(tachideskVersion) archiveClassifier.set(tachideskRevision) @@ -168,8 +155,8 @@ tasks { test { useJUnit() } - - + + withType { destinationDirectory.set(File("$rootDir/server/build")) dependsOn("formatKotlin", "lintKotlin") @@ -193,3 +180,16 @@ tasks { } } +launch4j { //used for windows + mainClassName = MainClass + bundledJrePath = "jre" + bundledJre64Bit = true + dontWrapJar = true + outputDir = "${rootProject.name}-$tachideskVersion-$tachideskRevision-win64" + icon = "${projectDir}/src/main/resources/icon/faviconlogo.ico" + jar = "Tachidesk.jar" + libraryDir = "" + copyConfigurable = "false" +} + +