提交 5392be1d authored 作者: yangli's avatar yangli

Merge remote-tracking branch 'origin/master'

...@@ -25,6 +25,7 @@ public class TestDemo { ...@@ -25,6 +25,7 @@ public class TestDemo {
// 初始化硬件接口管理模块 // 初始化硬件接口管理模块
int result = IHwPortController.instanceDll.APQ_HWPORT_Initialize(); int result = IHwPortController.instanceDll.APQ_HWPORT_Initialize();
log.info("APQ_HWPORT_Initialize ret:{}", result); log.info("APQ_HWPORT_Initialize ret:{}", result);
/*
// 获取普通设备权限 // 获取普通设备权限
int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4); int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4);
log.info("APQ_HWPORT_get_normal_device_permit ret:{}", result31); log.info("APQ_HWPORT_get_normal_device_permit ret:{}", result31);
...@@ -37,10 +38,27 @@ public class TestDemo { ...@@ -37,10 +38,27 @@ public class TestDemo {
// 再次获取普通设备权限,验证 // 再次获取普通设备权限,验证
int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4); int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4);
log.info("Check APQ_HWPORT_get_normal_device_permit ret:{}", result33); log.info("Check APQ_HWPORT_get_normal_device_permit ret:{}", result33);
// 获取网络设备权限 */
// 获取存储设备权限
int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
log.info("APQ_HWPORT_get_storage_device_permit ret:{}", result31);
// APQ_HWPORT_STORAGE_PERM_ALLOW APQ_HWPORT_STORAGE_PERM_DENY
int result32 = IHwPortController.instanceDll.APQ_HWPORT_set_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode(), IHwPortController.HwportStoragePermEnum.APQ_HWPORT_STORAGE_PERM_ALLOW.getCode(), null);
log.info("APQ_HWPORT_set_storage_device_permit ret:{}", result32);
//应用硬件接口管理模块的配置内容
int result5 = IHwPortController.instanceDll.APQ_HWPORT_Apply();
log.info("APQ_HWPORT_Apply ret:{}", result5);
// 再次获取存储设备权限,验证
int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
log.info("Check APQ_HWPORT_get_storage_device_permit ret:{}", result33);
/* // 获取网络设备权限
int speed = 0; int speed = 0;
int result4 = IHwPortController.instanceDll.APQ_HWPORT_get_net_device_permit(0); int result4 = IHwPortController.instanceDll.APQ_HWPORT_get_net_device_permit(0);
log.info("APQ_HWPORT_get_net_device_permit ret:{}, speed:{}", result4, speed); log.info("APQ_HWPORT_get_net_device_permit ret:{}, speed:{}", result4, speed);*/
// 清理硬件接口管理模块 // 清理硬件接口管理模块
int result2 = IHwPortController.instanceDll.APQ_HWPORT_Uninitialize(); int result2 = IHwPortController.instanceDll.APQ_HWPORT_Uninitialize();
log.info("APQ_HWPORT_Uninitialize ret:{}", result2); log.info("APQ_HWPORT_Uninitialize ret:{}", result2);
......
...@@ -193,6 +193,10 @@ public class ApqControlApplication { ...@@ -193,6 +193,10 @@ public class ApqControlApplication {
} }
} else { } else {
log.info("未获取到获取硬件监控配置"); log.info("未获取到获取硬件监控配置");
//int result = IHwPortController.instanceDll.APQ_HWPORT_Initialize();
//log.info("APQ_HWPORT_Initialize ret:{}", result);
//int result2 = IHwPortController.instanceDll.APQ_HWPORT_Uninitialize();
//log.info("APQ_HWPORT_Uninitialize ret:{}", result2);
} }
} }
} }
...@@ -62,10 +62,10 @@ public class HwPortControllerDto { ...@@ -62,10 +62,10 @@ public class HwPortControllerDto {
@Getter @Getter
public enum DeviceHardwareEnum { public enum DeviceHardwareEnum {
// Storage 1F/2T/3T-ALL/4T-R/5T-CI/6T-CO 拷出目前无用!! Storage移动硬盘,TYPEC 无效 !! // Storage 1F/2T/3T-ALL/4T-R/5T-CI/6T-CO 拷出目前无用!! Storage移动硬盘,TYPEC 无效 !!
USB_DRIVE(0, "Storage", "U盘"), USB_DRIVE(1, "Storage", "U盘"),
MOBILE_DRIVE(0, "Storage", "移动硬盘"), MOBILE_DRIVE(1, "Storage", "移动硬盘"),
CD_DRIVE(0, "Storage", "驱动"), CD_DRIVE(0, "Storage", "驱动"),
TYPE_C(0, "Storage", "TYPE_C"), TYPE_C(1, "Storage", "TYPE_C"),
// Normal 1F/2T // Normal 1F/2T
MOUSE_KEYBOARD(Arrays.asList(3, 4), "Normal", "鼠标键盘"), MOUSE_KEYBOARD(Arrays.asList(3, 4), "Normal", "鼠标键盘"),
......
...@@ -3,6 +3,7 @@ package com.priusis.utils; ...@@ -3,6 +3,7 @@ package com.priusis.utils;
import com.sun.jna.Library; import com.sun.jna.Library;
import com.sun.jna.Native; import com.sun.jna.Native;
import com.sun.jna.Platform; import com.sun.jna.Platform;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.system.ApplicationHome; import org.springframework.boot.system.ApplicationHome;
...@@ -54,8 +55,8 @@ import java.io.UnsupportedEncodingException; ...@@ -54,8 +55,8 @@ import java.io.UnsupportedEncodingException;
******************************************************************************************************************************/ ******************************************************************************************************************************/
public interface IHwPortController extends Library { public interface IHwPortController extends Library {
//IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/x64/Release/HwPortController.dll", System.getProperty("user.dir") + "\\HwPortController.dll"), IHwPortController.class); IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/x64/Release/HwPortController.dll", System.getProperty("user.dir") + "\\HwPortController.dll"), IHwPortController.class);
IHwPortController instanceDll = (IHwPortController) Native.loadLibrary("D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\apq-pc-control\\src\\main\\resources\\dact\\x64\\Release\\HwPortController.dll", IHwPortController.class); //IHwPortController instanceDll = (IHwPortController) Native.loadLibrary("D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\apq-pc-control\\src\\main\\resources\\dact\\x64\\Release\\HwPortController.dll", IHwPortController.class);
/** /**
* 初始化硬件接口管理模块 * 初始化硬件接口管理模块
...@@ -189,6 +190,7 @@ public interface IHwPortController extends Library { ...@@ -189,6 +190,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_DEVICE_TYPE_MAX(-1), /* 不使用 */; APQ_HWPORT_DEVICE_TYPE_MAX(-1), /* 不使用 */;
@Getter
private int code; private int code;
HwportDeviceTypeEnum(int code) { HwportDeviceTypeEnum(int code) {
...@@ -205,6 +207,7 @@ public interface IHwPortController extends Library { ...@@ -205,6 +207,7 @@ public interface IHwPortController extends Library {
; ;
@Getter
private int code; private int code;
HwportResultEnum(int code) { HwportResultEnum(int code) {
...@@ -227,6 +230,7 @@ public interface IHwPortController extends Library { ...@@ -227,6 +230,7 @@ public interface IHwPortController extends Library {
; ;
@Getter
private int code; private int code;
HwportNormalDevidEnum(int code) { HwportNormalDevidEnum(int code) {
...@@ -243,6 +247,7 @@ public interface IHwPortController extends Library { ...@@ -243,6 +247,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_NORMAL_PERM_ALLOW(2), // 允许连接/使用此硬件接口 APQ_HWPORT_NORMAL_PERM_ALLOW(2), // 允许连接/使用此硬件接口
APQ_HWPORT_NORMAL_PERM_MAX(-1); /* 不使用 */ APQ_HWPORT_NORMAL_PERM_MAX(-1); /* 不使用 */
@Getter
private int code; private int code;
HwportNormalPermEnum(int code) { HwportNormalPermEnum(int code) {
...@@ -261,6 +266,7 @@ public interface IHwPortController extends Library { ...@@ -261,6 +266,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_STORAGE_DEVID_MAX(-1), /* 不使用 */; APQ_HWPORT_STORAGE_DEVID_MAX(-1), /* 不使用 */;
@Getter
private int code; private int code;
HwportStorageDevidEnum(int code) { HwportStorageDevidEnum(int code) {
...@@ -282,6 +288,7 @@ public interface IHwPortController extends Library { ...@@ -282,6 +288,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_STORAGE_PERM_MAX(-1) /* 不使用 */; APQ_HWPORT_STORAGE_PERM_MAX(-1) /* 不使用 */;
@Getter
private int code; private int code;
HwportStoragePermEnum(int code) { HwportStoragePermEnum(int code) {
...@@ -299,6 +306,7 @@ public interface IHwPortController extends Library { ...@@ -299,6 +306,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_NET_DEVID_MAX(-1) /* 不使用 */; APQ_HWPORT_NET_DEVID_MAX(-1) /* 不使用 */;
@Getter
private int code; private int code;
HwportNetDevidEnum(int code) { HwportNetDevidEnum(int code) {
...@@ -318,6 +326,7 @@ public interface IHwPortController extends Library { ...@@ -318,6 +326,7 @@ public interface IHwPortController extends Library {
APQ_HWPORT_NET_PERM_MAX(-1) /* 不使用 */; APQ_HWPORT_NET_PERM_MAX(-1) /* 不使用 */;
@Getter
private int code; private int code;
HwportNetPermEnum(int code) { HwportNetPermEnum(int code) {
......
@echo off @echo off
echo echo
cd /d %~dp0  cd /d "%~dp0"
echo "%~dp0" echo "%~dp0"
echo "%cd%" echo "%cd%"
set jdkpath=%cd%\jre set jdkpath=%cd%\jre
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define MyAppDirName "apq-client" #define MyAppDirName "apq-client"
#define MyAppEnName "apq-client" #define MyAppEnName "apq-client"
#define MyAppExeName "apq-client.exe" #define MyAppExeName "apq-client.exe"
#define MyAppReBootName "service\启动服务R.bat"
[Setup] [Setup]
; 注: AppId的值为单独标识该应用程序。 ; 注: AppId的值为单独标识该应用程序。
...@@ -72,7 +73,7 @@ Type: dirifempty; Name: "{app}" ...@@ -72,7 +73,7 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppExeName}" Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppReBootName}"; Flags: uninsdeletevalue;
[Code] [Code]
function CheckProcessRunning( aProcName, function CheckProcessRunning( aProcName,
...@@ -118,7 +119,7 @@ begin ...@@ -118,7 +119,7 @@ begin
Result := ResultCode > 0; Result := ResultCode > 0;
if Result then if Result then
begin begin
Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK); // Msgbox('已关闭正在运行' + aProcDesc + '客户端!', mbInformation, MB_OK);
ShellResult := Exec( f2, ShellResult := Exec( f2,
'', '',
d, d,
...@@ -134,8 +135,11 @@ end; ...@@ -134,8 +135,11 @@ end;
// Perform some initializations. Return False to abort setup // Perform some initializations. Return False to abort setup
function InitializeSetup: Boolean; function InitializeSetup: Boolean;
begin begin
// Do not use any user defined vars in here such as {app} // Do not use any user defined vars in here such as {app}
// Result := not ( CheckProcessRunning( 'apq-client-service.exe', 'apq-client-service' )); // Result := not ( CheckProcessRunning( 'apq-client-service.exe', 'apq-client-service' ));
CheckProcessRunning( 'apq.exe', 'apq' ) CheckProcessRunning( 'apq-control.exe', 'apq客户端插件' )
Result := not ( CheckProcessRunning( 'apq-client.exe', 'apq-client' )); CheckProcessRunning( 'apq-info.exe', 'apq客户端插件' )
CheckProcessRunning( 'apq-register.exe', 'apq客户端插件' )
CheckProcessRunning( 'apq.exe', 'apq客户端桌面' )
Result := not ( CheckProcessRunning( 'apq-client.exe', 'apq-client客户端' ));
end; end;
\ No newline at end of file
cd /d %~dp0 
::start xx.exe
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-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
start ../jre/bin/apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo 启动服务完毕
exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
...@@ -7,5 +7,5 @@ taskkill -f -t -im %MyPID% ...@@ -7,5 +7,5 @@ taskkill -f -t -im %MyPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq client service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
::taskkill -f -t -im %MyPID% ::taskkill -f -t -im %MyPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
start ../jre/bin/apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar" start apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq client service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
...@@ -7,5 +7,5 @@ taskkill -f -t -im %MyPID% ...@@ -7,5 +7,5 @@ taskkill -f -t -im %MyPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq client service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
::taskkill -f -t -im %MyPID% ::taskkill -f -t -im %MyPID%
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
start ../jre/bin/apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar" start apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq client service
exit exit
\ No newline at end of file
cd /d "%~dp0"
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
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define MyAppDirName "apq-control" #define MyAppDirName "apq-control"
#define MyAppEnName "apq-control" #define MyAppEnName "apq-control"
#define MyAppExeName "apq-control.exe" #define MyAppExeName "apq-control.exe"
#define MyAppReBootName "service\启动服务R.bat"
[Setup] [Setup]
; 注: AppId的值为单独标识该应用程序。 ; 注: AppId的值为单独标识该应用程序。
...@@ -51,12 +52,11 @@ Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl" ...@@ -51,12 +52,11 @@ Name: "chinesesimp"; MessagesFile: "compiler:Languages/Chinese.isl"
Source: "../apq-control/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "../apq-control/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Tasks] //[Tasks]
Name: "startupicon"; Description: "开机启动"; GroupDescription: "{cm:AdditionalIcons}"; //Name: "startupicon"; Description: "开机启动"; GroupDescription: "{cm:AdditionalIcons}";
[Icons] [Icons]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\service\启动服务.bat"; Tasks: startupicon
[Run] [Run]
Filename: "{app}\service\启动服务.bat"; Flags: runhidden; Filename: "{app}\service\启动服务.bat"; Flags: runhidden;
...@@ -73,7 +73,7 @@ Type: dirifempty; Name: "{app}" ...@@ -73,7 +73,7 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppExeName}"; Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppReBootName}"; Flags: uninsdeletevalue;
[Code] [Code]
......
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a
......
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar" start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq control service
exit exit
\ No newline at end of file
cd /d "%~dp0"
start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar"
echo start apq control service
exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq control service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-control') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar" start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq control service
exit exit
\ No newline at end of file
cd /d "%~dp0"
start apq-control -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-control-1.0-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define MyAppDirName "apq-info" #define MyAppDirName "apq-info"
#define MyAppEnName "apq-info" #define MyAppEnName "apq-info"
#define MyAppExeName "apq-info.exe" #define MyAppExeName "apq-info.exe"
#define MyAppReBootName "service\启动服务R.bat"
[Setup] [Setup]
; 注: AppId的值为单独标识该应用程序。 ; 注: AppId的值为单独标识该应用程序。
...@@ -68,7 +69,7 @@ Type: dirifempty; Name: "{app}" ...@@ -68,7 +69,7 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppExeName}" Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppReBootName}"; Flags: uninsdeletevalue;
[Code] [Code]
function CheckProcessRunning( aProcName, function CheckProcessRunning( aProcName,
......
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq info service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar" start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq info service
exit exit
\ No newline at end of file
cd /d "%~dp0"
start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq info service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-info') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar" start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq info service
exit exit
\ No newline at end of file
cd /d "%~dp0"
start apq-info -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-info-1.0-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define MyAppDirName "apq-register" #define MyAppDirName "apq-register"
#define MyAppEnName "apq-register" #define MyAppEnName "apq-register"
#define MyAppExeName "apq-register.exe" #define MyAppExeName "apq-register.exe"
#define MyAppReBootName "service\启动服务R.bat"
[Setup] [Setup]
; 注: AppId的值为单独标识该应用程序。 ; 注: AppId的值为单独标识该应用程序。
...@@ -66,7 +67,7 @@ Type: dirifempty; Name: "{app}" ...@@ -66,7 +67,7 @@ Type: dirifempty; Name: "{app}"
;操作注册表 ;操作注册表
[Registry] [Registry]
Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey; Root: HKLM; Subkey: "Software\{#MyAppEnName}"; Flags: uninsdeletekey;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppExeName}" Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppEnName}"; ValueData: "{app}\{#MyAppReBootName}"; Flags: uninsdeletevalue;
[Code] [Code]
......
cd /d %~dp0  cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a
TASKKILL /F /PID %SPID% TASKKILL /F /PID %SPID%
echo 删除服务完毕 echo stop apq register service
exit exit
\ No newline at end of file
cd /d %~dp0  cd /d "%~dp0"
::start xx.exe ::start xx.exe
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a
TASKKILL /F /PID %SPID%
start apq-register -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-register-1.0-SNAPSHOT-boot.jar" start apq-register -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-register-1.0-SNAPSHOT-boot.jar"
echo 启动服务完毕 echo start apq register service
exit exit
\ No newline at end of file
cd /d "%~dp0"
start apq-register -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-register-1.0-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
@ECHO OFF cd /d "%~dp0"
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
@ECHO Stopping apq-register-service ... for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a
net stop apq-register-service TASKKILL /F /PID %SPID%
@ECHO Uninstalling apq-register-service ... echo stop apq register service
"%~dp0apq-register-service.exe" uninstall exit
\ No newline at end of file
@ECHO DONE.
:END
\ No newline at end of file
@ECHO OFF cd /d "%~dp0"
::start xx.exe
setlocal ENABLEEXTENSIONS for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-register') do set SPID=%%a
TASKKILL /F /PID %SPID%
@ECHO Installing apq-register-service ... start apq-register -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-register-1.0-SNAPSHOT-boot.jar"
"%~dp0apq-register-service.exe" install echo start apq register service
@ECHO runing apq-register-service ... exit
"%~dp0apq-register-service.exe" start \ No newline at end of file
@ECHO DONE.
:END
\ No newline at end of file
cd /d "%~dp0"
start apq-register -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-register-1.0-SNAPSHOT-boot.jar"
exit
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论