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

install

上级 1ddc7f09
......@@ -118,7 +118,7 @@ public class JsonTools {
} else if (value.canConvertToLong()) {
attributes.add(new LongDataEntry(key, value.asLong()));
} else {
attributes.add(new StringDataEntry(key, value.toString()));
attributes.add(new StringDataEntry(key, value.asText()));
}
}
return attributes;
......
......@@ -166,6 +166,14 @@ public class ProgramController {
}
}));
MAP.get(key).start();
/*int exitVal = -1;
try {
exitVal = Runtime.getRuntime().exec("cmd /c \"D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\tools\\install-package\\dist\\apq-info-install.exe\"").waitFor();
} catch (Exception e) {
log.error("执行安装文件失败", e);
}
System.out.println(exitVal);*/
}
@GetMapping(value = "{type}/is_installing")
......@@ -209,4 +217,15 @@ public class ProgramController {
HttpUtil.post(gateway + addProgramUrl,
JSONUtil.createObj().set("macAddress", mac).set("programList", programNames).toString());
}
public static void main(String[] args) {
int exitVal = -1;
try {
exitVal = Runtime.getRuntime().exec("cmd /c \"D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\tools\\install-package\\dist\\apq-info-install.exe\"").waitFor();
} catch (Exception e) {
log.error("执行安装文件失败", e);
}
System.out.println(exitVal);
System.out.println("========");
}
}
apq:
iot-gateway: 192.168.124.19:7002
PC_HOST: 192.168.124.29
#apq:
# iot-gateway: 192.168.6.23:7033
#PC_HOST: 192.168.6.23
\ No newline at end of file
# iot-gateway: 192.168.124.19:7002
#PC_HOST: 192.168.124.6
apq:
iot-gateway: 192.168.6.23:7033
PC_HOST: 192.168.6.23
\ No newline at end of file
......@@ -6,6 +6,7 @@ echo "%cd%"
set jdkpath=%cd%\jre
echo %jdkpath%
setx JAVA_HOME "%jdkpath%" -m
set JAVA_HOME="%jdkpath%"
setx CLASSPATH ".;%%JAVA_HOME%%\lib\tools.jar;%%JAVA_HOME%%\lib\dt.jar" -m
echo %Path%
echo %Path%|find /i "%JAVA_HOME%" && set IsNull=true || set IsNull=false
......
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "阿普奇检测客户端"
#define MyAppVersion "V1.0"
#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"
#define MyAppReBootName "service\启动服务R.bat"
......@@ -53,13 +53,13 @@ Source: "../apq-client/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "../java/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
[Icons]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\client\client-soft\apq.exe";
[Run]
Filename: "{app}\Set_Env.bat"; Flags: runhidden;
Filename: "{app}\service\启动服务.bat"; Flags: runhidden;
Filename: "{app}\service\启动服务.bat"; Flags: runhidden runascurrentuser waituntilterminated;
;卸载后执行的操作(停止、删除各种服务)
[UninstallRun]
......@@ -67,7 +67,7 @@ Filename: "{app}\service\删
;卸载后删除目录所有文件,删除空目录
[UninstallDelete]
Type: filesandordirs; Name: "{app}\*"
Type: filesandordirs; Name: "{app}\*"
Type: dirifempty; Name: "{app}"
;操作注册表
......
cd /d "%~dp0"
::start xx.exe
setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
::taskkill -f -t -im %MyPID%
......@@ -7,6 +8,6 @@ for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
start ..\jre\bin\apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo start apq client service
exit
\ No newline at end of file
......@@ -4,6 +4,15 @@ setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
taskkill -f -t -im %MyPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a
TASKKILL /F /PID %SPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a
TASKKILL /F /PID %SPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a
TASKKILL /F /PID %SPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
......
cd /d "%~dp0"
::start xx.exe
setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
::taskkill -f -t -im %MyPID%
......@@ -7,6 +8,6 @@ for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
start ..\jre\bin\apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo start apq client service
exit
\ No newline at end of file
cd /d "%~dp0"
%1 %2
ver|find "5.">nul&&goto :st
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :st","","runas",0)(window.close)&goto :eof
:st
copy "%~0" "%windir%\system32\"
start apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
......@@ -10,7 +10,7 @@
#define MyAppExeName "apq-info.exe"
#define MyAppReBootName "service\启动服务R.bat"
[Setup]
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
......@@ -52,10 +52,9 @@ Source: "../apq-info/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs c
[Icons]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
[Run]
Filename: "{app}\service\启动服务.bat"; Flags: runhidden;
[Run]
Filename: "{app}\service\启动服务.bat"; Parameters:"""D:\Program Files (x86)\apq-client\jre"" ""{app}\config.ini""";Flags:runhidden runascurrentuser waituntilterminated;
;卸载后执行的操作(停止、删除各种服务)
[UninstallRun]
......@@ -63,7 +62,7 @@ Filename: "{app}\service\删
;卸载后删除目录所有文件,删除空目录
[UninstallDelete]
Type: filesandordirs; Name: "{app}\*"
Type: filesandordirs; Name: "{app}\*"
Type: dirifempty; Name: "{app}"
;操作注册表
......@@ -72,6 +71,8 @@ Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey;
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppReBootName}"; Flags: uninsdeletevalue;
[Code]
const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
function CheckProcessRunning( aProcName,
aProcDesc: string ): boolean;
var
......@@ -124,12 +125,19 @@ begin
ResultCode );
end;
end;
DeleteFile( d + f );
DeleteFile( d + f );
DeleteFile( d + f2 );
end;
function EnvGetJavaHomePath() : string;
var javaHome: string;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'JAVA_HOME', javaHome)
Result := javaHome;
end;
// Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean;
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' ));
......
@echo off
echo
cd /d "%~dp0"
echo "%~dp0"
echo "%cd%"
set jdkpath=%cd%\jre
echo %jdkpath%
setx JAVA_HOME "%jdkpath%" -m
set JAVA_HOME="%jdkpath%"
setx CLASSPATH ".;%%JAVA_HOME%%\lib\tools.jar;%%JAVA_HOME%%\lib\dt.jar" -m
echo %Path%
echo %Path%|find /i "%JAVA_HOME%" && set IsNull=true || set IsNull=false
echo %IsNull%
if not %IsNull%==true (
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_SZ /d "%Path%;%%JAVA_HOME%%\bin;%%JAVA_HOME%%\jre\bin" /f
setx Path "%%JAVA_HOME%%\bin;%Path%" -m
)
exit
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论