Skip to content

Commit

Permalink
feat: add Microsoft VC++ runtime redistributable (#18)
Browse files Browse the repository at this point in the history
* feat: add Microsoft VC++ runtime redistributable

* feat: download VC_redist.x64.exe vs embedded

* feat: readme update
  • Loading branch information
cmotelet authored Aug 25, 2024
1 parent dddec93 commit dd0ec68
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 25 deletions.
69 changes: 51 additions & 18 deletions NSIS/signalk-server.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
!include "MUI2.nsh"
;======================================================
;General
!define INST_VERSION "1.1.0"
!define INST_VERSION "1.2.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 @@ -58,15 +58,14 @@
Var /GLOBAL NODE64_ORG_DIR
Var /GLOBAL NODE86_URL
Var /GLOBAL NODE86_ORG_DIR
Var /GLOBAL W7_DETECTED
Var /GLOBAL LOG_FILE
Var /GLOBAL NODE_INSTALLED
Var /GLOBAL NODE_INSTALL
Var /GLOBAL NODE_UPGRADE
Var /GLOBAL NODE_SHORT_VERSION
Var /GLOBAL NODE_VERSION
Var /GLOBAL SIGNALK_NODE_CONFIG_DIR

Function SetGlobalVars
LogSet on
StrCpy $USERPROFILE $INSTDIR\signalkhome
Expand All @@ -85,8 +84,6 @@
StrCpy $NODE86_ORG_DIR 'node-v18.17.1-win-x86'
StrCpy $NODE_VERSION 'v18.17.1'
StrCpy $NODE_SHORT_VERSION 'v18'
${Else}
StrCpy $W7_DETECTED '1'
${EndIf}
FunctionEnd

Expand All @@ -99,19 +96,6 @@
WriteINIStr "${FILEPATH}" "{000214A0-0000-0000-C000-000000000046}" "Prop3" "19,2"
!macroend

;======================================================
Function .onInit
SetOutPath $INSTDIR
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,$\nOperating System version prior to Windows 10 are no longer supported with recent versions of Signal K server. "
LogText "Windows version < 10 detected, installation cancelled "
Abort
${EndIf}
LogSet off
FunctionEnd
;======================================================
Function GenToolsFiles
StrCpy $0 "$INSTDIR"
Expand Down Expand Up @@ -376,6 +360,25 @@
!insertmacro CreateInternetShortcutWithIcon "$TOOLS_PATH\SignalK GUI.URL" "http://localhost:3000" "$TOOLS_PATH\signalk.ico" 0
FunctionEnd
;======================================================
Section "Visual C++ Runtime" SecVCruntime64
; SectionIn RO
LogSet on
SetDetailsView show
SetOutPath $INSTDIR
File /r ..\target\wget.exe
DetailPrint "Extract wget.exe to $INSTDIR"
ClearErrors
DetailPrint "Download VC_redist.x64.exe from https://aka.ms/vs/17/release/vc_redist.x64.exe"
ExecWait '"$INSTDIR\wget.exe" "--output-document=$INSTDIR\vc_redist.x64.exe" "https://aka.ms/vs/17/release/vc_redist.x64.exe"' $0
${If} ${FileExists} "$INSTDIR\vc_redist.x64.exe"
ExecWait "$INSTDIR\vc_redist.x64.exe" $0
ClearErrors
Delete "$INSTDIR\vc_redist.x64.exe"
ClearErrors
${EndIf}
Delete "$INSTDIR\wget.exe"
SectionEnd

Section "Extract nodejs" SecExtractJS
LogSet on
SetDetailsView show
Expand Down Expand Up @@ -508,6 +511,7 @@ SectionGroupEnd

;======================================================
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecVCruntime64} "Install Microsoft redistributable VC++ runtime files (required for OpenSSL)"
!insertmacro MUI_DESCRIPTION_TEXT ${SecExtractJS} "Download and extract node js binary and library, mandatory for running Signal K (Internet access required)"
!insertmacro MUI_DESCRIPTION_TEXT ${SecExtractSSL} "Extract OpenSSL binary and library (mandatory for running Signal K with https)"
!insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Generate startup scripts, home dir and tools for running Signal K on Windows OS (mandatory for running Signal K)"
Expand All @@ -520,6 +524,10 @@ SectionGroupEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;======================================================
Function .onSelChange
${If} $0 == ${SecVCruntime64}
SectionSetFlags ${SecVCruntime64} ${SF_SELECTED}
Return
${EndIf}
${If} $0 != ${SecSkService}
Return
${EndIf}
Expand Down Expand Up @@ -584,3 +592,28 @@ Function nodejsAlertPre
done:
LogText "NODE_INSTALL: '$NODE_INSTALL' NODE_UPGRADE: '$NODE_UPGRADE'"
FunctionEnd
;======================================================
Function .onInit
SetOutPath $INSTDIR
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,$\nOperating System version prior to Windows 10 are no longer supported with recent versions of Signal K server. "
LogText "Windows version < 10 detected, installation cancelled "
Abort
${EndIf}
${If} ${RunningX64}
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Major"
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Version"
${If} $0 == 14
LogText "Visual Studio Runtime $1 already installed"
SectionSetText ${SecVCruntime64} ""
!insertmacro UnSelectSection ${SecVCruntime64}
${Else}
LogText "Visual Studio Runtime 14 Not found, install now selected"
SectionSetFlags ${SecVCruntime64} ${SF_SELECTED}
${EndIf}
${EndIf}
LogSet off
FunctionEnd
12 changes: 9 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**All in one Windows installer v1.1.0 for Signal K server node http://signalk.org/**
**All in one Windows installer v1.2.0 for Signal K server node http://signalk.org/**

___
# Prerequisite
Expand All @@ -14,7 +14,8 @@ Operating System version prior to Windows 10 are no longer supported with recent
- The latest version of the Signal K server downloaded during installation.
- NodeJS 18.17.1 ( downloaded from https://nodejs.org/dist/v18.17.1/ during installation).
- openssl 1.1.1u ( from https://slproweb.com/products/Win32OpenSSL.html ).
- support of X64 and X86 Windows version (Windows 10 X64).
- Microsoft Visual C++ 2015 - 2022 Redistributable ( downloaded from https://aka.ms/vs/17/release/vc_redist.x64.exe during installation).
- Support of X64 and X86 Windows version (Windows 10/11 X64).
- 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.
Expand All @@ -40,6 +41,11 @@ The `Signal K as services` option is selected by default, this is the most inter
![Install-SelectComponents](screenshots/Install-SelectComponents.png)

- Then click `Install` button
If required, Microsoft Visual C++ Redistributable will be downloaded from the Microsoft web site and installed.
And if this windows appear, please accept licence terms and click on the "Install" button.
![Install-MSVC](screenshots/Install-MSVC.png)

- Next step `Install` NodeJS
![Install-Progress](screenshots/Install-Progress.png)

- Several windows will open successively during the installation.
Expand All @@ -65,7 +71,7 @@ If you have select `Desktop shortcuts`, you will find at least 1 icons on your d

- `Start Signal K Service` icon will start the Signal K service, you must `Run as administrator` this icon.
If you don't want to have to select every time `Run as Administrator`, in properties of the shortcut, you have a options button `Advanced...`, click and then select `Run as administrator`.
After that, You will just have to answer `Yes` on the UAC (User Access Control) question when you clic on this icon.
After that, You will just have to answer `Yes` on the UAC (User Access Control) question when you click on this icon.
- `SignalK-GUI` icon open the web GUI of Signal K server in your web browser.
- `Signal K CLI` icon will open a command line windows with environment prepared for running Signal K.
This shortcut is most for advanced users.
Expand Down
Binary file added screenshots/Install-MSVC.greenshot
Binary file not shown.
Binary file added screenshots/Install-MSVC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions target/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>
<body>
<p>
<strong>All in one Windows installer v1.1.0 for Signal K server node <a href="http://signalk.org/">http://signalk.org/</a></strong>
<strong>All in one Windows installer v1.2.0 for Signal K server node <a href="http://signalk.org/">http://signalk.org/</a></strong>
</p>
<hr />
<h1 id="prerequisite">Prerequisite</h1>
Expand All @@ -34,7 +34,8 @@ <h1 id="whats-provide-with-this-installer">What's provide with this installer</h
<li>The latest version of the Signal K server downloaded during installation.</li>
<li>NodeJS 18.17.1 ( downloaded from <a href="https://nodejs.org/dist/v18.17.1/">https://nodejs.org/dist/v18.17.1/</a> during installation).</li>
<li>openssl 1.1.1u ( from <a href="https://slproweb.com/products/Win32OpenSSL.html">https://slproweb.com/products/Win32OpenSSL.html</a> ).</li>
<li>support of X64 and X86 Windows version (Windows 10 X64).</li>
<li>Microsoft Visual C++ 2015 - 2022 Redistributable ( downloaded from <a href="https://aka.ms/vs/17/release/vc_redist.x64.exe">https://aka.ms/vs/17/release/vc_redist.x64.exe</a> during installation).</li>
<li>Support of X64 and X86 Windows version (Windows 10/11 X64).</li>
<li>All packages are installed under a root directory. You choose your root directory at the time of installation.</li>
<li>Signal K can start as windows service if you choose it at the time of installation.</li>
<li>You can re-run the installer several times.</li>
Expand Down Expand Up @@ -64,7 +65,12 @@ <h1 id="how-to-install-signal-k-server-node">How to install Signal K server node
The <code>Signal K as services</code> option is selected by default, this is the most interesting option for all users. If you deselect this option, you will have to keep a Windows command line open to run the server.<br /><img src="screenshots/Install-SelectComponents.png" alt="Install-SelectComponents" /></p>
</li>
<li>
<p>Then click <code>Install</code> button<br /><img src="screenshots/Install-Progress.png" alt="Install-Progress" /></p>
<p>Then click <code>Install</code> button<br />
If required, Microsoft Visual C++ Redistributable will be downloaded from the Microsoft web site and installed.<br />
And if this windows appear, please accept licence terms and click on the "Install" button.<br /><img src="screenshots/Install-MSVC.png" alt="Install-MSVC" /></p>
</li>
<li>
<p>Next step <code>Install</code> NodeJS<br /><img src="screenshots/Install-Progress.png" alt="Install-Progress" /></p>
</li>
<li>
<p>Several windows will open successively during the installation.<br /><img src="screenshots/Install-Progress-Download-nodejs.png" alt="Install-Progress-Download-nodejs" /><br /><img src="screenshots/Install-Progress-NPM-node-windows.png" alt="Install-Progress-NPM-node-windows" /><br /><img src="screenshots/Install-Progress-NPM-SignalK.png" alt="Install-Progress-NPM-SignalK" /><br /><img src="screenshots/Install-Progress-openssl-certificate.png" alt="Install-Progress-openssl-certificate" /></p>
Expand All @@ -89,7 +95,7 @@ <h1 id="how-to-install-signal-k-server-node">How to install Signal K server node
<li>
<code>Start Signal K Service</code> icon will start the Signal K service, you must <code>Run as administrator</code> this icon.<br />
If you don't want to have to select every time <code>Run as Administrator</code>, in properties of the shortcut, you have a options button <code>Advanced...</code>, click and then select <code>Run as administrator</code>.<br />
After that, You will just have to answer <code>Yes</code> on the UAC (User Access Control) question when you clic on this icon.</li>
After that, You will just have to answer <code>Yes</code> on the UAC (User Access Control) question when you click on this icon.</li>
<li>
<code>SignalK-GUI</code> icon open the web GUI of Signal K server in your web browser.</li>
<li>
Expand Down

0 comments on commit dd0ec68

Please sign in to comment.