Skip to content

Commit

Permalink
chore: Bump to Nodejs16 (#14)
Browse files Browse the repository at this point in the history
* chore: Bump from NodeJS10 to NodeJS16

* chore:Improved NodeJS detection

* chore: check if old nodejs version exist
  • Loading branch information
cmotelet authored Feb 5, 2022
1 parent 74dfe1e commit 0a6d12c
Show file tree
Hide file tree
Showing 25 changed files with 460 additions and 166 deletions.
Binary file added NSIS/signal-k-logo-image.bmp
Binary file not shown.
253 changes: 198 additions & 55 deletions NSIS/signalk-server.nsi

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions NSIS/tools.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,52 @@ done:
Pop $R1
Exch $R0 ;output string
FunctionEnd
;=============================================================
; StrContains
; This function does a case sensitive searches for an occurrence of a substring in a string.
; It returns the substring if it is found.
; Otherwise it returns null("").
; Written by kenglish_hi
; Adapted from StrReplace written by dandaman32


Var STR_HAYSTACK
Var STR_NEEDLE
Var STR_CONTAINS_VAR_1
Var STR_CONTAINS_VAR_2
Var STR_CONTAINS_VAR_3
Var STR_CONTAINS_VAR_4
Var STR_RETURN_VAR

Function StrContains
Exch $STR_NEEDLE
Exch 1
Exch $STR_HAYSTACK
; Uncomment to debug
;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK '
StrCpy $STR_RETURN_VAR ""
StrCpy $STR_CONTAINS_VAR_1 -1
StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE
StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK
loop:
IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1
StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1
StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found
StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done
Goto loop
found:
StrCpy $STR_RETURN_VAR $STR_NEEDLE
Goto done
done:
Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the
Exch $STR_RETURN_VAR
FunctionEnd

!macro _StrContainsConstructor OUT NEEDLE HAYSTACK
Push `${HAYSTACK}`
Push `${NEEDLE}`
Call StrContains
Pop `${OUT}`
!macroend

!define StrContains '!insertmacro "_StrContainsConstructor"'
Empty file added output/.placeholder
Empty file.
51 changes: 38 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
**All in one Windows installer for Signal K server node http://signalk.org/**
**All in one Windows installer v1.0.0 for Signal K server node http://signalk.org/**

___
**Prerequisite:**
# Prerequisite
- Internet connection during setup process

**What's provide with this installer:**
- **If you have already installed Signal K** with a previous version of the installer with a version of NodeJS lower than 16,
you will see a windows like this:
![Install-SelectDir](screenshots/Install-CheckNode.png)
Please see [Upgrade NodeJS](#upgrade-nodejs) before !
- **If your current OS version is lower than Windows 10**,
NodeJS 12 will be installed instead of NodeJS 16 with limited Signal K server support ( Windows 7 is end of life ).

# What's provide with this installer
- The latest version of the Signal K server downloaded during installation.
- node js 10.23.0 ( downloaded from https://nodejs.org/dist/v10.23.0/ during installation).
- NodeJS 16.13.2 ( downloaded from https://nodejs.org/dist/v16.13.2/ during installation).
**If your current OS version is lower than Windows 10**, NodeJS 12 only will be install (https://nodejs.org/download/release/v12.22.9/)
- openssl 1.1.1h ( from https://slproweb.com/products/Win32OpenSSL.html ).
- support of X64 and X86 Windows version (Windows 10 X64 and Windows 7 X86 tested).
- All packages are installed under a root directory. You choose your root directory at the time of installation.
- Signal K can start as windows service if you choose it at the time of installation.
- You can re-run the installer several times.
- HTML installation help built with https://markdowntohtml.com/
- HTML installation help built with https://github.com/nea/MarkdownViewerPlusPlus

**How to install Signal K server node:**
# How to install Signal K server node
- Download installer at https://github.com/SignalK/signalk-server-windows/releases/latest/download/signalk-server-setup.exe
- You can verify the checksum of the exec file at https://github.com/SignalK/signalk-server-windows/releases/latest/download/SHA256SUMS.txt
`Get-FileHash .\signalk-server-setup.exe -Algorithm SHA256 | Format-List`
Expand Down Expand Up @@ -75,7 +82,7 @@ Then reopen you web browser at URL: http://localhost:3000 and enter your admin a
Then check out the website: http://signalk.org/ or https://github.com/SignalK/signalk-server-node for more informations.
Or ask for support at http://slack-invite.signalk.org/ in channel #support-windows

**Software structure:**
# Software structure
+ `c:\signalk` This is the root directory that you choosed at install. All components are under this root directory.
- `readme.html` minimal help file of installer.
- `screenshots` screenshot for the html help file.
Expand All @@ -85,34 +92,52 @@ Or ask for support at http://slack-invite.signalk.org/ in channel #support-windo
- `signalkhome` home directory of Signal K server.
- `.signalk` The configuration of your server is stored in this folder.

**The tools to manage server (located in `tools` directory):**
# The tools to manage server (located in "tools" directory)
- `SignalK-CLI.lnk` open a command line windows with environment prepared for running Signal K. You do not use it if the signalk service is running.
- `SignalK-GUI.URL` open the web GUI of Signal K server in your web browser.
- `start-signalk-server-services.cmd` start or restart the Signal K service, you must `Run as administrator` this script.
- `stop-signalk-server-services.cmd` stop the Signal K service, you must `Run as administrator` this script.
- `remove-signalk-server-services.cmd` remove the Signal K windows service, use this before delete the root directory. You must `Run as administrator` this script.
- `create-signalk-server-services.cmd` create the Signal K windows service if you didn't choose it at installation. Cannot be re-run if `tools\daemon` directory exist. You must `Run as administrator` this script.

**Delete all of your Signal K server:**
# Upgrade NodeJS
Since the installer in version 1.0.0, NodeJS is provided in version 16.
If you have already installed Signal K with a previous version (with NodeJS version 10),
it is recommended to make a new installation and then restore the configuration of your Signal K server later.
- Stop your Signal K server `stop-signalk-server-services.cmd`.
- Remove the Signal K service `remove-signalk-server-services.cmd`.
- Close all windows related to signal K.
- Rename your Signal K root directory: e.g. `c:\signalk` to `c:\signalk10`.
This way, you will keep your Signal K server configuration in a safe place.
You can also `Backup` your Signal K server configuration in GUI server: `Server` then `Backup/Restore`.
See also the tips here, about plugin compatibility: [Updating to Node.js-16](https://github.com/SignalK/signalk-server/wiki/Updating-to-Node.js-16)
- Start installer and install Signal K in the original directory: e.g. `c:\signalk`.
- Start the Signal K server and check first without any plugins.
- If everything is OK, reinstall your plugins, restore your previous configuration with the `Backup/Restore` function
or by copying the saved settings files located in `.signalk` directory from your renamed directory.

# Delete all of your Signal K server
- This installation is completely free of windows registry keys.
- First of all, if you installed as service, `Run as administrator` the `remove-signalk-server-services.cmd` script in tools dirrectory.
- You can then safely delete the root directory e.g. `c:\signalk`
- And that's all !

**Rebuild install kit:**
# Rebuild install kit
- Clone Github project: `git clone https://github.com/SignalK/signalk-server-windows.git`
- Install `nsis-3.06.1-setup.exe` located in src folder.
- Extract `nsis-3.06.1-log.zip` located in src folder.
- Copy the content of extracted files in the folder of NSIS install directory.
- Extract `NSISunzU.zip` located in src folder.
- Copy the `NSISunzU\Plugin unicode\nsisunz.dll` file of extracted files in the folder of NSIS install directory `Plugins\x86-unicode\nsisunz.dll`.
- Run NSIS.
- Open `NSIS\signalk-server.nsi` file in NSIS.
- Select `Script` `Recompile`
- The new compiled install kit is located in `output` directory.

**Credits:**
# Credits
- Openssl for Windows https://slproweb.com/products/Win32OpenSSL.html
- NodeJs https://nodejs.org/
- MarkDown to HTML https://markdowntohtml.com/
- MarkDown to HTML https://github.com/nea/MarkdownViewerPlusPlus
- Signal K http://signalk.org/
- Wget for Windows https://eternallybored.org/misc/wget/
- NodeJs windows service https://www.npmjs.com/package/node-windows
Expand Down
Binary file added screenshots/Install-CheckNode.greenshot
Binary file not shown.
Binary file added screenshots/Install-CheckNode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Finished.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Finished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Progress-Download-nodejs.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Progress-Download-nodejs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Progress-NPM-SignalK.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Progress-NPM-SignalK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Progress-NPM-node-windows.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Progress-NPM-node-windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Progress.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-SelectComponents.greenshot
Binary file not shown.
Binary file modified screenshots/Install-SelectComponents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-SelectDir.greenshot
Binary file not shown.
Binary file modified screenshots/Install-SelectDir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/Install-Welcome.greenshot
Binary file not shown.
Binary file modified screenshots/Install-Welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/NSISunzU.zip
Binary file not shown.
Loading

0 comments on commit 0a6d12c

Please sign in to comment.