[ref]同步711

This commit is contained in:
shi_jq 2025-03-13 15:11:09 +08:00
parent 6dd040281f
commit 4d148e489c
8 changed files with 22 additions and 44 deletions

View File

@ -338,8 +338,8 @@ void CUpgradeWorker::slotExeDb()
connect(m_installHelperProcess,QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),this,&CUpgradeWorker::slotInstallHelperFinishedHandler); connect(m_installHelperProcess,QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),this,&CUpgradeWorker::slotInstallHelperFinishedHandler);
connect(m_installHelperProcess,&QProcess::readyReadStandardOutput,this,&CUpgradeWorker::slotInstallHelperHandler); connect(m_installHelperProcess,&QProcess::readyReadStandardOutput,this,&CUpgradeWorker::slotInstallHelperHandler);
} }
QString program = m_installPath + QDir::separator() + "product" +QDir::separator() + m_exePath + QDir::separator() + INSTALL_HELPER_EXEC_NAME; QString program = m_installPath + QDir::separator() + "product" +QDir::separator() + m_exePath + QDir::separator() + UPGRADE_HELPER_EXEC_NAME;
//QString program = m_installPath + QDir::separator() + "platform" +QDir::separator() + m_exePath + QDir::separator() + INSTALL_HELPER_EXEC_NAME; //QString program = m_installPath + QDir::separator() + "platform" +QDir::separator() + m_exePath + QDir::separator() + UPGRADE_HELPER_EXEC_NAME;
qDebug() << "program "<<program << " arguments:" << arguments; qDebug() << "program "<<program << " arguments:" << arguments;
m_installHelperProcess->start(program,arguments); m_installHelperProcess->start(program,arguments);
@ -504,7 +504,7 @@ QFileInfoList CUpgradeWorker::getOwnFile(const QString &path)
for(int i = 0; i < file_list.size(); i++) for(int i = 0; i < file_list.size(); i++)
{ {
QString name = file_list.at(i).fileName(); QString name = file_list.at(i).fileName();
if(name == "iot_upgrade_abcdefghigklmnopqrstuvwxyz.txt") if(name == "kbd_upgrade_abcdefghigklmnopqrstuvwxyz.txt")
{ {
list.append(file_list.at(i)); list.append(file_list.at(i));
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -4,42 +4,16 @@
#pragma once #pragma once
#include <QString> #include <QString>
#include "setup/CommonDef.h"
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
#define SYS_CONFIG_PATH "C:/Program Files/PowerSCADA3000"
#endif
#ifdef OS_LINUX
#define SYS_CONFIG_PATH "/etc/powerscada3000"
#endif
#define INSTALLER_UNIQUE_NAME "iscs6000_installer"
const static int pos_min_x=10;
const static int pos_max_x=560;
const static int pos_min_y=10;
const static int pos_max_y=400;
#ifdef OS_WINDOWS
#define SYS_CONFIG_PATH "C:/Program Files/PowerSCADA3000"
#define UNINSTALL_EXEC_NAME "uninstall.exe"
#define INSTALL_HELPER_EXEC_NAME "upgrade_install_helper.exe"
#define INSTALL_FREFIX "D:"
#define DB_MANAGER_EXE_NAME "db_manager.exe" #define DB_MANAGER_EXE_NAME "db_manager.exe"
#endif #endif
#ifdef OS_LINUX #ifdef OS_LINUX
#define SYS_CONFIG_PATH "/etc/powerscada3000"
#define UNINSTALL_EXEC_NAME "uninstall"
#define INSTALL_HELPER_EXEC_NAME "upgrade_install_helper"
#define INSTALL_FREFIX "/opt"
#define DB_MANAGER_EXE_NAME "db_manager" #define DB_MANAGER_EXE_NAME "db_manager"
#endif #endif
#define USER_NAME_DEFINE "root";
#define PASSWORD_DEFINE "kbdct@0755";
struct StOldProjectInfo struct StOldProjectInfo
{ {
int projectId; int projectId;
@ -68,6 +42,7 @@ struct StNewUpgradeInfo
} }
}; };
/*
struct StDbInfo struct StDbInfo
{ {
QString dbIp; QString dbIp;
@ -77,11 +52,12 @@ struct StDbInfo
QString dbPassword; QString dbPassword;
StDbInfo(){ StDbInfo(){
dbIp = "127.0.0.1"; dbIp = "127.0.0.1";
dbName = "iscs6000"; dbName = EMS_DEFAULT_DATABASE;
dbUser ="root"; dbUser ="root";
dbPort = 3306; dbPort = 3306;
dbPassword ="kbdct@0755"; dbPassword = EMS_DEFAULT_PASSWD;
} }
}; };
*/
#endif // UPGRADECOMMON_H #endif // UPGRADECOMMON_H

View File

@ -134,8 +134,8 @@ bool MainWindow::addDefaultEmptyDir(const QString &src_path)
QString exePath = dir.currentPath(); QString exePath = dir.currentPath();
QDir::setCurrent(src_path); QDir::setCurrent(src_path);
qDebug()<<dir.absolutePath(); qDebug()<<dir.absolutePath();
file.setFileName("iot_upgrade_abcdefghigklmnopqrstuvwxyz.txt"); file.setFileName("kbd_upgrade_abcdefghigklmnopqrstuvwxyz.txt");
QString content ="iot_upgrade_abcdefghigklmnopqrstuvwxyz"; QString content ="kbd_upgrade_abcdefghigklmnopqrstuvwxyz";
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) if(file.open(QIODevice::WriteOnly | QIODevice::Text))
{ {
QByteArray str = content.toUtf8(); QByteArray str = content.toUtf8();
@ -266,11 +266,11 @@ void MainWindow::on_pushButton_clicked()
void MainWindow::on_pushButton_2_clicked() void MainWindow::on_pushButton_2_clicked()
{ {
int proId = ui->cb_id->currentData().toInt(); int proId = ui->cb_id->currentData().toInt();
if(proId == 40) // if(proId == 40)
{ // {
ui->textEdit->append(tr("请选择一个产品线补丁")); // ui->textEdit->append(tr("请选择一个产品线补丁"));
return ; // return ;
} // }
QString path = ui->lineEdit_path->text().trimmed(); QString path = ui->lineEdit_path->text().trimmed();
QString name = ui->lineEdit_name->text().trimmed(); QString name = ui->lineEdit_name->text().trimmed();
if(path.isEmpty()) if(path.isEmpty())
@ -457,7 +457,7 @@ QFileInfoList MainWindow::getOwnFile(const QString &path)
for(int i = 0; i < file_list.size(); i++) for(int i = 0; i < file_list.size(); i++)
{ {
QString name = file_list.at(i).fileName(); QString name = file_list.at(i).fileName();
if(name == "iot_upgrade_abcdefghigklmnopqrstuvwxyz.txt") if(name == "kbd_upgrade_abcdefghigklmnopqrstuvwxyz.txt")
{ {
list.append(file_list.at(i)); list.append(file_list.at(i));
} }
@ -631,20 +631,20 @@ void MainWindow::writeVerInfotoFile()
} }
if(node.toElement().attribute("key")=="exe_path") if(node.toElement().attribute("key")=="exe_path")
{ {
QString exePath = "windows10_debug"; QString exePath = QString("windows10_%1").arg(DIR_DEBUG_RELEASE_DIR);
int type = ui->cb_plat->currentData().toInt(); int type = ui->cb_plat->currentData().toInt();
if(type == 1) if(type == 1)
{ {
exePath = "windows10_debug"; exePath = QString("windows10_%1").arg(DIR_DEBUG_RELEASE_DIR);
} }
else if (type == 2) else if (type == 2)
{ {
exePath = "centos7_debug"; exePath = QString("centos7_%1").arg(DIR_DEBUG_RELEASE_DIR);
} }
else if (type == 3) else if (type == 3)
{ {
exePath = "kylin10d_debug"; exePath = QString("kylin10d_%1").arg(DIR_DEBUG_RELEASE_DIR);
} }
list.at(i).toElement().setAttribute("value",exePath); list.at(i).toElement().setAttribute("value",exePath);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -15,6 +15,8 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt. # You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
DEFINES += DIR_DEBUG_RELEASE_DIR=\\\"$$(DIR_DEBUG_RELEASE)\\\"
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
MainWindow.cpp MainWindow.cpp