the new and simple way of packaging windows

This commit is contained in:
Aria Moradi 2021-05-18 21:31:25 +04:30
parent cacc97cec7
commit c1baa31eed
8 changed files with 29 additions and 20 deletions

View File

@ -0,0 +1 @@
start "" jre/bin/javaw -jar Tachidesk.jar

View File

@ -0,0 +1,5 @@
#include <stdlib.h>
int main() {
system("start jre\\bin\\javaw -jar Tachidesk.jar");
}

Binary file not shown.

View File

@ -1 +0,0 @@
start "" "jre/bin/javaw -jar Tachidesk.jar"

View File

@ -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"`

View File

@ -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/

View File

@ -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<ShadowJar> {
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"
}