提交 f6dcd902 authored 作者: wangqiang's avatar wangqiang

客户端更新

上级 0510c0aa
......@@ -404,16 +404,19 @@ public class ProgramController {
@Scheduled(fixedDelay = 360000)
protected void autoUpgradeJob() {
try {
log.info("执行自动安装文件 ==============1");
boolean autoUpgrade = Convert.toBool(SysConfigUtil.getProperty("auto.upgrade"), true);
if (!autoUpgrade) return;
String downloadPath = SysConfigUtil.getProperty("download.path",
System.getProperty("user.dir").substring(0, 3) + "apqdownloads");
File dir = new File(downloadPath);
if (!dir.exists()) dir.mkdirs();
log.info("执行自动安装文件 ==============2");
list("upgrade", 1, 10000).getData().getRecords()
.parallelStream()
.filter(m -> ObjectUtil.notEqual(m.get("version"), m.get("localVersion")))
.forEach(m -> {
log.info("执行自动安装文件 ==============3");
String url = m.get("url");
String fileName = url.substring(url.lastIndexOf("/") + 1);
File fileE = new File(downloadPath + File.separator + fileName);
......@@ -422,7 +425,7 @@ public class ProgramController {
fileE = rsp.writeBodyForFile(dir, null);
}
int exitVal = -1;
// int exitVal = -1;
try {
String exeCmd = "autoExe.bat \"" + fileE.getPath() + "\"";
ProcessExtensionsApqUtil.apq_CreateProcessAsUser(exeCmd);
......@@ -433,10 +436,10 @@ public class ProgramController {
log.error("执行安装文件 {} 失败", fileE.getPath(), e);
}
log.info("执行安装文件 ==============");
if (exitVal == 0) {
String reqUrl = gateway + StrUtil.format(upgradeStatusUpIssueUrl, MacAddrUtil.get(), m.get("id"));
HttpUtil.post(reqUrl, (String) null);
}
// if (exitVal == 0) {
// String reqUrl = gateway + StrUtil.format(upgradeStatusUpIssueUrl, MacAddrUtil.get(), m.get("id"));
// HttpUtil.post(reqUrl, (String) null);
// }
});
} catch (Exception e) {
log.error("自动升级任务执行异常", e);
......
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "阿普奇检测客户端"
#define MyAppName "阿普奇检测客户端_x32"
#define MyAppVersion "V1.3"
#define MyAppPublisher "阿普奇"
#define MyAppURL "https://www.apq.com/"
#define MyAppDirName "apq-client"
#define MyAppDirName "apq-client"
#define MyAppEnName "apq-client"
#define MyAppExeName "apq-client.exe"
; apq-iot-client
#define MyAppInstallPwd "2a96d11973c7caa1a72eb816d7db6d17"
; hk-remove2022
; hk-remove2022
#define MyAppUnInstallPwd "5b559ab76c08f97b5bd6c3a852e44141"
[Setup]
......@@ -37,7 +37,7 @@ SetupIconFile=logo.ico
OutputDir=..\dist\
;安装包文件名
OutputBaseFilename={#MyAppName}_x32
OutputBaseFilename={#MyAppName}
;压缩文件
Compression=lzma
......
......@@ -4,8 +4,18 @@ setlocal ENABLEEXTENSIONS
@ECHO Installing UltraVNC_1_2_40_X86_Setup ...
SC QUERY "uvnc_service" > NUL
IF not ERRORLEVEL 1 GOTO EXIST
GOTO NOTEXIST
:NOTEXIST
"%~dp0\UltraVNC_1_2_40_X86_Setup.exe" /loadinf="%~dp0vnc.ini" /sp- /silent /suppressmsgboxes
GOTO END
@ECHO Installing UltraVNC_1_2_40_X86_Setup ...
:EXIST
ECHO exist "uvnc_service" service
GOTO END
:END
@ECHO Installing UltraVNC_1_2_40_X86_Setup ...
exit
\ No newline at end of file
......@@ -4,14 +4,18 @@ setlocal ENABLEEXTENSIONS
@ECHO Installing UltraVNC_1_2_40_X64_Setup ...
"%~dp0\UltraVNC_1_2_40_X64_Setup.exe" /loadinf="%~dp0vnc.ini" /sp- /silent /suppressmsgboxes
rem start "D:\work\priusis\priusis-iot\apq-iot\apq-client\tools\install-package\vnc\x64\UltraVNC_1_2_40_X64_Setup.exe" /loadinf="D:\work\priusis\priusis-iot\apq-iot\apq-client\tools\install-package\vnc\x64\vnc.ini" /silent
SC QUERY "uvnc_service" > NUL
IF not ERRORLEVEL 1 GOTO EXIST
GOTO NOTEXIST
rem start D:\work\priusis\priusis-iot\apq-iot\apq-client\tools\install-package\vnc\x64\UltraVNC_1_2_40_X64_Setup.exe
:NOTEXIST
"%~dp0\UltraVNC_1_2_40_X64_Setup.exe" /loadinf="%~dp0vnc.ini" /sp- /silent /suppressmsgboxes
GOTO END
rem cmd /c "C:\Program Files (x86)\apq-client\vnc\UltraVNC_1_2_40_X64_Setup.exe" /loadinf="C:\Program Files (x86)\apq-client\vnc\vnc.ini" /silent
:EXIST
ECHO exist "uvnc_service" service
GOTO END
:END
@ECHO Installing UltraVNC_1_2_40_X64_Setup ...
exit
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论