提交 50809b29 authored 作者: wangqiang's avatar wangqiang

install

上级 ecead3da
...@@ -134,7 +134,6 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -134,7 +134,6 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
initMqttSender(incomingQueue); initMqttSender(incomingQueue);
initMqttReceiver(incomingQueue); initMqttReceiver(incomingQueue);
scheduler = Executors.newSingleThreadScheduledExecutor(); scheduler = Executors.newSingleThreadScheduledExecutor();
scheduler.scheduleAtFixedRate(this::reportStats, 0, reporting.getInterval(), TimeUnit.MILLISECONDS);
} }
private void initTimeouts() { private void initTimeouts() {
...@@ -161,6 +160,8 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -161,6 +160,8 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
return tenantLabel; return tenantLabel;
} }
@Override @Override
public MqttDeliveryFuture onDeviceAttributesUpdate(List<KvEntry> attributes) { public MqttDeliveryFuture onDeviceAttributesUpdate(List<KvEntry> attributes) {
final int msgId = msgIdSeq.incrementAndGet(); final int msgId = msgIdSeq.incrementAndGet();
...@@ -276,27 +277,6 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -276,27 +277,6 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
error = node; error = node;
} }
private void reportStats() {
try {
ObjectNode node = newNode();
node.put("ts", System.currentTimeMillis());
ObjectNode valuesNode = node.putObject("values");
valuesNode.put("devicesOnline", devices.size());
valuesNode.put("attributesUploaded", attributesCount.getAndSet(0));
valuesNode.put("telemetryUploaded", telemetryCount.getAndSet(0));
if (error != null) {
valuesNode.put("latestError", JsonTools.toString(error));
error = null;
}
persistMessage(DEVICE_TELEMETRY_TOPIC, msgIdSeq.incrementAndGet(), toBytes(node),
token -> log.info("Gateway statistics {} reported!", node),
error -> log.warn("Failed to report gateway statistics!", error));
} catch (Throwable e) {
log.error("Failed to persist statistics message!", e);
}
}
@Override @Override
public void onMessage(String topic, ByteBuf payload) { public void onMessage(String topic, ByteBuf payload) {
String message = payload.toString(StandardCharsets.UTF_8); String message = payload.toString(StandardCharsets.UTF_8);
......
...@@ -51,5 +51,5 @@ apq: ...@@ -51,5 +51,5 @@ apq:
# VNC中继服务器 # VNC中继服务器
vnc-repeater: 120.24.236.245:5500 vnc-repeater: 192.168.6.29:5500
...@@ -40,7 +40,9 @@ PrivilegesRequired=admin ...@@ -40,7 +40,9 @@ PrivilegesRequired=admin
UninstallDisplayIcon={app}/{#MyAppExeName} UninstallDisplayIcon={app}/{#MyAppExeName}
VersionInfoVersion=1.0.0.0 //CreateUninstallRegKey=no
//UpdateUninstallLogAppName=no
VersionInfoVersion=1.0.0.1
[Languages] [Languages]
Name: "chinese"; MessagesFile: "compiler:Languages/Chinese.isl" Name: "chinese"; MessagesFile: "compiler:Languages/Chinese.isl"
...@@ -70,4 +72,68 @@ Type: dirifempty; Name: "{app}" ...@@ -70,4 +72,68 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\apq-client"; Flags: uninsdeletekey;
\ No newline at end of file
[Code]
function CheckProcessRunning( aProcName,
aProcDesc: string ): boolean;
var
ShellResult: boolean;
ResultCode: integer;
cmd: string;
sl: TStringList;
f: string;
d: string;
cmd2: string;
f2: string;
sl2: TStringList;
begin
cmd := 'for /f "delims=," %%i ' +
'in (''tasklist /FI "IMAGENAME eq ' + aProcName + '" /FO CSV'') ' +
'do if "%%~i"=="' + aProcName + '" exit 1';
f := 'CheckProc.cmd';
cmd2 := 'taskkill -f -t -im ' + aProcName;
f2 := 'KillProc.cmd';
d := AddBackSlash( ExpandConstant( '{tmp}' ));
sl := TStringList.Create;
sl.Add( cmd );
sl.Add( 'exit /0' );
sl.SaveToFile( d + f );
sl.Free;
sl2 := TStringList.Create;
sl2.Add( cmd2 );
sl2.Add( 'exit /0' );
sl2.SaveToFile( d + f2 );
sl2.Free;
Result := true;
while ( Result ) do
begin
ResultCode := 1;
ShellResult := Exec( f,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
Result := ResultCode > 0;
if Result then
begin
Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK);
ShellResult := Exec( f2,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
end;
end;
DeleteFile( d + f );
DeleteFile( d + f2 );
end;
// Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean;
begin
// Do not use any user defined vars in here such as {app}
Result := not ( CheckProcessRunning( 'apq-client-service.exe', 'apq-client-service' ));
end;
\ No newline at end of file
...@@ -40,11 +40,13 @@ PrivilegesRequired=admin ...@@ -40,11 +40,13 @@ PrivilegesRequired=admin
UninstallDisplayIcon={app}/{#MyAppExeName} UninstallDisplayIcon={app}/{#MyAppExeName}
//CreateUninstallRegKey=no
//UpdateUninstallLogAppName=no
VersionInfoVersion=1.0.0.0 VersionInfoVersion=1.0.0.0
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl" Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "../apq-control/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "../apq-control/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
...@@ -67,4 +69,68 @@ Type: dirifempty; Name: "{app}" ...@@ -67,4 +69,68 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\apq-control"; Flags: uninsdeletekey;
\ No newline at end of file
[Code]
function CheckProcessRunning( aProcName,
aProcDesc: string ): boolean;
var
ShellResult: boolean;
ResultCode: integer;
cmd: string;
sl: TStringList;
f: string;
d: string;
cmd2: string;
f2: string;
sl2: TStringList;
begin
cmd := 'for /f "delims=," %%i ' +
'in (''tasklist /FI "IMAGENAME eq ' + aProcName + '" /FO CSV'') ' +
'do if "%%~i"=="' + aProcName + '" exit 1';
f := 'CheckProc.cmd';
cmd2 := 'taskkill -f -t -im ' + aProcName;
f2 := 'KillProc.cmd';
d := AddBackSlash( ExpandConstant( '{tmp}' ));
sl := TStringList.Create;
sl.Add( cmd );
sl.Add( 'exit /0' );
sl.SaveToFile( d + f );
sl.Free;
sl2 := TStringList.Create;
sl2.Add( cmd2 );
sl2.Add( 'exit /0' );
sl2.SaveToFile( d + f2 );
sl2.Free;
Result := true;
while ( Result ) do
begin
ResultCode := 1;
ShellResult := Exec( f,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
Result := ResultCode > 0;
if Result then
begin
Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK);
ShellResult := Exec( f2,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
end;
end;
DeleteFile( d + f );
DeleteFile( d + f2 );
end;
// Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean;
begin
// Do not use any user defined vars in here such as {app}
Result := not ( CheckProcessRunning( 'apq-control-service.exe', 'apq-control-service' ));
end;
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
@ECHO Stopping apq-control ... @ECHO Stopping apq-control-service ...
net stop apq-control net stop apq-control-service
@ECHO Uninstalling apq-control ... @ECHO Uninstalling apq-control-service ...
"%~dp0apq-control.exe" uninstall "%~dp0apq-control-service.exe" uninstall
@ECHO DONE. @ECHO DONE.
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
setlocal ENABLEEXTENSIONS setlocal ENABLEEXTENSIONS
@ECHO Installing apq-control ... @ECHO Installing apq-control-service ...
"%~dp0apq-control.exe" install "%~dp0apq-control-service.exe" install
@ECHO runing apq-control ... @ECHO runing apq-control-service ...
"%~dp0apq-control.exe" start "%~dp0apq-control-service.exe" start
@ECHO DONE. @ECHO DONE.
......
...@@ -43,8 +43,8 @@ UninstallDisplayIcon={app}/{#MyAppExeName} ...@@ -43,8 +43,8 @@ UninstallDisplayIcon={app}/{#MyAppExeName}
VersionInfoVersion=1.0.0.0 VersionInfoVersion=1.0.0.0
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl" Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "../apq-info/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "../apq-info/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
...@@ -68,4 +68,69 @@ Type: dirifempty; Name: "{app}" ...@@ -68,4 +68,69 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey;
\ No newline at end of file
[Code]
function CheckProcessRunning( aProcName,
aProcDesc: string ): boolean;
var
ShellResult: boolean;
ResultCode: integer;
cmd: string;
sl: TStringList;
f: string;
d: string;
cmd2: string;
f2: string;
sl2: TStringList;
begin
cmd := 'for /f "delims=," %%i ' +
'in (''tasklist /FI "IMAGENAME eq ' + aProcName + '" /FO CSV'') ' +
'do if "%%~i"=="' + aProcName + '" exit 1';
f := 'CheckProc.cmd';
cmd2 := 'taskkill -f -t -im ' + aProcName;
f2 := 'KillProc.cmd';
d := AddBackSlash( ExpandConstant( '{tmp}' ));
sl := TStringList.Create;
sl.Add( cmd );
sl.Add( 'exit /0' );
sl.SaveToFile( d + f );
sl.Free;
sl2 := TStringList.Create;
sl2.Add( cmd2 );
sl2.Add( 'exit /0' );
sl2.SaveToFile( d + f2 );
sl2.Free;
Result := true;
while ( Result ) do
begin
ResultCode := 1;
ShellResult := Exec( f,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
Result := ResultCode > 0;
if Result then
begin
Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK);
ShellResult := Exec( f2,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
end;
end;
DeleteFile( d + f );
DeleteFile( d + f2 );
end;
// Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean;
begin
// Do not use any user defined vars in here such as {app}
Result := not ( CheckProcessRunning( 'apq-info-service.exe', 'apq-info-service' ));
// and not ( CheckProcessRunning( 'apq-info.exe', 'apq-info' ))
end;
\ No newline at end of file
...@@ -43,8 +43,8 @@ UninstallDisplayIcon={app}/{#MyAppExeName} ...@@ -43,8 +43,8 @@ UninstallDisplayIcon={app}/{#MyAppExeName}
VersionInfoVersion=1.0.0.0 VersionInfoVersion=1.0.0.0
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl" Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "../apq-register/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "../apq-register/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
...@@ -67,4 +67,69 @@ Type: dirifempty; Name: "{app}" ...@@ -67,4 +67,69 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\SoftName"; Flags: uninsdeletekey;
\ No newline at end of file
[Code]
function CheckProcessRunning( aProcName,
aProcDesc: string ): boolean;
var
ShellResult: boolean;
ResultCode: integer;
cmd: string;
sl: TStringList;
f: string;
d: string;
cmd2: string;
f2: string;
sl2: TStringList;
begin
cmd := 'for /f "delims=," %%i ' +
'in (''tasklist /FI "IMAGENAME eq ' + aProcName + '" /FO CSV'') ' +
'do if "%%~i"=="' + aProcName + '" exit 1';
f := 'CheckProc.cmd';
cmd2 := 'taskkill -f -t -im ' + aProcName;
f2 := 'KillProc.cmd';
d := AddBackSlash( ExpandConstant( '{tmp}' ));
sl := TStringList.Create;
sl.Add( cmd );
sl.Add( 'exit /0' );
sl.SaveToFile( d + f );
sl.Free;
sl2 := TStringList.Create;
sl2.Add( cmd2 );
sl2.Add( 'exit /0' );
sl2.SaveToFile( d + f2 );
sl2.Free;
Result := true;
while ( Result ) do
begin
ResultCode := 1;
ShellResult := Exec( f,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
Result := ResultCode > 0;
if Result then
begin
Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK);
ShellResult := Exec( f2,
'',
d,
SW_HIDE,
ewWaitUntilTerminated,
ResultCode );
end;
end;
DeleteFile( d + f );
DeleteFile( d + f2 );
end;
// Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean;
begin
// Do not use any user defined vars in here such as {app}
Result := not ( CheckProcessRunning( 'apq-register-service.exe', 'apq-register-service' ));
end;
\ No newline at end of file
APQ_HWPORT_NET_DEVID_ETH_CARD=APQ_HWPORT_NET_PERM_ALLOW
APQ_HWPORT_NET_DEVID_ETH_CARD_SPEED=1000000
APQ_HWPORT_NORMAL_DEVID_BT=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_NORMAL_DEVID_CAMERA=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_NORMAL_DEVID_DONGLE=APQ_HWPORT_NORMAL_PERM_UNKNOWN
APQ_HWPORT_NORMAL_DEVID_GPIO=APQ_HWPORT_NORMAL_PERM_UNKNOWN
APQ_HWPORT_NORMAL_DEVID_KEYBOARD=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_NORMAL_DEVID_MOUSE=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_NORMAL_DEVID_SERIAL=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_NORMAL_DEVID_USB_CONVERSION=APQ_HWPORT_NORMAL_PERM_ALLOW
APQ_HWPORT_STORAGE_DEVID_CDROM=APQ_HWPORT_STORAGE_PERM_UNKNOWN
APQ_HWPORT_STORAGE_DEVID_UDISK=APQ_HWPORT_STORAGE_PERM_UNKNOWN
KEY=value
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论