Skip to content

Commit f75bb3f

Browse files
authored
Merge pull request #240 from json-scada/master
Version 0.56-alpha
2 parents 28874eb + 39e7cb0 commit f75bb3f

24 files changed

+2349
-2472
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
4848
- MongoDB as the real-time core database, persistence layer, config store, SOE historian.
4949
- Event-based realtime async data processing with MongoDB Change Streams.
5050
- Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM.
51-
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.55-alpha).
51+
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.56-alpha).
5252
- Unlimited tags, servers, and users.
5353
- Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments.
5454
- Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node.
@@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
9090
## Documentation
9191

9292
- [Generic Install Guide](https://github.com/riclolsen/json-scada/blob/master/docs/install.md)
93-
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.55-alpha)
93+
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.56-alpha)
9494
- [RedHat/Rocky Linux Installer Script](https://github.com/riclolsen/json-scada/blob/master/docs/install.md#rhel94-and-compatible-systems-automated-installation)
9595
- [Ubuntu Linux Installer Script](https://github.com/riclolsen/json-scada/blob/master/docs/install.md#ubuntu-2404-scripted-installation)
9696
- [Generic Install Guide](https://github.com/riclolsen/json-scada/blob/master/docs/install.md)

index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
4848
- MongoDB as the real-time core database, persistence layer, config store, SOE historian.
4949
- Event-based realtime async data processing with MongoDB Change Streams.
5050
- Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM.
51-
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.55-alpha).
51+
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.56-alpha).
5252
- Unlimited tags, servers, and users.
5353
- Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments.
5454
- Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node.
@@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
9090
## Documentation
9191

9292
- [Generic Install Guide](docs/install.md)
93-
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.55-alpha)
93+
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.56-alpha)
9494
- [RedHat/Rocky Linux Installer Script](docs/install.md#rhel94-and-compatible-systems-automated-installation)
9595
- [Ubuntu Linux Installer Script](docs/install.md#ubuntu-2404-scripted-installation)
9696
- [Generic Install Guide](docs/install.md)

platform-windows/json-scada.nsi

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ RequestExecutionLevel admin
2121

2222
;--------------------------------
2323

24-
!define VERSION "v.0.55"
25-
!define VERSION_ "0.55.0.0"
24+
!define VERSION "v.0.56"
25+
!define VERSION_ "0.56.0.0"
2626

2727
Function .onInit
2828
System::Call 'keexrnel32::CreateMutexA(p0, i1, t "MutexJsonScadaInstall")?e'
@@ -277,8 +277,8 @@ SetRegView 64
277277
Sleep 1000
278278
ExecWait 'msiexec /i "$INSTDIR\platform-windows\OPC Core Components Redistributable (x64) 3.00.108.msi" /qn'
279279
Sleep 1000
280-
; WMIC required for postgresql injection batch files
281-
ExecWait 'DISM /Online /Add-Capability /CapabilityName:WMIC'
280+
; WMIC was previously installed for postgresql injection batch files but WMIC is deprecated.
281+
; We use PowerShell helpers (shipped with the installer) instead of WMIC. No DISM install attempted.
282282
Sleep 1000
283283

284284
SetOutPath $INSTDIR\platform-windows\nodejs-runtime
@@ -799,20 +799,10 @@ Section "Uninstall"
799799
ExecWait '"$0" /C "$INSTDIR\platform-windows\postgresql-stop.bat"'
800800
ExecWait '"$0" /C "$INSTDIR\platform-windows\stop_services.bat"'
801801
Sleep 5000
802-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\sql\\%'" CALL TERMINATE`
803-
Sleep 1000
804-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\jdk-runtime\\bin\\%'" CALL TERMINATE`
805-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\grafana-runtime\\bin\\%'" CALL TERMINATE`
806-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nginx_php-runtime\\php\\%'" CALL TERMINATE`
807-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nginx_php-runtime\\%'" CALL TERMINATE`
808-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nodejs-runtime\\%'" CALL TERMINATE`
809-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\browser-runtime\\%'" CALL TERMINATE`
810-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\mongodb-runtime\\%'" CALL TERMINATE`
811-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\inkscape-runtime\\%'" CALL TERMINATE`
812-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\%'" CALL TERMINATE`
813-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%..\\platform-windows\\%'" CALL TERMINATE`
814-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\bin\\%'" CALL TERMINATE`
815-
ExecWait `wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\sql\\%'" CALL TERMINATE`
802+
; Replaced WMIC calls with a PowerShell helper script that uses Get-CimInstance/Invoke-CimMethod
803+
; The installer will call remove_services.bat which in turn invokes
804+
; kill_processes_by_pattern.ps1 to find and terminate processes by commandline pattern.
805+
; This avoids using the deprecated WMIC tool.
816806
Sleep 5000
817807
ExecWait '"$0" /C "$INSTDIR\platform-windows\remove_services.bat"'
818808
Sleep 5000
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string[]]$Patterns
4+
)
5+
6+
# For each pattern, find processes where CommandLine contains the pattern, then terminate them.
7+
# Uses CIM (Get-CimInstance) instead of WMIC. Works on PowerShell 5.1 and later.
8+
9+
$errors = @()
10+
foreach ($p in $Patterns) {
11+
try {
12+
# Escape single quotes in pattern for WQL-like contains by using simple substring match in PowerShell
13+
$pat = $p
14+
$matches = Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -and ($_.CommandLine -like "*$pat*") }
15+
foreach ($proc in $matches) {
16+
try {
17+
Write-Host "Terminating pid=$($proc.ProcessId) cmdline='$($proc.CommandLine)'"
18+
$rc = $proc | Invoke-CimMethod -MethodName Terminate
19+
if ($rc.ReturnValue -ne 0) { Write-Warning "Terminate returned $($rc.ReturnValue) for pid $($proc.ProcessId)" }
20+
} catch {
21+
Write-Warning "Failed to terminate pid $($proc.ProcessId): $_"
22+
$errors += $_
23+
}
24+
}
25+
} catch {
26+
Write-Warning "Error querying processes for pattern '$p': $_"
27+
$errors += $_
28+
}
29+
}
30+
31+
if ($errors.Count -gt 0) { exit 2 } else { exit 0 }

platform-windows/release_notes.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,33 @@ Inkscape+SAGE:
135135

136136
-------------------------------------------------------------------
137137

138+
Notes for version 0.56:
139+
140+
* Removed Windows WMIC command dependencies.
141+
* MongoDB Community Server updated to 8.2.1.
142+
* MongoDB Compass updated to 1.47.1.
143+
* Grafana updated to 12.2.0.
144+
* NPM packages updated.
145+
146+
To quickly run the system after installed, open the JSON-SCADA desktop folder and:
147+
148+
* On the JSON-SCADA desktop folder: execute "_Start_Services".
149+
* On the JSON-SCADA desktop folder: execute "_JSON SCADA WEB".
150+
* Default login credentials: username=admin password=jsonscada.
151+
* Metabase credentials: [email protected] password=jsonscada123.
152+
153+
Requirements and recommendations:
154+
155+
* Windows 10/11 64 bits or Server >=2019, Windows PowerShell. At least 12GB RAM and 30GB of free space in the "C:" drive.
156+
* MongoDB requires AVX instructions on x86 CPU. Use a modern x86 CPU with 6 cores or more.
157+
* Administrative rights. Corporate Windows policies may cause problems with the creation of services and the opening of TCP ports.
158+
* Free TCP ports 6688, 6689, 27017, 5432, 80, 443, 8080, 3000, 3001, 9000, 20000. Other ports may be required for optional services and protocols.
159+
* If the server already has MongoDB, PostgreSQL, Grafana, Metabase, Nginx or another webserver, please uninstall, disable or watch out for possible conflicts.
160+
* Do not update previously installed JSON-SCADA. Please uninstall previous JSON-SCADA versions before installing a new version.
161+
* If using VirtualBox configure "paravirtualization interface"=KVM, otherwise Nodejs errors may occur.
162+
163+
-------------------------------------------------------------------
164+
138165
Notes for version 0.55:
139166

140167
* NPM and Go packages updated.

platform-windows/remove_services.bat

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@ rem Stop services
99
call stop_services.bat
1010

1111
REM FORCE STOP OF ANY ACTIVE SERVICE OR PROCESS!
12-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\sql\\%'" CALL TERMINATE
13-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\grafana-runtime\\bin\\%'" CALL TERMINATE
14-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nginx_php-runtime\\php\\%'" CALL TERMINATE
15-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nginx_php-runtime\\%'" CALL TERMINATE
16-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\nodejs-runtime\\%'" CALL TERMINATE
17-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\browser-runtime\\%'" CALL TERMINATE
18-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\mongodb-runtime\\%'" CALL TERMINATE
19-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\inkscape-runtime\\%'" CALL TERMINATE
20-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\platform-windows\\telegraf-runtime\\%'" CALL TERMINATE
21-
wmic PROCESS WHERE "COMMANDLINE LIKE '%..\\platform-windows\\%'" CALL TERMINATE
22-
wmic PROCESS WHERE "COMMANDLINE LIKE '%c:\\json-scada\\bin\\%'" CALL TERMINATE
12+
REM Use PowerShell to terminate processes matching common JSON-SCADA paths.
13+
REM WMIC is deprecated; using Get-CimInstance + Invoke-CimMethod for termination.
14+
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0kill_processes_by_pattern.ps1' \
15+
-Patterns 'c:\\\\json-scada\\\\sql\\\\','c:\\\\json-scada\\\\platform-windows\\\\grafana-runtime\\\\bin\\\\','c:\\\\json-scada\\\\platform-windows\\\\nginx_php-runtime\\\\php\\\\','c:\\\\json-scada\\\\platform-windows\\\\nginx_php-runtime\\\\','c:\\\\json-scada\\\\platform-windows\\\\nodejs-runtime\\\\','c:\\\\json-scada\\\\platform-windows\\\\browser-runtime\\\\','c:\\\\json-scada\\\\platform-windows\\\\mongodb-runtime\\\\','c:\\\\json-scada\\\\platform-windows\\\\inkscape-runtime\\\\','c:\\\\json-scada\\\\platform-windows\\\\telegraf-runtime\\\\','..\\\\platform-windows\\\\','c:\\\\json-scada\\\\bin\\\\'"
2316

2417
rem Remove service without confimation
2518

sql/process_pg_hist.bat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
@ECHO OFF
22

33
rem look for process already running, if found get out
4-
wmic process get commandline |find /I "process_pg_hist.bat" |find /C /I "cmd" |find /I "2"
5-
6-
if %ERRORLEVEL% EQU 0 GOTO END
4+
rem Get-Process -Name cmd | Where-Object {$_.CommandLine -like '*process_pg_hist.bat*'} | Measure-Object | Select-Object -ExpandProperty Count
5+
rem if %ERRORLEVEL% EQU 0 GOTO END
76

87
rem cd \json-scada\sql
98

sql/process_pg_rtdata.bat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
@ECHO OFF
22

33
rem look for process already running, if found get out
4-
wmic process get commandline |find /I "process_pg_rtdata.bat" |find /C /I "cmd" |find /I "2"
5-
6-
if %ERRORLEVEL% EQU 0 GOTO END
4+
rem Get-Process -Name cmd | Where-Object {$_.CommandLine -like '*process_pg_rtdata.bat*'} | Measure-Object | Select-Object -ExpandProperty Count
5+
rem if %ERRORLEVEL% EQU 0 GOTO END
76

87
rem cd \json-scada\sql
98

sql/terminate_pg_hist.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rem obtain pid from process, then kill it
44

55
set _pid=0
66

7-
FOR /f "tokens=3 delims=," %%G IN (' wmic process get commandline^,processid /FORMAT:csv ^|find /I "process_pg_hist.bat" ^|find /I "cmd" ^|find /V "find" ^|find /V "%~n0"') DO (
7+
FOR /F "tokens=2 delims= " %%G IN ('tasklist /V /FI "IMAGENAME eq cmd.exe" /NH /FO TABLE ^| findstr /I "process_pg_hist.bat" ^| findstr /V /I "terminate_pg_hist.bat"') DO (
88
IF %_pid% EQU 0 (
99
SET _pid=%%G
1010
GOTO BRK

sql/terminate_pg_rtdata.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rem obtain pid from process, then kill it
44

55
set _pid=0
66

7-
FOR /f "tokens=3 delims=," %%G IN (' wmic process get commandline^,processid /FORMAT:csv ^|find /I "process_pg_rtdata.bat" ^|find /I "cmd" ^|find /V "find" ^|find /V "%~n0"') DO (
7+
FOR /F "tokens=2 delims= " %%G IN ('tasklist /V /FI "IMAGENAME eq cmd.exe" /NH /FO TABLE ^| findstr /I "process_pg_rtdata.bat" ^| findstr /V /I "terminate_pg_rtdata.bat"') DO (
88
IF %_pid% EQU 0 (
99
SET _pid=%%G
1010
GOTO BRK

0 commit comments

Comments
 (0)