Skip to content

Commit

Permalink
chore: Bump from NodeJS10 to NodeJS16
Browse files Browse the repository at this point in the history
  • Loading branch information
cmotelet committed Jan 23, 2022
1 parent 74dfe1e commit a525f96
Show file tree
Hide file tree
Showing 21 changed files with 302 additions and 126 deletions.
106 changes: 82 additions & 24 deletions NSIS/signalk-server.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
;Include tools
!include "tools.nsh"
!include x64.nsh
!include WinVer.nsh
;======================================================
;Include Modern UI
!include "MUI2.nsh"
;======================================================
;General
!define INST_VERSION "0.4.3"
!define INST_VERSION "1.0.0"
BrandingText "Signal K from http://signalk.org/"
Name "Signal K installer ${INST_VERSION}"
OutFile "..\output\signalk-server-setup-${INST_VERSION}.exe"
Expand Down Expand Up @@ -46,19 +47,30 @@
Var /GLOBAL NODE64_ORG_DIR
Var /GLOBAL NODE86_URL
Var /GLOBAL NODE86_ORG_DIR
Var /GLOBAL W7_DETECTED
Var /GLOBAL LOG_FILE

Function SetGlobalVars
LogSet on
StrCpy $USERPROFILE $INSTDIR\signalkhome
StrCpy $NODE_PATH '$INSTDIR\nodejs'
StrCpy $NODE_MODULES_PATH '$INSTDIR\nodejs\node_modules'
StrCpy $OPENSSL_PATH '$INSTDIR\openssl'
StrCpy $OPENSSL_BIN_PATH '$INSTDIR\openssl\bin'
StrCpy $OPENSSL_CONF '$INSTDIR\openssl\openssl.cnf'
StrCpy $TOOLS_PATH '$INSTDIR\tools'
StrCpy $NODE64_URL 'https://nodejs.org/dist/v10.23.0/node-v10.23.0-win-x64.zip'
StrCpy $NODE86_URL 'https://nodejs.org/dist/v10.23.0/node-v10.23.0-win-x86.zip'
StrCpy $NODE64_ORG_DIR 'node-v10.23.0-win-x64'
StrCpy $NODE86_ORG_DIR 'node-v10.23.0-win-x86'
${If} ${AtLeastWin10}
StrCpy $NODE64_URL 'https://nodejs.org/dist/v16.13.2/node-v16.13.2-win-x64.zip'
StrCpy $NODE86_URL 'https://nodejs.org/dist/v16.13.2/node-v16.13.2-win-x86.zip'
StrCpy $NODE64_ORG_DIR 'node-v16.13.2-win-x64'
StrCpy $NODE86_ORG_DIR 'node-v16.13.2-win-x86'
${Else}
StrCpy $NODE64_URL 'https://nodejs.org/download/release/v12.22.9/node-v12.22.9-win-x64.zip'
StrCpy $NODE86_URL 'https://nodejs.org/download/release/v12.22.9/node-v12.22.9-win-x86.zip'
StrCpy $NODE64_ORG_DIR 'node-v12.22.9-win-x64'
StrCpy $NODE86_ORG_DIR 'node-v12.22.9-win-x86'
StrCpy $W7_DETECTED '1'
${EndIf}
FunctionEnd

!macro CreateInternetShortcutWithIcon FILEPATH URL ICONPATH ICONINDEX
Expand All @@ -76,6 +88,10 @@
LogSet on
SetDetailsView show
LogText "Signal K installer version: ${INST_VERSION}"
${IfNot} ${AtLeastWin10}
MessageBox MB_ICONEXCLAMATION|MB_OK "Your current version of Windows is lower than Windows 10,$\nNodeJS 12 will be installed instead of NodeJS 16 with limited Signal K server support (> 1.40.0)."
LogText "Windows version < 10 detected, install NodeJS 12"
${EndIf}
LogSet off
FunctionEnd
;======================================================
Expand Down Expand Up @@ -179,14 +195,15 @@
FileOpen $9 $TOOLS_PATH\remove-signalk-server-services.cmd w
FileWrite $9 '@ECHO OFF$\r$\n'
FileWrite $9 'echo "Remove signalk as service in progress..."$\r$\n'
FileWrite $9 'net stop "signalkservernode.exe"$\r$\n'
FileWrite $9 'SC DELETE "signalkservernode.exe"$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo "An ERROR has occurred."$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

Expand All @@ -200,11 +217,11 @@
FileWrite $9 'cd $TOOLS_PATH$\r$\n'
FileWrite $9 'node .\install-signalk-server-services.js$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

Expand All @@ -214,11 +231,11 @@
FileWrite $9 'echo Stop Signal K service...$\r$\n'
FileWrite $9 'net stop "signalkservernode.exe"$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

Expand All @@ -232,59 +249,96 @@
FileWrite $9 ':ERROR_ADMIN$\r$\n'
FileWrite $9 'echo ERROR: This command must be "Run as Administrator"$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 ':STOP_SERVICE$\r$\n'
FileWrite $9 'net stop "signalkservernode.exe" >nul 2>&1$\r$\n'
FileWrite $9 'net start "signalkservernode.exe"$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR_START$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR_START$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

DetailPrint "Create $TOOLS_PATH\npm-install-node-windows.cmd"
StrCpy $LOG_FILE "npm-inst-node-windows.log"
FileOpen $9 $TOOLS_PATH\npm-install-node-windows.cmd w
FileWrite $9 '@ECHO OFF$\r$\n'
FileWrite $9 '$INSTALL_DRIVE$\r$\n'
FileWrite $9 'echo Install node-windows package in progress...$\r$\n'
FileWrite $9 'echo Install node-windows service package in progress...$\r$\n'
FileWrite $9 'echo Install log saved in $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'echo Please wait ...$\r$\n'
FileWrite $9 'set USERPROFILE=$USERPROFILE$\r$\n'
FileWrite $9 'set NODE_PATH=$NODE_PATH$\r$\n'
FileWrite $9 'set "Path=%NODE_PATH%;%Path%"$\r$\n'
FileWrite $9 'set OPENSSL_CONF=$OPENSSL_CONF$\r$\n'
FileWrite $9 'cd $NODE_PATH$\r$\n'
FileWrite $9 'npm install -g --unsafe-perm [email protected]$\r$\n'
FileWrite $9 'echo "start: npm install -g --unsafe-perm [email protected]" 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'call npm install -g --unsafe-perm [email protected] 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'echo See the $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

DetailPrint "Create $TOOLS_PATH\npm-install-signalk-server.cmd"
StrCpy $LOG_FILE "npm-inst-signalk-server.log"
FileOpen $9 $TOOLS_PATH\npm-install-signalk-server.cmd w
FileWrite $9 '@ECHO OFF$\r$\n'
FileWrite $9 '$INSTALL_DRIVE$\r$\n'
FileWrite $9 'echo Install signalk-server package in progress...$\r$\n'
FileWrite $9 'echo Install log saved in $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'echo Please wait this may take some time ...$\r$\n'
FileWrite $9 'set USERPROFILE=$USERPROFILE$\r$\n'
FileWrite $9 'set NODE_PATH=$NODE_PATH$\r$\n'
FileWrite $9 'set "Path=%NODE_PATH%;%Path%"$\r$\n'
FileWrite $9 'set OPENSSL_CONF=$OPENSSL_CONF$\r$\n'
FileWrite $9 'cd $NODE_PATH$\r$\n'
FileWrite $9 'npm install -g --unsafe-perm signalk-server$\r$\n'
FileWrite $9 'echo "start: npm install -g --unsafe-perm signalk-server" 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'call npm install -g --unsafe-perm signalk-server 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'exit 0$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'echo See the $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit 1$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9

${If} $W7_DETECTED == "1"
DetailPrint "Create $TOOLS_PATH\npm-install-serial.cmd for Windows 7"
StrCpy $LOG_FILE "npm-inst-serial.log"
FileOpen $9 $TOOLS_PATH\npm-install-serial.cmd w
FileWrite $9 '@ECHO OFF$\r$\n'
FileWrite $9 '$INSTALL_DRIVE$\r$\n'
FileWrite $9 'echo Install alternative package for serial port support in progress...$\r$\n'
FileWrite $9 'echo Install log saved in $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'echo Please wait ...$\r$\n'
FileWrite $9 'set USERPROFILE=$USERPROFILE$\r$\n'
FileWrite $9 'set NODE_PATH=$NODE_PATH$\r$\n'
FileWrite $9 'set "Path=%NODE_PATH%;%Path%"$\r$\n'
FileWrite $9 'set OPENSSL_CONF=$OPENSSL_CONF$\r$\n'
FileWrite $9 'cd $NODE_PATH$\r$\n'
FileWrite $9 'echo "start: npm install -g --unsafe-perm [email protected]" 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'call npm install -g --unsafe-perm [email protected] 1>>$INSTDIR\$LOG_FILE 2>&1$\r$\n'
FileWrite $9 'if %ERRORLEVEL% neq 0 goto :ERROR$\r$\n'
FileWrite $9 'exit /b 0$\r$\n'
FileWrite $9 ':ERROR$\r$\n'
FileWrite $9 'echo An ERROR has occurred.$\r$\n'
FileWrite $9 'echo See the $INSTDIR\$LOG_FILE file$\r$\n'
FileWrite $9 'pause$\r$\n'
FileWrite $9 'exit /b 1$\r$\n'
FileWrite $9 '$\r$\n'
FileClose $9
${EndIf}

DetailPrint "Create $TOOLS_PATH\SignalK-CLI.lnk"
CreateShortCut "$TOOLS_PATH\SignalK-CLI.lnk" "cmd" \
"/k $TOOLS_PATH\signalk-server-cli.cmd" "$TOOLS_PATH\signalk.ico" 0 SW_SHOWNORMAL \
Expand All @@ -311,7 +365,7 @@
DetailPrint "Download nodejs 32-bits"
LogText "Download nodejs 32-bits from $NODE86_URL"
ExecWait '"$INSTDIR\wget.exe" "--output-document=$INSTDIR\nodejs.zip" "$NODE86_URL"' $0
${EndIf}
${EndIf}
${If} ${Errors}
MessageBox MB_OK "Download nodejs failed with code: $0"
LogText "Download nodejs failed whith code: $0"
Expand All @@ -330,7 +384,7 @@
Rename $INSTDIR\$NODE64_ORG_DIR $INSTDIR\nodejs
${Else}
Rename $INSTDIR\$NODE86_ORG_DIR $INSTDIR\nodejs
${EndIf}
${EndIf}
Delete "$INSTDIR\nodejs.zip"
Delete "$INSTDIR\wget.exe"
SectionEnd
Expand All @@ -346,7 +400,7 @@
${Else}
DetailPrint "Extract openssl 32-bits"
File /r "..\target\openssl-x86\*.*"
${EndIf}
${EndIf}
SectionEnd

Section "Generate tools" SecTools
Expand All @@ -370,6 +424,10 @@
Section "install signalk-server" SecSkInstall
LogSet on
Call SetGlobalVars
${If} $W7_DETECTED == "1"
ExecWait '"$TOOLS_PATH\npm-install-serial.cmd"' $0
DetailPrint "npm install -g --unsafe-perm [email protected] returned $0"
${EndIf}
ExecWait '"$TOOLS_PATH\npm-install-signalk-server.cmd"' $0
DetailPrint "npm install -g --unsafe-perm signalk-server returned $0"
SectionEnd
Expand Down
Empty file added output/.placeholder
Empty file.
32 changes: 28 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
**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:**
- Internet connection during setup process
- **If you have already installed Signal K** with a previous installer version < 1.0.0 (included NodeJS in version 10),
see [Upgrade from NodeJS10 / Installer 0.4.3](#Upgrade) 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:**
- Download installer at https://github.com/SignalK/signalk-server-windows/releases/latest/download/signalk-server-setup.exe
Expand Down Expand Up @@ -93,6 +98,23 @@ Or ask for support at http://slack-invite.signalk.org/ in channel #support-windo
- `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.

{#Upgrade}**Upgrade from NodeJS10 / Installer 0.4.3 and below**

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.
Expand All @@ -104,6 +126,8 @@ Or ask for support at http://slack-invite.signalk.org/ in channel #support-windo
- 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`
Expand All @@ -112,7 +136,7 @@ Or ask for support at http://slack-invite.signalk.org/ in channel #support-windo
**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 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 a525f96

Please sign in to comment.