Fix installer

This commit is contained in:
Claude Brisson
2024-04-12 20:27:54 +02:00
parent bd6a9cebda
commit 51f642a2d0
10 changed files with 31 additions and 10 deletions

View File

@@ -1,23 +1,23 @@
#!/bin/bash
VERSION=$(grep '<version>' ../pom.xml | head -1 | egrep -o '[0-9.]+')
echo Generating installer script for pairgoth-$VERSION
# root files
# cleanup
rm -rf target/*
# parse version
VERSION=$(grep '<version>' ../pom.xml | head -1 | egrep -o '[0-9.]+')
# files
cp -r resources/files target
# icon
cp resources/pairgoth.ico target/files
# java library
mkdir -p target/files/lib
cp resources/pairgoth.ico target/files
cp ../application/target/pairgoth-engine.jar target/files/lib
cp -r resources/data target/data
# jre
unzip -d target/files resources/jre.zip
# installer script
sed -r -e "s/@VERSION@/$VERSION.0.0/g" resources/installer.nsi > target/installer.nsi
cat target/installer.nsi | makensis -V4 -

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
jre\bin\java.exe lib\pairgoth-engine.jar

View File

@@ -1,2 +0,0 @@
auth = none

View File

@@ -16,6 +16,7 @@
!define INSTALL_DIR "$PROGRAMFILES64\${APP_NAME}"
!define INSTALL_TYPE "SetShellVarContext all"
!define DATA_DIR "$LocalAppdata\Pairgoth"
!define REG_ROOT "HKLM"
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
@@ -86,6 +87,11 @@ InstallDir "${INSTALL_DIR}"
######################################################################
!include "StrFunc.nsh"
${Using:StrFunc} StrRep
######################################################################
Section -MainProgram
${INSTALL_TYPE}
@@ -93,6 +99,20 @@ Section -MainProgram
SetOutPath "$INSTDIR"
File /r "target/files/"
${StrRep} $1 "${DATA_DIR}" "\" "/"
FileOpen $0 "pairgoth.properties" w
FileWrite $0 "auth = none"
FileWrite $0 "$\r$\n"
FileWrite $0 "store.file.path = $1/tournamentfiles"
FileWrite $0 "$\r$\n"
FileWrite $0 "ratings.path = $1/ratings"
FileWrite $0 "$\r$\n"
FileClose $0
SetOutPath "${DATA_DIR}"
File /r "target/data/"
SetOutPath "$INSTDIR"
SectionEnd
######################################################################