From 0845828675c04cec0a6ad43a448d3ac820e0465e Mon Sep 17 00:00:00 2001 From: vananiev Date: Sun, 17 Nov 2024 00:14:34 +0300 Subject: [PATCH 1/5] do not bind port twice --- .../java/ru/investbook/ApplicationFailedRunListener.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/ru/investbook/ApplicationFailedRunListener.java b/src/main/java/ru/investbook/ApplicationFailedRunListener.java index 1344a889..d8b3ee06 100644 --- a/src/main/java/ru/investbook/ApplicationFailedRunListener.java +++ b/src/main/java/ru/investbook/ApplicationFailedRunListener.java @@ -31,11 +31,8 @@ public class ApplicationFailedRunListener implements ApplicationListener Date: Sun, 17 Nov 2024 00:15:22 +0300 Subject: [PATCH 2/5] install msi without admin credentials --- docs/developer-guide.md | 10 +++++++++- pom.xml | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/developer-guide.md b/docs/developer-guide.md index a07de697..8a21d2d2 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -19,10 +19,18 @@ git clone https://github.com/spacious-team/investbook.git ### Установка Wix Для сборки пакета для установки Investbook требуется Wix 3. -Скачать Wix 3 можно по ссылке с официального сайта [Wix](https://wixtoolset.org/docs/wix3/) +Скачать Wix 3 можно по ссылке с официального сайта [Wix3](https://wixtoolset.org/docs/wix3/) (пакет для установки расположен на [GitHub](https://github.com/wixtoolset/wix3/releases)). Wix в свою очередь потребует установки [.NET](https://dotnet.microsoft.com/en-us/download/dotnet). +На Windows вы можете установить Wix и .NET в `%LOCALAPPDATA%\Programs\wix3` и `%LOCALAPPDATA%\Programs\dotnet` +соответственно. В этом случае добавьте следующие переменные окружения +(win+R -> `rundll32 sysdm.cpl,EditEnvironmentVariables`): +```shell +DOTNET_ROOT=%LOCALAPPDATA%\Programs\dotnet +PATH=<предыдущие значения>;%DOTNET_ROOT%;%LOCALAPPDATA%\Programs\wix3 +``` + ### Компиляция Компиляция запускается командой: ``` diff --git a/pom.xml b/pom.xml index 3599630e..41b9165d 100644 --- a/pom.xml +++ b/pom.xml @@ -453,6 +453,7 @@ + org.panteleyev jpackage-maven-plugin 1.2.1 @@ -493,6 +494,7 @@ ${project.basedir}/src/main/assembly/jpackage/icon.ico ${project.build.directory}/jpackage true + true true Investbook true From 19aa65fde464df8016226e5b4f7d24dc01a8eabd Mon Sep 17 00:00:00 2001 From: vananiev Date: Sun, 17 Nov 2024 00:41:46 +0300 Subject: [PATCH 3/5] fix app properties location --- .../investbook/loadingpage/LoadingPageServerUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/investbook/loadingpage/LoadingPageServerUtils.java b/src/main/java/ru/investbook/loadingpage/LoadingPageServerUtils.java index 82ee9e98..1892d867 100644 --- a/src/main/java/ru/investbook/loadingpage/LoadingPageServerUtils.java +++ b/src/main/java/ru/investbook/loadingpage/LoadingPageServerUtils.java @@ -36,7 +36,8 @@ @UtilityClass public class LoadingPageServerUtils { - private static final String CONF_PROPERTIES = "application-conf.properties"; + private static final String CONF_PROPERTIES = "app/application-conf.properties"; + private static final String RESOURCE_CONF_PROPERTIES = "application-conf.properties"; public static int getMainAppPort() { try { @@ -44,7 +45,7 @@ public static int getMainAppPort() { String value = properties.getProperty("server.port", "2030"); return Integer.parseInt(value); } catch (Exception e) { - log.warn("Can't find 'server.port' property, fallback to default value: 2030"); + log.warn("Can't find 'server.port' property, fallback to default value: 2030", e); return 2030; } } @@ -55,7 +56,7 @@ public static boolean shouldOpenHomePageAfterStart() { String value = properties.getProperty("investbook.open-home-page-after-start", "true"); return Boolean.parseBoolean(value); } catch (Exception e) { - log.warn("Can't find 'investbook.open-home-page-after-start' fallback to default value: true"); + log.warn("Can't find 'investbook.open-home-page-after-start' fallback to default value: true", e); return true; } } @@ -67,7 +68,7 @@ private static Properties loadProperties() throws IOException { properties.load(reader); } catch (Exception e) { // Properties file is not found in app installation path, read default file from class path - try (InputStream in = requireNonNull(LoadingPageServerUtils.class.getResourceAsStream(CONF_PROPERTIES)); + try (InputStream in = requireNonNull(LoadingPageServerUtils.class.getResourceAsStream(RESOURCE_CONF_PROPERTIES)); Reader reader = new InputStreamReader(in, UTF_8)) { properties.load(reader); } From 6ede5bde85ef6644fa4004218e0f449431f1e689 Mon Sep 17 00:00:00 2001 From: vananiev Date: Sun, 17 Nov 2024 01:09:51 +0300 Subject: [PATCH 4/5] update jpackage-maven-plugin --- pom.xml | 7 +++---- src/main/assembly/jpackage/dir.xml | 6 +++++- src/main/assembly/zip/zip.xml | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 41b9165d..a49b4ed0 100644 --- a/pom.xml +++ b/pom.xml @@ -456,7 +456,7 @@ org.panteleyev jpackage-maven-plugin - 1.2.1 + 1.6.4 windows installer @@ -470,9 +470,8 @@ ${win.msi.version} Spacious Team ${project.description} - InvestBook, Copyright (C) 2020 Spacious Team - (https://github.com/spacious-team) - + InvestBook, Copyright (C) 2020 Spacious Team + https://github.com/spacious-team/investbook ${project.artifactId}-${project.version}.jar -Dloader.path=./app/extensions diff --git a/src/main/assembly/jpackage/dir.xml b/src/main/assembly/jpackage/dir.xml index e1ec0ece..faf54612 100644 --- a/src/main/assembly/jpackage/dir.xml +++ b/src/main/assembly/jpackage/dir.xml @@ -46,13 +46,17 @@ - src/main/assembly/zip/extensions/README.md + src/main/assembly/jpackage/extensions/README.md extensions README.md + + README-en.md + + LICENSE diff --git a/src/main/assembly/zip/zip.xml b/src/main/assembly/zip/zip.xml index b6344352..8c05a733 100644 --- a/src/main/assembly/zip/zip.xml +++ b/src/main/assembly/zip/zip.xml @@ -52,6 +52,10 @@ README.md + + README-en.md + + LICENSE From 7997615a3443128220834491820e0271b4e6302c Mon Sep 17 00:00:00 2001 From: vananiev Date: Sun, 17 Nov 2024 01:11:20 +0300 Subject: [PATCH 5/5] clarify jpackage-maven-plugin configuration --- pom.xml | 4 ++-- src/main/assembly/jpackage/dir.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a49b4ed0..ee610374 100644 --- a/pom.xml +++ b/pom.xml @@ -489,9 +489,9 @@ --spring.config.additional-location=file:./app/ - ${project.build.directory}/jpackage/jpackage/ + ${project.build.directory}/jpackage/input ${project.basedir}/src/main/assembly/jpackage/icon.ico - ${project.build.directory}/jpackage + ${project.build.directory}/jpackage/output true true true diff --git a/src/main/assembly/jpackage/dir.xml b/src/main/assembly/jpackage/dir.xml index faf54612..1b0e8581 100644 --- a/src/main/assembly/jpackage/dir.xml +++ b/src/main/assembly/jpackage/dir.xml @@ -23,6 +23,7 @@ dir + input src/main/assembly/jpackage