From eaad3bce270fd6fb9f69af846248c66860723703 Mon Sep 17 00:00:00 2001 From: Tamas Cseh Date: Tue, 19 Jan 2021 19:44:39 +0100 Subject: [PATCH] Add: NSIS installer --- CHANGELOG.md | 5 +++++ README.md | 7 ++++++- installer/install.nsi | 29 +++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 installer/install.nsi diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b229b5..503a3c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [2.3.0] - 2021-01-19 +### Added +- Installer +- Support latest rFactor2 release + ## [2.2.0] - 2021-01-19 ### Added - Add countdown timer to lap limited multiplayer race events diff --git a/README.md b/README.md index 07fcddb..0492b18 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,17 @@ In this repository you can find small modifications for the new rFactor 2 UI - Open zip archive `net.rfactor2.ui.framework.jar` - Go to`static\framework` - Copy here `dist/scripts/better-ui.js` -- Copy `dist/rf2-better-ui` to `better-ui` +- Copy `dist/rf2-better-ui` to `rf2-better-ui` - Edit `main-xxxx.js` file - Append code at the end:
``` require(["./framework/better-ui"]); ``` +# How to create an installer +- Create the jar file as it's described above +- Put the jar file into folder `dist/jar` +- Use the NSIS compiler (MakeNSISW) to compile `installer/install.nsi` +- The installer will be located at `dist/installer` Swagger UI location: https://amdatu.org/components/amdatu-web/ diff --git a/installer/install.nsi b/installer/install.nsi new file mode 100644 index 0000000..6aec262 --- /dev/null +++ b/installer/install.nsi @@ -0,0 +1,29 @@ +# name the installer +OutFile "..\\dist\\installer\\Better-UI.exe" + +Var rFLocation +Var backupDir + +# default section start; every NSIS script has at least one section. +Section + +# read the value from the registry into the $0 register +SetRegView 64 +ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 365960" 'InstallLocation' +StrCpy $rfLocation $0 +DetailPrint "rFactor 2 location: $rfLocation" + +# define the output path for this file +SetOutPath $rfLocation\Bin\Bundles + +# First create a backup +StrCpy $backupDir $rfLocation\Bin\Backup +DetailPrint "Creating backups in folder: $backupDir" +CreateDirectory $backupDir +CopyFiles $rfLocation\Bin\Bundles\net.rfactor2.ui.framework.jar $backupDir + +# define what to install and place it in the output path +File ..\dist\jar\*.jar + +# default section end +SectionEnd diff --git a/package-lock.json b/package-lock.json index 6c39477..91483d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rf2-better-ui", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9df0397..67abb01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rf2-better-ui", - "version": "2.2.0", + "version": "2.3.0", "scripts": { "ng": "ng", "start": "ng serve --live-reload=false",