增加升级工程HGUpgrade

This commit is contained in:
luoliangyi 2022-06-29 17:46:00 +08:00
parent 97330f33c1
commit 112b65da8f
26 changed files with 595 additions and 265 deletions

36
app/scanner/HGVersion.cpp Normal file
View File

@ -0,0 +1,36 @@
#include "HGVersion.h"
bool GetServerConfig(ServerConfig& cfg)
{
return false;
}
bool PostCrashInfo(const char* crashFilePath)
{
return false;
}
bool PostUserHabits(const std::string& habits)
{
return false;
}
std::string GetCurrVersion()
{
return "";
}
bool GetVersionInfoList(std::list<VersionInfo>& versionList)
{
return false;
}
int CompareVersion(const std::string& version1, const std::string& version2)
{
return 0;
}
bool HttpDownload(const char* url, const char* saveFilePath, HttpDownloadFunc func, void* param)
{
return false;
}

51
app/scanner/HGVersion.h Normal file
View File

@ -0,0 +1,51 @@
#ifndef __HGVERSION_H__
#define __HGVERSION_H__
#include <string>
#include <list>
struct ServerConfig
{
// 是否上传崩溃日志
bool postCrashInfo;
// 是否上传用户使用习惯
bool postUserHabits;
};
struct VersionInfo
{
std::string version;
std::string desc;
std::string bugInfo;
std::string url;
unsigned long long size;
std::string md5;
};
/* http下载进度回调
* : 0;0
*/
typedef int (*HttpDownloadFunc)(long long totalSize, long long nowSize, void *param);
// 获取服务器配置
bool GetServerConfig(ServerConfig &cfg);
// 上传崩溃日志
bool PostCrashInfo(const char* crashFilePath);
// 上传用户使用习惯
bool PostUserHabits(const std::string& habits);
// 获取当前版本号
std::string GetCurrVersion();
// 获取服务器上所有版本的信息
bool GetVersionInfoList(std::list<VersionInfo> &versionList);
// 比较版本号, 负数表示version1<version2, 0表示相等正数表示version1>version2
int CompareVersion(const std::string& version1, const std::string& version2);
// 下载HTTP文件
bool HttpDownload(const char* url, const char* saveFilePath, HttpDownloadFunc func, void *param);
#endif /* __HGVERSION_H__ */

16
app/upgrade/HGUpgrade.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "HGUpgrade.h"
bool PostInstallInfo()
{
return false;
}
bool PostUninstallInfo()
{
return false;
}
bool Upgrade(const std::string& pkgPath)
{
return false;
}

15
app/upgrade/HGUpgrade.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef __HGUPGRADE_H__
#define __HGUPGRADE_H__
#include <string>
// 上传安装日志
bool PostInstallInfo();
// 上传卸载日志
bool PostUninstallInfo();
// 升级安装, 使用之前的安装路径
bool Upgrade(const std::string& pkgPath);
#endif /* __HGUPGRADE_H__ */

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1001 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

11
app/upgrade/main.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@ -0,0 +1,15 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}

21
app/upgrade/mainwindow.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H

22
app/upgrade/mainwindow.ui Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar"/>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,249 +0,0 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# OEM definition
DEFINES += OEM_HUAGAO
RC_ICONS = ../../app/scanner/image_rsc/logo/logo.ico
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# 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
TARGET = HuaGoScan
win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS
contains(QT_ARCH, i386) {
LIBS += -L../../../sdk/lib/win/x86/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane
CONFIG(release, debug|release) {
DESTDIR = ../../../release/win/x86/Release/
}
CONFIG(debug, debug|release) {
}
}
else {
LIBS += -L../../../sdk/lib/win/x64/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane
CONFIG(release, debug|release) {
DESTDIR = ../../../release/win/x64/Release/
}
CONFIG(debug, debug|release) {
}
}
}
unix {
DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1)
message($$DISTRIBUTION)
ARCH = $$system(arch)
message($$ARCH)
contains(DISTRIBUTION, UnionTech){
message('UOS')
DEFINES += UOS
contains(ARCH, x86_64){
LIBS += -L../../../release/uos/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/uos/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
LIBS += -L../../../release/uos/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/uos/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
LIBS += -L../../../release/uos/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/uos/mips64/
}
CONFIG(debug, debug|release) {
}
}
}else{
message('KYLIN')
DEFINES += KYLIN
contains(ARCH, x86_64){
LIBS += -L../../../release/kylin/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/kylin/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
LIBS += -L../../../release/kylin/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/kylin/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
LIBS += -L../../../release/kylin/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../release/kylin/mips64/
}
CONFIG(debug, debug|release) {
}
}
}
}
INCLUDEPATH += $$PWD/../../app/scanner/
INCLUDEPATH += $$PWD/../../utility/
INCLUDEPATH += $$PWD/../../modules/
INCLUDEPATH += $$PWD/../../../sdk/include/
SOURCES += \
../../app/scanner/app_cfg.cpp \
../../app/scanner/cutdialog.cpp \
../../app/scanner/cutpapertool.cpp \
../../app/scanner/device_menu.cpp \
../../app/scanner/dialog_aquireinto.cpp \
../../app/scanner/dialog_clrcache.cpp \
../../app/scanner/dialog_export.cpp \
../../app/scanner/dialog_exportimagefile.cpp \
../../app/scanner/dialog_fullscreen.cpp \
../../app/scanner/dialog_imageeditor.cpp \
../../app/scanner/dialog_imageinfo.cpp \
../../app/scanner/dialog_imgproc_adjust.cpp \
../../app/scanner/dialog_imgproc_autocrop.cpp \
../../app/scanner/dialog_insertindex.cpp \
../../app/scanner/dialog_logmanager.cpp \
../../app/scanner/dialog_moveto.cpp \
../../app/scanner/dialog_multirotate.cpp \
../../app/scanner/dialog_multirotateimagefile.cpp \
../../app/scanner/dialog_openimageindex.cpp \
../../app/scanner/dialog_passwordchange.cpp \
../../app/scanner/dialog_saveas.cpp \
../../app/scanner/dialog_writesettings.cpp \
../../app/scanner/gaosixy.cpp \
../../app/scanner/graphicsscene.cpp \
../../app/scanner/hg_settingdialog.cpp \
../../app/scanner/main.cpp \
../../app/scanner/mainwindow.cpp \
../../app/scanner/sane_device.cpp \
../../app/scanner/setpicclrtool.cpp \
../../app/scanner/widget.cpp \
../../app/scanner/widget_imgproc_base.cpp \
../../app/scanner/widget_statusbar.cpp \
../../app/scanner/dialog_admin.cpp \
../../app/scanner/dialog_log.cpp \
../../app/scanner/config.cpp \
../../app/scanner/json.cpp \
../../app/scanner/cJSON.c \
../../app/scanner/HGImgThumb.cpp \
../../app/scanner/HGImgView.cpp \
../../app/scanner/HGUIGlobal.cpp \
../../utility/HGString.cpp \
../../app/scanner/dialog_input.cpp
HEADERS += \
../../app/scanner/app_cfg.h \
../../app/scanner/cutdialog.h \
../../app/scanner/cutpapertool.h \
../../app/scanner/device_menu.h \
../../app/scanner/dialog_aquireinto.h \
../../app/scanner/dialog_clrcache.h \
../../app/scanner/dialog_export.h \
../../app/scanner/dialog_exportimagefile.h \
../../app/scanner/dialog_fullscreen.h \
../../app/scanner/dialog_imageeditor.h \
../../app/scanner/dialog_imageinfo.h \
../../app/scanner/dialog_imgproc_adjust.h \
../../app/scanner/dialog_imgproc_autocrop.h \
../../app/scanner/dialog_insertindex.h \
../../app/scanner/dialog_logmanager.h \
../../app/scanner/dialog_moveto.h \
../../app/scanner/dialog_multirotate.h \
../../app/scanner/dialog_multirotateimagefile.h \
../../app/scanner/dialog_openimageindex.h \
../../app/scanner/dialog_passwordchange.h \
../../app/scanner/dialog_saveas.h \
../../app/scanner/dialog_writesettings.h \
../../app/scanner/gaosixy.h \
../../app/scanner/graphicsscene.h \
../../app/scanner/hg_settingdialog.h \
../../app/scanner/mainwindow.h \
../../app/scanner/sane_device.h \
../../app/scanner/setpicclrtool.h \
../../app/scanner/widget.h \
../../app/scanner/widget_imgproc_base.h \
../../app/scanner/widget_statusbar.h \
../../app/scanner/dialog_admin.h \
../../app/scanner/dialog_log.h \
../../app/scanner/config.h \
../../app/scanner/json.h \
../../app/scanner/cJSON.h \
../../app/scanner/HGImgThumb.h \
../../app/scanner/HGImgView.h \
../../app/scanner/HGUIGlobal.h \
../../utility/HGString.h \
../../app/scanner/dialog_input.h \
../../app/scanner/custom_file_dialog.h
FORMS += \
../../app/scanner/cutdialog.ui \
../../app/scanner/cutpapertool.ui \
../../app/scanner/dialog_admin.ui \
../../app/scanner/dialog_aquireinto.ui \
../../app/scanner/dialog_clrcache.ui \
../../app/scanner/dialog_export.ui \
../../app/scanner/dialog_exportimagefile.ui \
../../app/scanner/dialog_fullscreen.ui \
../../app/scanner/dialog_imageeditor.ui \
../../app/scanner/dialog_imageinfo.ui \
../../app/scanner/dialog_imgproc_adjust.ui \
../../app/scanner/dialog_imgproc_autocrop.ui \
../../app/scanner/dialog_insertindex.ui \
../../app/scanner/dialog_logmanager.ui \
../../app/scanner/dialog_moveto.ui \
../../app/scanner/dialog_multirotate.ui \
../../app/scanner/dialog_multirotateimagefile.ui \
../../app/scanner/dialog_openimageindex.ui \
../../app/scanner/dialog_passwordchange.ui \
../../app/scanner/dialog_saveas.ui \
../../app/scanner/dialog_writesettings.ui \
../../app/scanner/mainwindow.ui \
../../app/scanner/setpicclrtool.ui \
../../app/scanner/widget.ui \
../../app/scanner/widget_imgproc_base.ui \
../../app/scanner/widget_statusbar.ui \
../../app/scanner/dialog_log.ui \
../../app/scanner/dialog_input.ui
TRANSLATIONS += \
../../app/scanner/Scanner_zh_CN.ts \
../../app/scanner/qt_zh_CN.ts
RESOURCES += \
../../app/scanner/Scanner_resource.qrc
DISTFILES += \
../../app/scanner/Scanner_zh_CN.qm \
../../app/scanner/qt_zh_CN.qm

View File

@ -0,0 +1,251 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# OEM definition
DEFINES += OEM_HUAGAO
RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# 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
TARGET = HuaGoScan
win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS
contains(QT_ARCH, i386) {
LIBS += -L../../../../sdk/lib/win/x86/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/win/x86/Release/
}
CONFIG(debug, debug|release) {
}
}
else {
LIBS += -L../../../../sdk/lib/win/x64/Release -lHGBase -lHGImgFmt -lHGImgProc -lsane
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/win/x64/Release/
}
CONFIG(debug, debug|release) {
}
}
}
unix {
DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1)
message($$DISTRIBUTION)
ARCH = $$system(arch)
message($$ARCH)
contains(DISTRIBUTION, UnionTech){
message('UOS')
DEFINES += UOS
contains(ARCH, x86_64){
LIBS += -L../../../../release/uos/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
LIBS += -L../../../../release/uos/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
LIBS += -L../../../../release/uos/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/mips64/
}
CONFIG(debug, debug|release) {
}
}
}else{
message('KYLIN')
DEFINES += KYLIN
contains(ARCH, x86_64){
LIBS += -L../../../../release/kylin/x86_64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
LIBS += -L../../../../release/kylin/aarch64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
LIBS += -L../../../../release/kylin/mips64 -lHGBase -lHGImgFmt -lHGImgProc -lsane-hgsane -lhgdriver
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/mips64/
}
CONFIG(debug, debug|release) {
}
}
}
}
INCLUDEPATH += $$PWD/../../../app/scanner/
INCLUDEPATH += $$PWD/../../../utility/
INCLUDEPATH += $$PWD/../../../modules/
INCLUDEPATH += $$PWD/../../../../sdk/include/
SOURCES += \
../../../app/scanner/HGVersion.cpp \
../../../app/scanner/app_cfg.cpp \
../../../app/scanner/cutdialog.cpp \
../../../app/scanner/cutpapertool.cpp \
../../../app/scanner/device_menu.cpp \
../../../app/scanner/dialog_aquireinto.cpp \
../../../app/scanner/dialog_clrcache.cpp \
../../../app/scanner/dialog_export.cpp \
../../../app/scanner/dialog_exportimagefile.cpp \
../../../app/scanner/dialog_fullscreen.cpp \
../../../app/scanner/dialog_imageeditor.cpp \
../../../app/scanner/dialog_imageinfo.cpp \
../../../app/scanner/dialog_imgproc_adjust.cpp \
../../../app/scanner/dialog_imgproc_autocrop.cpp \
../../../app/scanner/dialog_insertindex.cpp \
../../../app/scanner/dialog_logmanager.cpp \
../../../app/scanner/dialog_moveto.cpp \
../../../app/scanner/dialog_multirotate.cpp \
../../../app/scanner/dialog_multirotateimagefile.cpp \
../../../app/scanner/dialog_openimageindex.cpp \
../../../app/scanner/dialog_passwordchange.cpp \
../../../app/scanner/dialog_saveas.cpp \
../../../app/scanner/dialog_writesettings.cpp \
../../../app/scanner/gaosixy.cpp \
../../../app/scanner/graphicsscene.cpp \
../../../app/scanner/hg_settingdialog.cpp \
../../../app/scanner/main.cpp \
../../../app/scanner/mainwindow.cpp \
../../../app/scanner/sane_device.cpp \
../../../app/scanner/setpicclrtool.cpp \
../../../app/scanner/widget.cpp \
../../../app/scanner/widget_imgproc_base.cpp \
../../../app/scanner/widget_statusbar.cpp \
../../../app/scanner/dialog_admin.cpp \
../../../app/scanner/dialog_log.cpp \
../../../app/scanner/config.cpp \
../../../app/scanner/json.cpp \
../../../app/scanner/cJSON.c \
../../../app/scanner/HGImgThumb.cpp \
../../../app/scanner/HGImgView.cpp \
../../../app/scanner/HGUIGlobal.cpp \
../../../utility/HGString.cpp \
../../../app/scanner/dialog_input.cpp
HEADERS += \
../../../app/scanner/HGVersion.h \
../../../app/scanner/app_cfg.h \
../../../app/scanner/cutdialog.h \
../../../app/scanner/cutpapertool.h \
../../../app/scanner/device_menu.h \
../../../app/scanner/dialog_aquireinto.h \
../../../app/scanner/dialog_clrcache.h \
../../../app/scanner/dialog_export.h \
../../../app/scanner/dialog_exportimagefile.h \
../../../app/scanner/dialog_fullscreen.h \
../../../app/scanner/dialog_imageeditor.h \
../../../app/scanner/dialog_imageinfo.h \
../../../app/scanner/dialog_imgproc_adjust.h \
../../../app/scanner/dialog_imgproc_autocrop.h \
../../../app/scanner/dialog_insertindex.h \
../../../app/scanner/dialog_logmanager.h \
../../../app/scanner/dialog_moveto.h \
../../../app/scanner/dialog_multirotate.h \
../../../app/scanner/dialog_multirotateimagefile.h \
../../../app/scanner/dialog_openimageindex.h \
../../../app/scanner/dialog_passwordchange.h \
../../../app/scanner/dialog_saveas.h \
../../../app/scanner/dialog_writesettings.h \
../../../app/scanner/gaosixy.h \
../../../app/scanner/graphicsscene.h \
../../../app/scanner/hg_settingdialog.h \
../../../app/scanner/mainwindow.h \
../../../app/scanner/sane_device.h \
../../../app/scanner/setpicclrtool.h \
../../../app/scanner/widget.h \
../../../app/scanner/widget_imgproc_base.h \
../../../app/scanner/widget_statusbar.h \
../../../app/scanner/dialog_admin.h \
../../../app/scanner/dialog_log.h \
../../../app/scanner/config.h \
../../../app/scanner/json.h \
../../../app/scanner/cJSON.h \
../../../app/scanner/HGImgThumb.h \
../../../app/scanner/HGImgView.h \
../../../app/scanner/HGUIGlobal.h \
../../../utility/HGString.h \
../../../app/scanner/dialog_input.h \
../../../app/scanner/custom_file_dialog.h
FORMS += \
../../../app/scanner/cutdialog.ui \
../../../app/scanner/cutpapertool.ui \
../../../app/scanner/dialog_admin.ui \
../../../app/scanner/dialog_aquireinto.ui \
../../../app/scanner/dialog_clrcache.ui \
../../../app/scanner/dialog_export.ui \
../../../app/scanner/dialog_exportimagefile.ui \
../../../app/scanner/dialog_fullscreen.ui \
../../../app/scanner/dialog_imageeditor.ui \
../../../app/scanner/dialog_imageinfo.ui \
../../../app/scanner/dialog_imgproc_adjust.ui \
../../../app/scanner/dialog_imgproc_autocrop.ui \
../../../app/scanner/dialog_insertindex.ui \
../../../app/scanner/dialog_logmanager.ui \
../../../app/scanner/dialog_moveto.ui \
../../../app/scanner/dialog_multirotate.ui \
../../../app/scanner/dialog_multirotateimagefile.ui \
../../../app/scanner/dialog_openimageindex.ui \
../../../app/scanner/dialog_passwordchange.ui \
../../../app/scanner/dialog_saveas.ui \
../../../app/scanner/dialog_writesettings.ui \
../../../app/scanner/mainwindow.ui \
../../../app/scanner/setpicclrtool.ui \
../../../app/scanner/widget.ui \
../../../app/scanner/widget_imgproc_base.ui \
../../../app/scanner/widget_statusbar.ui \
../../../app/scanner/dialog_log.ui \
../../../app/scanner/dialog_input.ui
TRANSLATIONS += \
../../../app/scanner/Scanner_zh_CN.ts \
../../../app/scanner/qt_zh_CN.ts
RESOURCES += \
../../../app/scanner/Scanner_resource.qrc
DISTFILES += \
../../../app/scanner/Scanner_zh_CN.qm \
../../../app/scanner/qt_zh_CN.qm

View File

@ -0,0 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += \
HGScanner \
HGUpgrade

View File

@ -0,0 +1,123 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# OEM definition
DEFINES += OEM_HUAGAO
RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# 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
TARGET = HuaGoScanUpgrade
win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS
contains(QT_ARCH, i386) {
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/win/x86/Release/
}
CONFIG(debug, debug|release) {
}
}
else {
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/win/x64/Release/
}
CONFIG(debug, debug|release) {
}
}
}
unix {
DISTRIBUTION = $$system(cat /etc/issue | cut -d\' \' -f1)
message($$DISTRIBUTION)
ARCH = $$system(arch)
message($$ARCH)
contains(DISTRIBUTION, UnionTech){
message('UOS')
DEFINES += UOS
contains(ARCH, x86_64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/uos/mips64/
}
CONFIG(debug, debug|release) {
}
}
}else{
message('KYLIN')
DEFINES += KYLIN
contains(ARCH, x86_64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/x86_64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, aarch64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/aarch64/
}
CONFIG(debug, debug|release) {
}
}
contains(ARCH, mips64){
CONFIG(release, debug|release) {
DESTDIR = ../../../../release/kylin/mips64/
}
CONFIG(debug, debug|release) {
}
}
}
}
INCLUDEPATH += $$PWD/../../../app/upgrade/
INCLUDEPATH += $$PWD/../../../utility/
INCLUDEPATH += $$PWD/../../../modules/
SOURCES += \
../../../app/upgrade/HGUpgrade.cpp \
../../../app/upgrade/main.cpp \
../../../app/upgrade/mainwindow.cpp
HEADERS += \
../../../app/upgrade/HGUpgrade.h \
../../../app/upgrade/mainwindow.h
FORMS += \
../../../app/upgrade/mainwindow.ui

View File

@ -1,12 +1,23 @@
MSBuild.exe ./build/windows/HGSolution.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild
MSBuild.exe ./build/windows/HGSolution.sln /p:Configuration=Release /p:Platform=x86
cd /d ./build-qt/HGSolution/
cd /d ./build-qt/HGSolution/HGScanner
qmake -r -tp vc HGScanner.pro
MSBuild.exe HGScanner.vcxproj /p:Configuration=Release /p:Platform=x86
MSBuild.exe HuaGoScan.vcxproj /p:Configuration=Release /p:Platform=x86
del /f /s /q *.h
del /f /s /q .qmake.stash
del /f /s /q HGScanner_resource.rc
del /f /s /q HGScanner.vcxproj.filters
del /f /s /q HGScanner.vcxproj
del /f /s /q HuaGoScan_resource.rc
del /f /s /q HuaGoScan.vcxproj.filters
del /f /s /q HuaGoScan.vcxproj
rd /s /q debug
rd /s /q release
cd /d ../HGUpgrade
qmake -r -tp vc HGUpgrade.pro
MSBuild.exe HuaGoScanUpgrade.vcxproj /p:Configuration=Release /p:Platform=x86
del /f /s /q *.h
del /f /s /q .qmake.stash
del /f /s /q HuaGoScanUpgrade_resource.rc
del /f /s /q HuaGoScanUpgrade.vcxproj.filters
del /f /s /q HuaGoScanUpgrade.vcxproj
rd /s /q debug
rd /s /q release

View File

@ -45,13 +45,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGTwainUser", "HGTwainUser\
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HGUpload", "HGUpload\HGUpload.vcxproj", "{FC39DAEA-2BB2-45AE-A7F3-F3879692A66B}"
ProjectSection(ProjectDependencies) = postProject
{F85F4457-1B42-46E7-BA86-F088D6D5994F} = {F85F4457-1B42-46E7-BA86-F088D6D5994F}
{EFAE5F69-A4C2-4A07-8BE6-68714D86BCE2} = {EFAE5F69-A4C2-4A07-8BE6-68714D86BCE2}
{4954F36B-A0A3-4550-9C4E-3B3D210F5CE4} = {4954F36B-A0A3-4550-9C4E-3B3D210F5CE4}
{5D85F2AC-FACD-436C-A67B-E13056DD0C03} = {5D85F2AC-FACD-436C-A67B-E13056DD0C03}
{4909ACEA-80FF-482E-9FA2-5E8534789A82} = {4909ACEA-80FF-482E-9FA2-5E8534789A82}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -2827,6 +2827,12 @@ namespace ver_2
return (HGBASE_ERR_OK == HGBase_SetProfileInt(cfgPath, app.c_str(), key.c_str(), (HGInt)val));
}
static int xferinfo(void* p, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
{
HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "ulnow=%lld, ultotal=%lld", ulnow, ultotal);
return 0;
}
int ManagerV2::HttpUpload(const std::string& host, int port, const std::string& path,
const std::string& filePath, const std::string& remoteFilePath)
{
@ -2849,6 +2855,9 @@ namespace ver_2
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
/* Perform the request, res will get the return code */
CURLcode res = curl_easy_perform(curl);
/* Check for errors */
@ -2925,9 +2934,6 @@ namespace ver_2
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
/* pass in that last of FTP commands to run after the transfer */
//curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
/* now specify which file to upload */
curl_easy_setopt(curl, CURLOPT_READDATA, file);
@ -2937,6 +2943,9 @@ namespace ver_2
make sure that to pass in a type 'long' argument. */
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
/* Now run off and do what you have been told! */
CURLcode res = curl_easy_perform(curl);
/* Check for errors */