aaden-cli 1.6.85 → 1.6.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- @echo off
2
-
3
- wsl.exe --distribution Ubuntu-22.04 --exec dbus-launch true
4
- wsl.exe --distribution Ubuntu-22.04
1
+ @echo off
2
+
3
+ wsl.exe --distribution Ubuntu-22.04 --exec dbus-launch true
4
+ wsl.exe --distribution Ubuntu-22.04
@@ -76,7 +76,7 @@ PHP
76
76
  $tseDir/AadenTseServiceRegister.exe restart
77
77
 
78
78
  else
79
- echo "当前系统为Windows系统,更新TSE请使用 aaden-cli update-tse"
79
+ echo "当前系统为Linux系统,更新TSE请使用 aaden-cli update-tse"
80
80
  exit 1
81
81
  fi
82
82
 
@@ -0,0 +1,65 @@
1
+ #!/bin/bash
2
+
3
+ # 设置下载和安装目录
4
+ DOWNLOAD_DIR="/home/aaden"
5
+ INSTALL_DIR="$DOWNLOAD_DIR/aaden-spring-broadcast"
6
+ DOWNLOAD_URL="https://innerken.com/Download/aaden-spring-broadcast.zip"
7
+ ZIP_FILE="$DOWNLOAD_DIR/aaden-spring-broadcast.zip"
8
+
9
+ # 创建下载和安装目录(如果不存在)
10
+ echo "创建下载目录: $DOWNLOAD_DIR"
11
+ mkdir -p "$DOWNLOAD_DIR"
12
+ echo "创建安装目录: $INSTALL_DIR"
13
+ mkdir -p "$INSTALL_DIR"
14
+
15
+ # 下载程序包
16
+ echo "开始从 $DOWNLOAD_URL 下载程序包到 $DOWNLOAD_DIR 目录..."
17
+ if command -v wget > /dev/null; then
18
+ wget -O "$ZIP_FILE" "$DOWNLOAD_URL"
19
+ elif command -v curl > /dev/null; then
20
+ curl -L -o "$ZIP_FILE" "$DOWNLOAD_URL"
21
+ else
22
+ echo "错误:未安装wget或curl,无法下载文件。请安装其中一个工具后重试。"
23
+ exit 1
24
+ fi
25
+
26
+ if [ $? -ne 0 ]; then
27
+ echo "错误:下载程序包失败。"
28
+ exit 1
29
+ fi
30
+ echo "程序包下载完成。"
31
+
32
+ # 解压程序包
33
+ echo "正在解压程序包到 $INSTALL_DIR..."
34
+ if command -v unzip > /dev/null; then
35
+ unzip -o "$ZIP_FILE" -d "$INSTALL_DIR"
36
+ else
37
+ echo "错误:未安装unzip工具。正在尝试安装..."
38
+ if command -v apt-get > /dev/null; then
39
+ sudo apt-get update && sudo apt-get install -y unzip
40
+ unzip -o "$ZIP_FILE" -d "$INSTALL_DIR"
41
+ elif command -v yum > /dev/null; then
42
+ sudo yum install -y unzip
43
+ unzip -o "$ZIP_FILE" -d "$INSTALL_DIR"
44
+ else
45
+ echo "错误:无法安装unzip工具。请手动安装后重试。"
46
+ exit 1
47
+ fi
48
+ fi
49
+
50
+ if [ $? -ne 0 ]; then
51
+ echo "错误:解压程序包失败。"
52
+ exit 1
53
+ fi
54
+
55
+ echo "程序包解压完成。"
56
+ echo "下载文件: $ZIP_FILE"
57
+ echo "安装目录: $INSTALL_DIR"
58
+
59
+ # 设置权限
60
+ echo "设置脚本执行权限..."
61
+ chmod +x "$INSTALL_DIR/setup-service.sh"
62
+ chmod +x "$INSTALL_DIR/change-ip.sh"
63
+ chmod +x "$INSTALL_DIR/uninstall-service.sh"
64
+
65
+ echo "安装准备就绪,请进入 $INSTALL_DIR 目录并运行 ./setup-service.sh 完成服务安装。"
File without changes
File without changes
@@ -11,3 +11,4 @@ insert into ZbonCombinedRecord (zbonNumber, toTimestamp)
11
11
  values (0, current_timestamp);
12
12
  delete from MemberCardRecord where true;
13
13
  delete from CashAmountLiteral where true;
14
+ delete from ZbonLiteralData where true;
@@ -0,0 +1,165 @@
1
+ Option Explicit
2
+
3
+ ' Constant Definitions
4
+ Const ForReading = 1
5
+ Const ForWriting = 2
6
+ Const ForAppending = 8
7
+ Const CreateIfNotExist = True
8
+
9
+ ' Global Variable Declarations
10
+ Dim fso, WshShell
11
+ Set fso = CreateObject("Scripting.FileSystemObject")
12
+ Set WshShell = CreateObject("WScript.Shell")
13
+
14
+ ' File Path Definitions
15
+ Dim folderPath : folderPath = "C:\AadenPOS"
16
+ Dim batFilePath : batFilePath = folderPath & "\start-aaden-server.bat"
17
+ Dim logFilePath : logFilePath = folderPath & "\operation.log"
18
+
19
+ ' Ensure the folder exists
20
+ EnsureFolderExists folderPath, logFilePath
21
+
22
+ ' Get the current script path and startup folder path
23
+ Dim scriptPath : scriptPath = WScript.ScriptFullName
24
+ Dim startupFolderPath : startupFolderPath = WshShell.SpecialFolders("Startup")
25
+
26
+ ' Check if script is already in the startup folder
27
+ If Not IsInStartupFolder(scriptPath, startupFolderPath) Then
28
+ ' Copy the script to the startup folder
29
+ Dim targetPath
30
+ targetPath = startupFolderPath & "\" & fso.GetFileName(scriptPath)
31
+ CopySelfToStartup scriptPath, targetPath
32
+
33
+ ' Log and notify the user
34
+ WriteLog logFilePath, "Script was not in the Startup folder. Moved to: " & targetPath
35
+ Dim asciiOK
36
+ asciiOK = _
37
+ " ____ _ __ " & vbCrLf & _
38
+ " / __ \ | |/ / " & vbCrLf & _
39
+ "| | | | | ' / " & vbCrLf & _
40
+ "| | | | | < " & vbCrLf & _
41
+ "| |__| | | . \ " & vbCrLf & _
42
+ " \____/ |_|\_\ " & vbCrLf
43
+
44
+ MsgBox asciiOK & vbCrLf & "Completed successfully!" & vbCrLf & "Please restart to test. The script has been moved to:" & vbCrLf & targetPath, vbInformation, "Script Relocated"
45
+ Else
46
+ WriteLog logFilePath, "Script is correctly located in the Startup folder."
47
+ End If
48
+
49
+ ' Define the Aaden Desktop executable file path
50
+ Dim appDataPath, aadenExePath
51
+ appDataPath = WshShell.ExpandEnvironmentStrings("%LOCALAPPDATA%")
52
+ aadenExePath = appDataPath & "\Programs\aaden\Aaden Desktop.exe"
53
+
54
+ ' Expected content of the file
55
+ Dim expectedContent
56
+ expectedContent = "@echo off" & vbCrLf & _
57
+ "echo %date% %time% - Starting WSL and Aaden Desktop >> C:\AadenPOS\operation.log" & vbCrLf & _
58
+ "wsl.exe --distribution Ubuntu --exec dbus-launch true" & vbCrLf & _
59
+ "start """" /wait """ & aadenExePath & """" & vbCrLf & _
60
+ "echo %date% %time% - Aaden Desktop closed, starting WSL monitoring >> C:\AadenPOS\operation.log" & vbCrLf & _
61
+ "rem Monitor and restart WSL if it dies" & vbCrLf & _
62
+ ":monitor_loop" & vbCrLf & _
63
+ "timeout /t 60 /nobreak > nul" & vbCrLf & _
64
+ "wsl.exe --distribution Ubuntu --exec echo ""Checking WSL status..."" > nul 2>&1" & vbCrLf & _
65
+ "if %errorlevel% neq 0 (" & vbCrLf & _
66
+ " echo %date% %time% - WSL is not running. Restarting... >> C:\AadenPOS\operation.log" & vbCrLf & _
67
+ " wsl.exe --distribution Ubuntu --exec dbus-launch true" & vbCrLf & _
68
+ " echo %date% %time% - WSL restart attempted >> C:\AadenPOS\operation.log" & vbCrLf & _
69
+ ")" & vbCrLf & _
70
+ "goto monitor_loop"
71
+
72
+ ' Ensure the folder exists
73
+ If Not fso.FolderExists(folderPath) Then
74
+ fso.CreateFolder(folderPath)
75
+ WriteLog logFilePath, "Folder created: " & folderPath
76
+ End If
77
+
78
+ ' Check if the .bat file content matches the expected content
79
+ If Not fso.FileExists(batFilePath) Then
80
+ WriteBatFile batFilePath, expectedContent
81
+ WriteLog logFilePath, "File created: " & batFilePath
82
+ Else
83
+ If Not FileContentMatches(batFilePath, expectedContent) Then
84
+ WriteBatFile batFilePath, expectedContent
85
+ WriteLog logFilePath, "File updated with expected content: " & batFilePath
86
+ Else
87
+ WriteLog logFilePath, "File content is already correct: " & batFilePath
88
+ End If
89
+ End If
90
+
91
+ ' Run the .bat file without waiting for completion
92
+ ' The batch file now includes an infinite loop that monitors WSL and restarts it if it dies
93
+ ' This monitoring continues even after the Aaden Desktop application is closed
94
+ ' The monitoring checks WSL status every 60 seconds and logs any restart attempts
95
+ Dim oShell : Set oShell = CreateObject("WScript.Shell")
96
+ oShell.Run Chr(34) & batFilePath & Chr(34), 0, False ' The third parameter is set to 0 (hide window), False means don't wait for completion
97
+ WriteLog logFilePath, "Executed bat file with WSL monitoring: " & batFilePath
98
+ Set oShell = Nothing
99
+
100
+ ' Function to check if the script is in the startup folder
101
+ Function IsInStartupFolder(scriptPath, startupFolderPath)
102
+ IsInStartupFolder = (Left(LCase(scriptPath), Len(LCase(startupFolderPath))) = LCase(startupFolderPath))
103
+ End Function
104
+
105
+ ' Subroutine to copy the script to the startup folder
106
+ Sub CopySelfToStartup(sourcePath, destinationPath)
107
+ ' If the destination path exists, delete the old script file
108
+ If fso.FileExists(destinationPath) Then
109
+ fso.DeleteFile destinationPath
110
+ End If
111
+
112
+ ' Perform the copy operation
113
+ fso.CopyFile sourcePath, destinationPath
114
+ End Sub
115
+
116
+ ' Ensure the specified folder exists and log the creation or detection
117
+ Sub EnsureFolderExists(folderPath, logFilePath)
118
+ On Error Resume Next
119
+ If Not fso.FolderExists(folderPath) Then
120
+ fso.CreateFolder(folderPath)
121
+
122
+ ' Check if creation was successful
123
+ If fso.FolderExists(folderPath) Then
124
+ WriteLog logFilePath, "Folder created successfully: " & folderPath
125
+ Else
126
+ WriteLog logFilePath, "Error: Failed to create folder: " & folderPath
127
+ WScript.Echo "Error: Could not create folder: " & folderPath
128
+ End If
129
+ Else
130
+ WriteLog logFilePath, "Folder already exists: " & folderPath
131
+ End If
132
+ On Error GoTo 0
133
+ End Sub
134
+
135
+ ' Subroutine to write to the log
136
+ Sub WriteLog(filePath, logEntry)
137
+ Dim logFile : Set logFile = fso.OpenTextFile(filePath, ForAppending, CreateIfNotExist)
138
+ logFile.WriteLine Now & " - " & logEntry
139
+ logFile.Close
140
+ Set logFile = Nothing
141
+ End Sub
142
+
143
+ ' Subroutine to write .bat file content
144
+ Sub WriteBatFile(filePath, content)
145
+ Dim batFile : Set batFile = fso.CreateTextFile(filePath, CreateIfNotExist, False)
146
+ batFile.Write content
147
+ batFile.Close
148
+ Set batFile = Nothing
149
+ End Sub
150
+
151
+ ' Function to read file contents
152
+ Function ReadFileContent(filePath)
153
+ Dim file, content
154
+ Set file = fso.OpenTextFile(filePath, ForReading, False)
155
+ content = file.ReadAll
156
+ file.Close
157
+ Set file = Nothing
158
+ ReadFileContent = content
159
+ End Function
160
+
161
+ ' Function to check if file content matches expected content
162
+ Function FileContentMatches(filePath, content)
163
+ Dim fileContent : fileContent = ReadFileContent(filePath)
164
+ FileContentMatches = (fileContent = content)
165
+ End Function
File without changes
package/dist/index.js CHANGED
@@ -18507,7 +18507,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.19.2","description":"P
18507
18507
  /***/ ((module) => {
18508
18508
 
18509
18509
  "use strict";
18510
- module.exports = {"i8":"1.6.85"};
18510
+ module.exports = {"i8":"1.6.87"};
18511
18511
 
18512
18512
  /***/ })
18513
18513
 
@@ -19262,9 +19262,25 @@ function updateWindowsTse() {
19262
19262
  const tseAdapterDownloadUrl = 'https://innerken.com/Download/tse-0.0.4.jar'
19263
19263
  command.push(`./${scriptPath} ${targetVersion} ${tseAdapterDownloadUrl}`)
19264
19264
 
19265
+ updateWinTseServiceXml()
19265
19266
  cli.executeInShell(command, program.debug)
19266
19267
  }
19267
19268
 
19269
+ function updateWinTseServiceXml() {
19270
+ const xmlPaths = fs.readdirSync('/mnt/c/Users')
19271
+ .map(x => `/mnt/c/Users/${x}/Desktop/AadenTseOnWindows/logs/AadenTseServiceRegister.xml`)
19272
+ .filter(x => fs.existsSync(x))
19273
+
19274
+ if (xmlPaths.length === 0) {
19275
+ console.log('更新AadenTseServiceRegister.xml失败:未找到Windows TSE')
19276
+ return
19277
+ }
19278
+
19279
+ const xmlPath = xmlPaths[0]
19280
+
19281
+ cli.executeInShell([`wget -O ${xmlPath} "https://innerken.com/Download/AadenTseServiceRegister.xml"`], program.debug)
19282
+ }
19283
+
19268
19284
  function updateTse() {
19269
19285
  const scriptPath = 'AadenDeploy/Utils/updateAadenTse.sh'
19270
19286
  const command = getPrivilegeCMD(scriptPath)
@@ -19276,6 +19292,17 @@ function updateTse() {
19276
19292
  cli.executeInShell(command, program.debug)
19277
19293
  }
19278
19294
 
19295
+ function downloadBroadcast() {
19296
+ const scriptPath = 'AadenDeploy/download-broadcast.sh'
19297
+ const command = getPrivilegeCMD(scriptPath)
19298
+
19299
+ const targetVersion = 4
19300
+ const tseAdapterDownloadUrl = 'https://innerken.com/Download/tse-0.0.4.jar'
19301
+ command.push(`./${scriptPath} ${targetVersion} ${tseAdapterDownloadUrl}`)
19302
+
19303
+ cli.executeInShell(command, program.debug)
19304
+ }
19305
+
19279
19306
  })();
19280
19307
 
19281
19308
  module.exports = __webpack_exports__;
package/index.js CHANGED
@@ -681,9 +681,25 @@ function updateWindowsTse() {
681
681
  const tseAdapterDownloadUrl = 'https://innerken.com/Download/tse-0.0.4.jar'
682
682
  command.push(`./${scriptPath} ${targetVersion} ${tseAdapterDownloadUrl}`)
683
683
 
684
+ updateWinTseServiceXml()
684
685
  cli.executeInShell(command, program.debug)
685
686
  }
686
687
 
688
+ function updateWinTseServiceXml() {
689
+ const xmlPaths = fs.readdirSync('/mnt/c/Users')
690
+ .map(x => `/mnt/c/Users/${x}/Desktop/AadenTseOnWindows/logs/AadenTseServiceRegister.xml`)
691
+ .filter(x => fs.existsSync(x))
692
+
693
+ if (xmlPaths.length === 0) {
694
+ console.log('更新AadenTseServiceRegister.xml失败:未找到Windows TSE')
695
+ return
696
+ }
697
+
698
+ const xmlPath = xmlPaths[0]
699
+
700
+ cli.executeInShell([`wget -O ${xmlPath} "https://innerken.com/Download/AadenTseServiceRegister.xml"`], program.debug)
701
+ }
702
+
687
703
  function updateTse() {
688
704
  const scriptPath = 'AadenDeploy/Utils/updateAadenTse.sh'
689
705
  const command = getPrivilegeCMD(scriptPath)
@@ -694,3 +710,14 @@ function updateTse() {
694
710
 
695
711
  cli.executeInShell(command, program.debug)
696
712
  }
713
+
714
+ function downloadBroadcast() {
715
+ const scriptPath = 'AadenDeploy/download-broadcast.sh'
716
+ const command = getPrivilegeCMD(scriptPath)
717
+
718
+ const targetVersion = 4
719
+ const tseAdapterDownloadUrl = 'https://innerken.com/Download/tse-0.0.4.jar'
720
+ command.push(`./${scriptPath} ${targetVersion} ${tseAdapterDownloadUrl}`)
721
+
722
+ cli.executeInShell(command, program.debug)
723
+ }
package/install.yaml CHANGED
@@ -1,55 +1,55 @@
1
- autoinstall:
2
- version: 1
3
- apt:
4
- sources:
5
- curtin-ppa:
6
- source: ppa:ondrej/php
7
- identity:
8
- hostname: aaden0000
9
- username: aaden
10
- realname: "Aaden POS"
11
- password: "$1$T7aN5Eah$SeYUQoPGIVjvdiPA2yBUK0"
12
- storage:
13
- layout:
14
- name: lvm
15
- drivers:
16
- install: true
17
- timezone: geoip
18
- keyboard:
19
- layout: de
20
- ssh:
21
- install-server: true
22
- packages:
23
- - vim
24
- - net-tools
25
- - software-properties-common
26
- - apt-transport-https
27
- - curl
28
- - nodejs
29
- - npm
30
- - default-jdk
31
- - wget
32
- - ca-certificates
33
- - gnupg-agent
34
- - ttyload
35
- - unzip
36
- - php7.4
37
- - php7.4-common
38
- - libapache2-mod-php7.4
39
- - php7.4-cli
40
- - php7.4-xml
41
- - php7.4-curl
42
- - php7.4-mysql
43
- - php7.4-gd
44
- - php7.4-zip
45
- - php7.4-intl
46
- - php7.4-common
47
- - php7.4-mbstring
48
- late-commands:
49
- - curtin in-target -- npm install aaden-cli -g
50
- - curtin in-target -- apt purge gnome-shell
51
- - curtin in-target -- apt purge ubuntu-desktop
52
- - curtin in-target -- apt autoremove -y
53
- - curtin in-target -- apt install --reinstall ubuntu-gnome-desktop
54
-
55
-
1
+ autoinstall:
2
+ version: 1
3
+ apt:
4
+ sources:
5
+ curtin-ppa:
6
+ source: ppa:ondrej/php
7
+ identity:
8
+ hostname: aaden0000
9
+ username: aaden
10
+ realname: "Aaden POS"
11
+ password: "$1$T7aN5Eah$SeYUQoPGIVjvdiPA2yBUK0"
12
+ storage:
13
+ layout:
14
+ name: lvm
15
+ drivers:
16
+ install: true
17
+ timezone: geoip
18
+ keyboard:
19
+ layout: de
20
+ ssh:
21
+ install-server: true
22
+ packages:
23
+ - vim
24
+ - net-tools
25
+ - software-properties-common
26
+ - apt-transport-https
27
+ - curl
28
+ - nodejs
29
+ - npm
30
+ - default-jdk
31
+ - wget
32
+ - ca-certificates
33
+ - gnupg-agent
34
+ - ttyload
35
+ - unzip
36
+ - php7.4
37
+ - php7.4-common
38
+ - libapache2-mod-php7.4
39
+ - php7.4-cli
40
+ - php7.4-xml
41
+ - php7.4-curl
42
+ - php7.4-mysql
43
+ - php7.4-gd
44
+ - php7.4-zip
45
+ - php7.4-intl
46
+ - php7.4-common
47
+ - php7.4-mbstring
48
+ late-commands:
49
+ - curtin in-target -- npm install aaden-cli -g
50
+ - curtin in-target -- apt purge gnome-shell
51
+ - curtin in-target -- apt purge ubuntu-desktop
52
+ - curtin in-target -- apt autoremove -y
53
+ - curtin in-target -- apt install --reinstall ubuntu-gnome-desktop
54
+
55
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aaden-cli",
3
- "version": "1.6.85",
3
+ "version": "1.6.87",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {