v1.0.16.15 — codesign: self-signed Zern.cc exe signature (osslsigncode, digicert ts) + cli in bin layout + cli-jfx variant
This commit is contained in:
@@ -47,8 +47,37 @@ public class Bootstrap {
|
|||||||
return binDir.resolve(JAR_NAME);
|
return binDir.resolve(JAR_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Path resolveBaseDir() {
|
||||||
|
// 1) Стартуем от папки, где лежит сам .exe (для launch4j codeSource -> путь к exe).
|
||||||
|
Path exeDir = null;
|
||||||
|
try {
|
||||||
|
java.security.CodeSource cs = Bootstrap.class.getProtectionDomain().getCodeSource();
|
||||||
|
if (cs != null && cs.getLocation() != null) {
|
||||||
|
Path loc = Paths.get(cs.getLocation().toURI()).toAbsolutePath();
|
||||||
|
if (!Files.isDirectory(loc)) {
|
||||||
|
loc = loc.getParent(); // jar/exe -> его папка
|
||||||
|
}
|
||||||
|
exeDir = loc;
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
if (exeDir != null) {
|
||||||
|
// exe в bin/ -> база родитель (lib/jre21/assets в корне)
|
||||||
|
Path parent = exeDir.getParent();
|
||||||
|
Path candidates[] = { exeDir, parent }; // порядок: корень дистрибутива, затем родитель
|
||||||
|
for (Path c : candidates) {
|
||||||
|
if (c == null) continue;
|
||||||
|
if (Files.exists(c.resolve("bin").resolve(JAR_NAME))) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 2) Fallback: текущая рабочая папка (старое поведение).
|
||||||
|
return Paths.get("").toAbsolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
baseDir = Paths.get("").toAbsolutePath();
|
baseDir = resolveBaseDir();
|
||||||
binDir = baseDir.resolve("bin");
|
binDir = baseDir.resolve("bin");
|
||||||
Files.createDirectories(binDir);
|
Files.createDirectories(binDir);
|
||||||
logDir = baseDir.resolve("logs");
|
logDir = baseDir.resolve("logs");
|
||||||
|
|||||||
@@ -191,6 +191,7 @@
|
|||||||
<headerType>console</headerType>
|
<headerType>console</headerType>
|
||||||
<dontWrapJar>false</dontWrapJar>
|
<dontWrapJar>false</dontWrapJar>
|
||||||
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
||||||
|
<cmdLine>--cli</cmdLine>
|
||||||
<jre>
|
<jre>
|
||||||
<path>lib/jre21</path>
|
<path>lib/jre21</path>
|
||||||
<minVersion>21</minVersion>
|
<minVersion>21</minVersion>
|
||||||
@@ -208,6 +209,38 @@
|
|||||||
</versionInfo>
|
</versionInfo>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
||||||
|
<!-- CLI+JFX версия: консоль видима + форсим JFX UI -->
|
||||||
|
<execution>
|
||||||
|
<id>l4j-cli-jfx</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>launch4j</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outfile>../../server/builds/zernmc-cli-jfx.exe</outfile>
|
||||||
|
<jar>../../server/builds/zernmc-bootstrap.jar</jar>
|
||||||
|
<headerType>console</headerType>
|
||||||
|
<dontWrapJar>false</dontWrapJar>
|
||||||
|
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
||||||
|
<cmdLine>--jfx</cmdLine>
|
||||||
|
<jre>
|
||||||
|
<path>lib/jre21</path>
|
||||||
|
<minVersion>21</minVersion>
|
||||||
|
</jre>
|
||||||
|
<versionInfo>
|
||||||
|
<fileVersion>${project.version}.${hotfix}</fileVersion>
|
||||||
|
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
|
||||||
|
<fileDescription>ZernMC Launcher CLI + JFX</fileDescription>
|
||||||
|
<productVersion>${project.version}.${hotfix}</productVersion>
|
||||||
|
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
|
||||||
|
<productName>ZernMC CLI JFX</productName>
|
||||||
|
<companyName>ZernMC</companyName>
|
||||||
|
<internalName>zernmc-cli-jfx</internalName>
|
||||||
|
<originalFilename>zernmc-cli-jfx.exe</originalFilename>
|
||||||
|
</versionInfo>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
@@ -271,6 +304,12 @@
|
|||||||
<copy file="../../server/builds/zernmclauncher.jar"
|
<copy file="../../server/builds/zernmclauncher.jar"
|
||||||
tofile="../../server/builds/bin/zernmclauncher.jar" overwrite="true"/>
|
tofile="../../server/builds/bin/zernmclauncher.jar" overwrite="true"/>
|
||||||
|
|
||||||
|
<!-- Копируем CLI-экзешники в bin (для отладки/диагностики) -->
|
||||||
|
<copy file="../../server/builds/zernmc-cli.exe"
|
||||||
|
tofile="../../server/builds/bin/zernmc-cli.exe" overwrite="true"/>
|
||||||
|
<copy file="../../server/builds/zernmc-cli-jfx.exe"
|
||||||
|
tofile="../../server/builds/bin/zernmc-cli-jfx.exe" overwrite="true"/>
|
||||||
|
|
||||||
<!-- Копируем UI в assets -->
|
<!-- Копируем UI в assets -->
|
||||||
<mkdir dir="../../server/builds/assets"/>
|
<mkdir dir="../../server/builds/assets"/>
|
||||||
<copy todir="../../server/builds/assets/ui" overwrite="true">
|
<copy todir="../../server/builds/assets/ui" overwrite="true">
|
||||||
@@ -279,6 +318,62 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Подпись экзешников самоподписным сертификатом Zern.cc (publisher: ZernMC Launcher) -->
|
||||||
|
<exec executable="osslsigncode" failonerror="true">
|
||||||
|
<arg value="sign"/>
|
||||||
|
<arg value="-pkcs12"/>
|
||||||
|
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||||||
|
<arg value="-readpass"/>
|
||||||
|
<arg value="/root/cert/codesign/.pfxpass"/>
|
||||||
|
<arg value="-h"/>
|
||||||
|
<arg value="sha256"/>
|
||||||
|
<arg value="-ts"/>
|
||||||
|
<arg value="http://timestamp.digicert.com"/>
|
||||||
|
<arg value="-in"/>
|
||||||
|
<arg value="../../server/builds/zernmc.exe"/>
|
||||||
|
<arg value="-out"/>
|
||||||
|
<arg value="../../server/builds/zernmc.signed.exe"/>
|
||||||
|
</exec>
|
||||||
|
<move file="../../server/builds/zernmc.signed.exe"
|
||||||
|
tofile="../../server/builds/zernmc.exe" overwrite="true"/>
|
||||||
|
|
||||||
|
<exec executable="osslsigncode" failonerror="true">
|
||||||
|
<arg value="sign"/>
|
||||||
|
<arg value="-pkcs12"/>
|
||||||
|
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||||||
|
<arg value="-readpass"/>
|
||||||
|
<arg value="/root/cert/codesign/.pfxpass"/>
|
||||||
|
<arg value="-h"/>
|
||||||
|
<arg value="sha256"/>
|
||||||
|
<arg value="-ts"/>
|
||||||
|
<arg value="http://timestamp.digicert.com"/>
|
||||||
|
<arg value="-in"/>
|
||||||
|
<arg value="../../server/builds/bin/zernmc-cli.exe"/>
|
||||||
|
<arg value="-out"/>
|
||||||
|
<arg value="../../server/builds/bin/zernmc-cli.signed.exe"/>
|
||||||
|
</exec>
|
||||||
|
<move file="../../server/builds/bin/zernmc-cli.signed.exe"
|
||||||
|
tofile="../../server/builds/bin/zernmc-cli.exe" overwrite="true"/>
|
||||||
|
|
||||||
|
<exec executable="osslsigncode" failonerror="true">
|
||||||
|
<arg value="sign"/>
|
||||||
|
<arg value="-pkcs12"/>
|
||||||
|
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||||||
|
<arg value="-readpass"/>
|
||||||
|
<arg value="/root/cert/codesign/.pfxpass"/>
|
||||||
|
<arg value="-h"/>
|
||||||
|
<arg value="sha256"/>
|
||||||
|
<arg value="-ts"/>
|
||||||
|
<arg value="http://timestamp.digicert.com"/>
|
||||||
|
<arg value="-in"/>
|
||||||
|
<arg value="../../server/builds/bin/zernmc-cli-jfx.exe"/>
|
||||||
|
<arg value="-out"/>
|
||||||
|
<arg value="../../server/builds/bin/zernmc-cli-jfx.signed.exe"/>
|
||||||
|
</exec>
|
||||||
|
<move file="../../server/builds/bin/zernmc-cli-jfx.signed.exe"
|
||||||
|
tofile="../../server/builds/bin/zernmc-cli-jfx.exe" overwrite="true"/>
|
||||||
|
|
||||||
<!-- Создаём README -->
|
<!-- Создаём README -->
|
||||||
<echo file="../../server/builds/README.txt">
|
<echo file="../../server/builds/README.txt">
|
||||||
ZernMC Launcher
|
ZernMC Launcher
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>1.0.16</revision>
|
<revision>1.0.16</revision>
|
||||||
<hotfix>14</hotfix>
|
<hotfix>15</hotfix>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
Reference in New Issue
Block a user