[ref]同步711
@ -203,6 +203,7 @@ bool FilesyncApiImpl::recvSvrMsg(iot_net::CMbMessage &msg)
|
||||
if (!dataMsg.ParseFromArray(msg.getDataPtr(),
|
||||
(int)msg.getDataSize()))
|
||||
{
|
||||
BOOST_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
return handleFileNodeRespMsg(dataMsg);
|
||||
@ -213,7 +214,7 @@ bool FilesyncApiImpl::recvSvrMsg(iot_net::CMbMessage &msg)
|
||||
if (!resultMsg.ParseFromArray(msg.getDataPtr(),
|
||||
(int)msg.getDataSize()))
|
||||
{
|
||||
// BOOST_ASSERT(false);
|
||||
BOOST_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
return handleBroadcastResultMsg(resultMsg);
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
* @brief initialize 初始化网络查询
|
||||
* @param domainId 连接域
|
||||
* @param appId 连接应用
|
||||
* @return iotSuccess-成功 kbdFaild-失败
|
||||
* @return iotSuccess-成功 iotFailed-失败
|
||||
*/
|
||||
int initialize(int domainId,int appId);
|
||||
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
#include "DogCheck.h"
|
||||
#include "ui_DogCheck.h"
|
||||
#include "sys_dog_auth_api/DogAuthInterface.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QStandardPaths>
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace iot_sys;
|
||||
DogCheck::DogCheck(QWidget *parent) :
|
||||
@ -13,6 +18,9 @@ DogCheck::DogCheck(QWidget *parent) :
|
||||
slot_recheckBtn();
|
||||
ui->recheckBtn->setText(tr("重新检测"));
|
||||
connect(ui->recheckBtn, &QPushButton::clicked, this, &DogCheck::slot_recheckBtn);
|
||||
connect(ui->pushButton_2,&QPushButton::clicked,this,&DogCheck::slot_openLicenseDir);
|
||||
connect(ui->pushButton,&QPushButton::clicked,this,&DogCheck::slot_selectLicense);
|
||||
|
||||
}
|
||||
|
||||
DogCheck::~DogCheck()
|
||||
@ -23,18 +31,65 @@ DogCheck::~DogCheck()
|
||||
void DogCheck::slot_recheckBtn()
|
||||
{
|
||||
CDogAuthInterfacePtr ptrDogAuth = getDogAuthInstance();
|
||||
|
||||
int nRet = ptrDogAuth->checkAuthStatus();
|
||||
if (nRet == AUTH_STATUS_OK)
|
||||
if (nRet > 0)
|
||||
{
|
||||
ui->statusLab->setText(tr("正常"));
|
||||
}
|
||||
else if(nRet == AUTH_STATUS_EXPIRED)
|
||||
{
|
||||
ui->statusLab->setText(tr("授权过期,错误码[%1]").arg(nRet));
|
||||
|
||||
ui->statusLab->setText(tr("异常,错误码[%1]").arg(nRet));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->statusLab->setText(tr("异常,错误码[%1]").arg(nRet));
|
||||
ui->statusLab->setText(tr("正常"));
|
||||
}
|
||||
}
|
||||
|
||||
void DogCheck::slot_openLicenseDir()
|
||||
{
|
||||
QString strDir = QCoreApplication::applicationDirPath();
|
||||
QString licenseDir = QString("%1/../common/license/").arg(strDir);
|
||||
if(!QFileInfo::exists(licenseDir))
|
||||
{
|
||||
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(licenseDir));
|
||||
}
|
||||
|
||||
void DogCheck::slot_selectLicense()
|
||||
{
|
||||
QString strBinDir = QCoreApplication::applicationDirPath();
|
||||
QString licenseFile = QString("%1/../common/license/license.txt").arg(strBinDir);
|
||||
|
||||
QFile destFile(licenseFile);
|
||||
if(destFile.exists())
|
||||
{
|
||||
if(!destFile.remove())
|
||||
{
|
||||
QMessageBox::warning(this, tr("提示"), QString("删除原文件失败"));
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
QFileDialog fileDialog;
|
||||
QString strDir = fileDialog.getOpenFileName(this, tr("选择授权文件"),"license.txt",tr("txt (*.txt)"));
|
||||
|
||||
if (strDir.isEmpty())
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
QFile sourceFile(strDir);
|
||||
if (!sourceFile.exists()) {
|
||||
QMessageBox::warning(this, tr("提示"), QString("文件不存在"));
|
||||
return ;
|
||||
}
|
||||
|
||||
bool ret = sourceFile.copy(licenseFile);
|
||||
if(!ret)
|
||||
{
|
||||
QMessageBox::warning(this, tr("提示"), QString("导入失败![%1]").arg(sourceFile.errorString()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QMessageBox::warning(this, tr("提示"), QString("导入成功!"));
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ public:
|
||||
~DogCheck();
|
||||
private slots:
|
||||
void slot_recheckBtn();
|
||||
void slot_openLicenseDir();
|
||||
void slot_selectLicense();
|
||||
private:
|
||||
Ui::DogCheck *ui;
|
||||
};
|
||||
|
||||
@ -2,26 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>DogCheck</class>
|
||||
<widget class="QDialog" name="DogCheck">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>234</width>
|
||||
<height>166</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>234</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>234</width>
|
||||
<height>166</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
@ -31,6 +11,19 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>27</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
@ -38,43 +31,79 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>加密狗状态:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="statusLab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>191</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<string>正常</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="recheckBtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>67</x>
|
||||
<y>90</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>重新检测</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>1、请将操作系统信息(re_code.txt)发给系统提供商,获取授权文件</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>拷贝操作系统信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>2、获取授权文件后,进行系统激活</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>导入授权文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
||||
@ -1077,6 +1077,10 @@ void MainWindow::tabWidget_currentIdxChanged(int /*index*/)
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
#ifdef KBD_ARM
|
||||
QApplication::exit(0);
|
||||
#endif
|
||||
|
||||
event->ignore();
|
||||
this->hide();
|
||||
LOGINFO("点击应用关闭按钮,停止工作!");
|
||||
@ -1199,7 +1203,7 @@ void MainWindow::checkDog()
|
||||
m_pStatusMng->dogUncheck();
|
||||
return ;
|
||||
}
|
||||
if(AUTH_STATUS_FAILD == m_ptrDogAuthApi->checkAuthStatus()) //加密狗失败退出(含过期超过3个月)
|
||||
if(iotSuccess != m_ptrDogAuthApi->checkAuthStatus())
|
||||
{
|
||||
m_pStatusMng->dogIsNotHave();
|
||||
if(m_bLastDogStatus == true)
|
||||
@ -1233,6 +1237,7 @@ void MainWindow::verifyIp()
|
||||
|
||||
void MainWindow::updateVerifyIp(int verifyValue)
|
||||
{
|
||||
return;//暂时不写sys_ctrl文件,一直写这个文件会存在问题, 在linux系统下,突然断电会经常导致此文件损坏
|
||||
QString path = iot_public::CFileUtil::getPathOfCfgFile("sys_ctrl.xml",CN_DIR_PLATFORM).c_str();
|
||||
QFile file(path);
|
||||
if(!file.open(QFile::ReadOnly))
|
||||
|
||||
@ -52,5 +52,5 @@ bool unsetSysStartupAutoStartByVbs(QString &strErr);
|
||||
//--------------------------------------
|
||||
|
||||
|
||||
} //< iot_sys
|
||||
} //< namespace iot_sys
|
||||
|
||||
|
||||
@ -13,21 +13,15 @@
|
||||
#include <QtCore>
|
||||
#include "pub_utility_api/FileUtil.h"
|
||||
#include "SetupFunc.h"
|
||||
#include "setup/CommonDef.h"
|
||||
|
||||
namespace iot_sys
|
||||
{
|
||||
static const char *pszSystemdCfgFile = "/tmp/iscs6000_launcher.service";
|
||||
|
||||
//< 前面需加上用户HOME目录路径
|
||||
static const char *pszXdgCfgDir = "/.config/autostart/";
|
||||
static const char *pszXdgCfgFile = "iscs6000_hmi_explorer.desktop";
|
||||
|
||||
|
||||
//< 注册系统服务,并设置自启动
|
||||
bool regSysService(QString &strErr)
|
||||
{
|
||||
//< 判断服务是否已注册,普通用户权限可执行
|
||||
if (0 == QProcess::execute("systemctl is-enabled iscs6000_launcher.service"))
|
||||
if (0 == QProcess::execute(QString("systemctl is-enabled %1.service").arg(g_pszLauncherServiceName) ))
|
||||
{
|
||||
strErr = QObject::tr("已设置服务自启动,若需重新设置,请先取消!");
|
||||
return false;
|
||||
@ -58,14 +52,14 @@ bool regSysService(QString &strErr)
|
||||
|
||||
//< 生成或修改systemd服务配置文件
|
||||
{
|
||||
QSettings objIniSetting(pszSystemdCfgFile, QSettings::IniFormat);
|
||||
QSettings objIniSetting(g_pszLauncherServiceTempFile, QSettings::IniFormat);
|
||||
objIniSetting.setIniCodec( QTextCodec::codecForLocale() );
|
||||
qDebug() << objIniSetting.iniCodec()->name();
|
||||
|
||||
if (!objIniSetting.isWritable())
|
||||
{
|
||||
strErr = QObject::tr("服务配置文件不可写,请确认是否具有权限!")
|
||||
+ "\n" + pszSystemdCfgFile;
|
||||
+ "\n" + g_pszLauncherServiceTempFile;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -74,7 +68,7 @@ bool regSysService(QString &strErr)
|
||||
objIniSetting.clear();
|
||||
|
||||
objIniSetting.beginGroup("Unit");
|
||||
objIniSetting.setValue("Description", "iscs6000_launcher");
|
||||
objIniSetting.setValue("Description", g_pszLauncherServiceName);
|
||||
objIniSetting.setValue("After", "network.target");
|
||||
objIniSetting.endGroup();
|
||||
|
||||
@ -99,13 +93,14 @@ bool regSysService(QString &strErr)
|
||||
if (QSettings::NoError != objIniSetting.status())
|
||||
{
|
||||
strErr = QObject::tr("写入服务配置文件失败!")
|
||||
+ "\n" + pszSystemdCfgFile;
|
||||
+ "\n" + g_pszLauncherServiceTempFile;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//< 设置服务开机自启动
|
||||
if (0 != system("pkexec bash -c 'cp -f /tmp/iscs6000_launcher.service /usr/lib/systemd/system/ && systemctl daemon-reload && systemctl enable iscs6000_launcher'"))
|
||||
QString strRegSvrShell = QString("pkexec bash -c 'cp -f %1 %2 && systemctl daemon-reload && systemctl enable %3'").arg(g_pszLauncherServiceTempFile).arg(g_pszLauncherServiceFile).arg(g_pszLauncherServiceName);
|
||||
if (0 != system(strRegSvrShell.toStdString().c_str()))
|
||||
{
|
||||
strErr = QObject::tr("设置服务开机自启动失败!");
|
||||
return false;
|
||||
@ -116,7 +111,8 @@ bool regSysService(QString &strErr)
|
||||
//< 注销系统服务
|
||||
bool unregSysService(QString &strErr)
|
||||
{
|
||||
if (0 != system("pkexec bash -c 'systemctl enable iscs6000_launcher && systemctl disable iscs6000_launcher'"))
|
||||
QString strUnRegSvrShell = QString("pkexec bash -c 'systemctl enable %1 && systemctl disable %1'").arg(g_pszLauncherServiceName);
|
||||
if (0 != system(strUnRegSvrShell.toStdString().c_str()))
|
||||
{
|
||||
strErr = QObject::tr("取消服务开机自启动失败!");
|
||||
return false;
|
||||
@ -129,7 +125,7 @@ bool unregSysService(QString &strErr)
|
||||
bool isSysService(QString &strErr)
|
||||
{
|
||||
//< 判断服务是否已注册,普通用户权限可执行
|
||||
if (0 == QProcess::execute("systemctl is-enabled iscs6000_launcher.service"))
|
||||
if (0 == QProcess::execute(QString("systemctl is-enabled %1.service").arg(g_pszLauncherServiceName) ))
|
||||
{
|
||||
strErr = QObject::tr("已设置服务自启动,若需重新设置,请先取消!");
|
||||
return true;
|
||||
@ -145,9 +141,9 @@ bool setHmiAutoStart(QString &strErr)
|
||||
{
|
||||
const QString strCfgFileDir =
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
|
||||
+ pszXdgCfgDir;
|
||||
+ g_pszXdgAutoStartCfgDir;
|
||||
|
||||
const QString strCfgFileFullPath = strCfgFileDir + pszXdgCfgFile;
|
||||
const QString strCfgFileFullPath = strCfgFileDir + g_pszHMIXdgDesktopCfgFile;
|
||||
|
||||
if (QFile::exists(strCfgFileFullPath))
|
||||
{
|
||||
@ -207,7 +203,7 @@ bool setHmiAutoStart(QString &strErr)
|
||||
{
|
||||
QTextStream objStreamOut(&objFile);
|
||||
objStreamOut << "[Desktop Entry]" << endl;
|
||||
objStreamOut << "Name=iscs6000_hmi_explorer" << endl;
|
||||
objStreamOut << "Name=" << g_pszHMIXdgDesktopName << endl;
|
||||
objStreamOut << "Exec=" << strExec << endl;
|
||||
objStreamOut << "Type=Application" << endl;
|
||||
objStreamOut << "X-GNOME-AutoRestart=false" << endl;
|
||||
@ -224,7 +220,7 @@ bool unsetHmiAutoStart(QString &strErr)
|
||||
{
|
||||
const QString strCfgFileFullPath =
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
|
||||
+ pszXdgCfgDir + pszXdgCfgFile;
|
||||
+ g_pszXdgAutoStartCfgDir + g_pszHMIXdgDesktopCfgFile;
|
||||
|
||||
if (QFile::exists(strCfgFileFullPath))
|
||||
{
|
||||
@ -249,9 +245,9 @@ bool isHmiAutoStart(QString &strErr)
|
||||
{
|
||||
const QString strCfgFileDir =
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
|
||||
+ pszXdgCfgDir;
|
||||
+ g_pszXdgAutoStartCfgDir;
|
||||
|
||||
const QString strCfgFileFullPath = strCfgFileDir + pszXdgCfgFile;
|
||||
const QString strCfgFileFullPath = strCfgFileDir + g_pszHMIXdgDesktopCfgFile;
|
||||
|
||||
if (QFile::exists(strCfgFileFullPath))
|
||||
{
|
||||
@ -282,6 +278,6 @@ bool removeShortcut(QString &strErr)
|
||||
}
|
||||
|
||||
|
||||
} //< iot_sys
|
||||
} //< namespace iot_sys
|
||||
|
||||
#endif //< #ifdef OS_LINUX
|
||||
|
||||
@ -21,14 +21,11 @@
|
||||
#include <QtCore>
|
||||
#include "pub_utility_api/FileUtil.h"
|
||||
#include "SetupFunc.h"
|
||||
#include "setup/CommonDef.h"
|
||||
|
||||
namespace iot_sys
|
||||
{
|
||||
|
||||
static const TCHAR *pszServiceName = _T("iscs6000_launcher");
|
||||
|
||||
static const char *pszAutoRunRegPath = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
||||
|
||||
//< 注册系统服务,并设置自启动
|
||||
bool regSysService(QString &strErr)
|
||||
{
|
||||
@ -52,7 +49,7 @@ bool regSysService(QString &strErr)
|
||||
else
|
||||
{
|
||||
//< 判断服务是否已存在
|
||||
SC_HANDLE hService = ::OpenService(hSCM, pszServiceName, SERVICE_QUERY_CONFIG);
|
||||
SC_HANDLE hService = ::OpenService(hSCM, g_pTCharLauncherServiceName, SERVICE_QUERY_CONFIG);
|
||||
if (NULL == hService)
|
||||
{
|
||||
//< 创建服务
|
||||
@ -67,7 +64,7 @@ bool regSysService(QString &strErr)
|
||||
|
||||
// 20200601 已修改为注册系统服务并验证成功
|
||||
hService = ::CreateService(
|
||||
hSCM, pszServiceName, pszServiceName,
|
||||
hSCM, g_pTCharLauncherServiceName, g_pTCharLauncherServiceName,
|
||||
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
|
||||
strExec.toStdWString().c_str(), NULL, NULL, NULL, NULL, NULL);
|
||||
@ -79,7 +76,7 @@ bool regSysService(QString &strErr)
|
||||
else
|
||||
{
|
||||
SERVICE_DESCRIPTION stSrvDesc;
|
||||
TCHAR szDesc[] = _T("宏茂技术监控系统加载服务");
|
||||
TCHAR szDesc[] = _T("监控系统加载服务");
|
||||
stSrvDesc.lpDescription = szDesc;
|
||||
if (::ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &stSrvDesc))
|
||||
{
|
||||
@ -114,8 +111,8 @@ bool unregSysService(QString &strErr)
|
||||
}
|
||||
else
|
||||
{
|
||||
SC_HANDLE hService = ::OpenService(hSCM, pszServiceName, SERVICE_QUERY_STATUS | SERVICE_STOP | DELETE);
|
||||
//SC_HANDLE hService = ::OpenService(hSCM, _T("iscs6000_launcher_17b5ab7"), SERVICE_QUERY_STATUS | SERVICE_STOP | DELETE);
|
||||
SC_HANDLE hService = ::OpenService(hSCM, g_pTCharLauncherServiceName, SERVICE_QUERY_STATUS | SERVICE_STOP | DELETE);
|
||||
//SC_HANDLE hService = ::OpenService(hSCM, _T("xxxx_launcher_17b5ab7"), SERVICE_QUERY_STATUS | SERVICE_STOP | DELETE);
|
||||
|
||||
if (NULL == hService)
|
||||
{
|
||||
@ -130,9 +127,9 @@ bool unregSysService(QString &strErr)
|
||||
{
|
||||
//< todo 当使用SERVICE_USER_XXX_PROCESS类型的服务注册时,停止服务存在困难
|
||||
//< 此情况下服务的真实名称是注册名加上用户会话的ID,而ID是变化的,且微软没有开发获取的方法
|
||||
//< 比如真实的服务名是“iscs6000_launcher_17b5ab7”且正在运行,如果查询“iscs6000_launcher”的状态,是停止的
|
||||
//< 也无法通过停止“iscs6000_launcher”服务来停止“iscs6000_launcher_17b5ab7”
|
||||
//< 删除“iscs6000_launcher”服务后,“iscs6000_launcher_17b5ab7”还可见,必须注销重新登录才会消失
|
||||
//< 比如真实的服务名是“xxxx_launcher_17b5ab7”且正在运行,如果查询“xxxx_launcher”的状态,是停止的
|
||||
//< 也无法通过停止“xxxx_launcher”服务来停止“xxxx_launcher_17b5ab7”
|
||||
//< 删除“xxxx_launcher”服务后,“xxxx_launcher_17b5ab7”还可见,必须注销重新登录才会消失
|
||||
|
||||
if(SERVICE_STOPPED != objStatus.dwCurrentState
|
||||
&& TRUE == ControlService(hService, SERVICE_CONTROL_STOP, &objStatus))
|
||||
@ -198,7 +195,7 @@ bool isSysService(QString &strErr)
|
||||
else
|
||||
{
|
||||
//< 判断服务是否已存在
|
||||
SC_HANDLE hService = ::OpenService(hSCM, pszServiceName, SERVICE_QUERY_CONFIG);
|
||||
SC_HANDLE hService = ::OpenService(hSCM, g_pTCharLauncherServiceName, SERVICE_QUERY_CONFIG);
|
||||
if (NULL != hService)
|
||||
{
|
||||
strErr = QObject::tr("已设置服务自启动,若需重新设置,请先取消!");
|
||||
@ -216,7 +213,7 @@ bool isSysService(QString &strErr)
|
||||
|
||||
bool isSysStartupVbsExist()
|
||||
{
|
||||
QFile vbsFile( QDir::toNativeSeparators(QString("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp") + "\\sys_startup.vbs" ) );
|
||||
QFile vbsFile( QDir::toNativeSeparators(QString(g_pszAutoStartSysStartupPath)) );
|
||||
return vbsFile.exists();
|
||||
}
|
||||
|
||||
@ -230,7 +227,7 @@ bool setSysStartupAutoStartByVbs(QString &strErr,QString path)
|
||||
vbsTxt += QString("WshShell.Run \"") + "\"\"" + QDir::toNativeSeparators(path + "\\sys_startup.exe\"\" -hide") + "\"\n";
|
||||
vbsTxt += "Set WshShell = Nothing";
|
||||
|
||||
QFile vbsFile( QString() + QDir::toNativeSeparators(QString("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp") + "\\sys_startup.vbs" ) );
|
||||
QFile vbsFile( QDir::toNativeSeparators(QString(g_pszAutoStartSysStartupPath)) );
|
||||
if(!vbsFile.open(QFile::WriteOnly | QFile::Truncate))
|
||||
{
|
||||
strErr = QObject::tr("启动文件无法写入");
|
||||
@ -252,7 +249,7 @@ bool setSysStartupAutoStartByVbs(QString &strErr,QString path)
|
||||
bool unsetSysStartupAutoStartByVbs(QString &strErr)
|
||||
{
|
||||
Q_UNUSED(strErr)
|
||||
QFile file("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\sys_startup.vbs");
|
||||
QFile file(g_pszAutoStartSysStartupPath);
|
||||
if(!file.exists())
|
||||
return true;
|
||||
if(file.remove())
|
||||
@ -268,7 +265,7 @@ bool unsetSysStartupAutoStartByVbs(QString &strErr)
|
||||
|
||||
|
||||
|
||||
} //< iot_sys
|
||||
} //< namespace iot_sys
|
||||
|
||||
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
#include "pub_utility_api/FileUtil.h"
|
||||
using namespace sys_startup;
|
||||
VersionForm::VersionForm(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@ -56,13 +56,14 @@ void VersionForm::initView()
|
||||
ui->dbValue->setText(versionMap.value(QString::fromStdString(SOFTWARE_ISDB),"0") == "1" ? tr("已安装"):tr("未安装"));
|
||||
ui->webValue->setText(versionMap.value(QString::fromStdString(SOFTWARE_ISWEB),"0") == "1" ? tr("已安装"):tr("未安装"));
|
||||
|
||||
if(versionMap.value(QString::fromStdString(SOFTWARE_ISMAIN),"0") == "0")
|
||||
{
|
||||
ui->mainPathValue->setText(tr("无主程序路径"));
|
||||
}else
|
||||
{
|
||||
ui->mainPathValue->setText(versionMap.value(QString::fromStdString(SOFTWARE_MAINPATH)));
|
||||
}
|
||||
const std::string strFileName = "hmi_explorer.bat";
|
||||
QString strPath = QString::fromStdString( iot_public::CFileUtil::getPathOfBinDir(CN_DIR_PLATFORM));
|
||||
QDir pathFile(strPath);
|
||||
pathFile.cdUp();
|
||||
pathFile.cdUp();
|
||||
|
||||
ui->mainPathValue->setText(pathFile.absolutePath());
|
||||
|
||||
if(versionMap.value(QString::fromStdString(SOFTWARE_ISDB),"0") == "0")
|
||||
{
|
||||
ui->dbPathValue->setText(tr("无数据库路径"));
|
||||
@ -81,6 +82,7 @@ void VersionForm::initView()
|
||||
|
||||
void VersionForm::showInFolder(const QString &path)
|
||||
{
|
||||
initView();
|
||||
QFileInfo info(path);
|
||||
#if defined(Q_OS_WIN)
|
||||
QStringList args;
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
1042
product/src/sys/sys_startup/en.ts
Normal file
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 17 KiB |
@ -118,6 +118,15 @@ exists($$SIGAR_PRI) {
|
||||
|
||||
DEFINES += QAPPLICATION_CLASS=QApplication
|
||||
|
||||
# 判架构
|
||||
contains(QMAKE_HOST.arch, x86_64): !linux-aarch64*{
|
||||
message("Host is amd64")
|
||||
DEFINES += KBD_X86
|
||||
}
|
||||
else{
|
||||
DEFINES += KBD_ARM
|
||||
message("Host is arm64")
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
COMMON_PRI=$$PWD/../../common.pri
|
||||
@ -133,3 +142,5 @@ contains(DEFINES, OS_WINDOWS) {
|
||||
|
||||
RESOURCES += \
|
||||
resource.qrc
|
||||
|
||||
TRANSLATIONS = $$PWD/en.ts
|
||||
|
||||