diff --git a/app/scanner2/mainwindow.cpp b/app/scanner2/mainwindow.cpp index 90165b0b..b1f819a4 100644 --- a/app/scanner2/mainwindow.cpp +++ b/app/scanner2/mainwindow.cpp @@ -3194,7 +3194,7 @@ void MainWindow::on_act_about_triggered() #if defined (OEM_LISICHENG) buildVersion = 14; -#elif defined (OEM_HANWNAG) +#elif defined (OEM_HANWANG) buildVersion = 16; #elif defined (OEM_CANGTIAN) buildVersion = 18; diff --git a/app/scanner2/resource.h b/app/scanner2/resource.h new file mode 100644 index 00000000..f2d4e6d8 --- /dev/null +++ b/app/scanner2/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ 生成的包含文件。 +// 供 HuaGoScan2.rc 使用 +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/app/scanner2/resource.rc b/app/scanner2/resource.rc new file mode 100644 index 00000000..5d61048c --- /dev/null +++ b/app/scanner2/resource.rc @@ -0,0 +1,170 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// 中文(简体,中国) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +#if defined(OEM_HANWANG) +IDI_ICON1 ICON "image_rsc\\logo\\Hanvon_logo1.ico" +#elif defined(OEM_LISICHENG) +IDI_ICON1 ICON "image_rsc\\logo\\Lanxum_logo.ico" +#elif defined(OEM_CANGTIAN) +IDI_ICON1 ICON "image_rsc\\logo\\Cumtenn_logo.ico" +#elif defined(OEM_ZHONGJING) +IDI_ICON1 ICON "image_rsc\\logo\\Microtek_logo.ico" +#elif defined(OEM_ZIGUANG) +IDI_ICON1 ICON "image_rsc\\logo\\uniscan.ico" +#elif defined(OEM_NEUTRAL) +IDI_ICON1 ICON "image_rsc\\logo\\NoBrand_logo.ico" +#elif defined(OEM_DELI) +IDI_ICON1 ICON "image_rsc\\logo\\deli.ico" +#else +IDI_ICON1 ICON "image_rsc\\logo\\logo.ico" +#endif + +#endif // 中文(简体,中国) resources +///////////////////////////////////////////////////////////////////////////// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,0,0 + PRODUCTVERSION 0,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000403a8" + BEGIN + VALUE "FileVersion", "0.0.0.0\0" + VALUE "ProductVersion", "0.0.0.0\0" +#if defined(OEM_HANWANG) + VALUE "ProductName", "HANVONSCAN\0" + VALUE "CompanyName", "汉王科技股份有限公司\0" + VALUE "FileDescription", "汉王扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) HANVONSCAN 2023\0" + VALUE "InternalName", "HanvonScan.exe\0" + VALUE "OriginalFilename", "HanvonScan.exe\0" +#elif defined(OEM_LISICHENG) + VALUE "ProductName", "LANXUMSCAN\0" + VALUE "CompanyName", "立思辰信息科技有限公司\0" + VALUE "FileDescription", "立思辰扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) LANXUMSCAN 2023\0" + VALUE "InternalName", "LanxumScan.exe\0" + VALUE "OriginalFilename", "LanxumScan.exe\0" +#elif defined(OEM_CANGTIAN) + VALUE "ProductName", "CUMTENNSCAN\0" + VALUE "CompanyName", "浙江沧田智能信息科技有限公司\0" + VALUE "FileDescription", "沧田扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) CUMTENNSCAN 2023\0" + VALUE "InternalName", "CumtennScan.exe\0" + VALUE "OriginalFilename", "CumtennScan.exe\0" +#elif defined(OEM_ZHONGJING) + VALUE "ProductName", "MICROTEKSCAN\0" + VALUE "CompanyName", "Microtek DocWizard EX\0" + VALUE "FileDescription", "Microtek DocWizard EX App\0" + VALUE "LegalCopyright", "Copyright (C) MICROTEKSCAN 2023\0" + VALUE "InternalName", "MicrotekScan.exe\0" + VALUE "OriginalFilename", "MicrotekScan.exe\0" +#elif defined(OEM_ZIGUANG) + VALUE "ProductName", "UNISCAN\0" + VALUE "CompanyName", "紫光股份有限公司\0" + VALUE "FileDescription", "紫光扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) UNISCAN 2023\0" + VALUE "InternalName", "UniScan.exe\0" + VALUE "OriginalFilename", "UniScan.exe\0" +#elif defined(OEM_NEUTRAL) + VALUE "ProductName", "SCANNER\0" + VALUE "CompanyName", "Scanner\0" + VALUE "FileDescription", "Scanner\0" + VALUE "LegalCopyright", "Copyright (C) SCANNER 2023\0" + VALUE "InternalName", "NeuScan.exe\0" + VALUE "OriginalFilename", "NeuScan.exe\0" +#elif defined(OEM_DELI) + VALUE "ProductName", "DELISCAN\0" + VALUE "CompanyName", "得力信息科技有限公司\0" + VALUE "FileDescription", "得力扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) DELISCAN 2023\0" + VALUE "InternalName", "DeliScan.exe\0" + VALUE "OriginalFilename", "DeliScan.exe\0" +#else + VALUE "ProductName", "HUAGOSCAN\0" + VALUE "CompanyName", "宁波华高信息科技有限公司\0" + VALUE "FileDescription", "华高扫描仪应用程序\0" + VALUE "LegalCopyright", "Copyright (C) HUAGOSCAN 2023\0" + VALUE "InternalName", "HuaGoScan.exe\0" + VALUE "OriginalFilename", "HuaGoScan.exe\0" +#endif + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0004, 936 + END + END +/* End of Version info */ + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/build.bat b/build.bat index 6404d0a4..bba09445 100644 --- a/build.bat +++ b/build.bat @@ -3,14 +3,18 @@ set OEM=%1 cd /d ./build2/qt if "%OEM%" == "hw" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_HANWANG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_HANWANG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_HANWANG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_HANWANG" -r -tp vc HGTwainUI.pro MSBuild.exe HWTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_HANWANG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_HANWANG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_HANWANG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_HANWANG" -r -tp vc HGTwainUI.pro @@ -18,14 +22,18 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "lsc" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_LISICHENG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_LISICHENG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_LISICHENG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_LISICHENG" -r -tp vc HGTwainUI.pro MSBuild.exe LSCTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_LISICHENG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_LISICHENG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_LISICHENG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_LISICHENG" -r -tp vc HGTwainUI.pro @@ -33,14 +41,18 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "cts" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_CANGTIAN" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_CANGTIAN USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_CANGTIAN MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_CANGTIAN" -r -tp vc HGTwainUI.pro MSBuild.exe CTSTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_CANGTIAN" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_CANGTIAN USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_CANGTIAN MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_CANGTIAN" -r -tp vc HGTwainUI.pro @@ -48,14 +60,18 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "zj" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_ZHONGJING" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_ZHONGJING USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_ZHONGJING MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_ZHONGJING" -r -tp vc HGTwainUI.pro MSBuild.exe ZJTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_ZHONGJING" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_ZHONGJING USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_ZHONGJING MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_ZHONGJING" -r -tp vc HGTwainUI.pro @@ -63,14 +79,18 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "zg" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_ZIGUANG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_ZIGUANG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_ZIGUANG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_ZIGUANG" -r -tp vc HGTwainUI.pro MSBuild.exe ZGTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_ZIGUANG" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_ZIGUANG USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_ZIGUANG MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_ZIGUANG" -r -tp vc HGTwainUI.pro @@ -78,14 +98,18 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "neu" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_NEUTRAL" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_NEUTRAL USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_NEUTRAL MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_NEUTRAL" -r -tp vc HGTwainUI.pro MSBuild.exe NEUTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_NEUTRAL" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_NEUTRAL USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_NEUTRAL MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_NEUTRAL" -r -tp vc HGTwainUI.pro @@ -93,28 +117,36 @@ if "%OEM%" == "hw" ( cd /d ../ ) else ( if "%OEM%" == "dl" ( - %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_DELI" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += OEM_DELI USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 -oemName=OEM_DELI MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_DELI" -r -tp vc HGTwainUI.pro MSBuild.exe DLTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_DELI" -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += OEM_DELI USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -oemName=OEM_DELI MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake "DEFINES += OEM_DELI" -r -tp vc HGTwainUI.pro MSBuild.exe DLTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release cd /d ../ ) else ( - %QT_PATH%/msvc2017_64/bin/qmake -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017_64/bin/qmake "DEFINES += USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc -cpu=x64 MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d HGTwainUI %QT_STATIC_PATH%/x64-windows-static-md/tools/qt5/bin/qmake -r -tp vc HGTwainUI.pro MSBuild.exe HGTwainUI.vcxproj -t:rebuild /m:8 /p:Configuration=Release /p:Platform=x64 cd /d ../ - %QT_PATH%/msvc2017/bin/qmake -r -tp vc HGSolutionWin.pro + %QT_PATH%/msvc2017/bin/qmake "DEFINES += USE_SCRIPT" -r -tp vc HGSolutionWin.pro + cp %~dp0\app\scanner2\resource.rc %~dp0\app\scanner2\resourceTmp.rc + %~dp0\tools\hgsetver\release\hgsetver.exe -brandFile=%~dp0\..\sdk\include\huagao\brand.h -resourceFile=%~dp0\app\scanner2\resourceTmp.rc MSBuild.exe HGSolutionWin.sln -t:rebuild /m:8 /p:Configuration=Release cd /d HGTwainUI %QT_STATIC_PATH%/x86-windows-static-md/tools/qt5/bin/qmake -r -tp vc HGTwainUI.pro diff --git a/build2/qt/HGScanner2/HGScanner2.pro b/build2/qt/HGScanner2/HGScanner2.pro index 2bc1626f..df7c7c10 100644 --- a/build2/qt/HGScanner2/HGScanner2.pro +++ b/build2/qt/HGScanner2/HGScanner2.pro @@ -22,34 +22,26 @@ DEFINES += QT_NO_VERSION_TAGGING include($$PWD/../HGOEM.pri) if (contains(DEFINES, OEM_HANWANG)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/Hanvon_logo1.ico TARGET = HanvonScan2 } else { if (contains(DEFINES, OEM_LISICHENG)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/Lanxum_logo.ico TARGET = LanxumScan2 } else { if (contains(DEFINES, OEM_CANGTIAN)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/Cumtenn_logo.ico TARGET = CumtennScan2 } else { if (contains(DEFINES, OEM_ZHONGJING)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/Microtek_logo.ico TARGET = MicrotekScan2 } else { if (contains(DEFINES, OEM_ZIGUANG)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/uniscan.ico TARGET = UniScan2 } else { if (contains(DEFINES, OEM_NEUTRAL)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/NoBrand_logo.ico TARGET = NeuScan2 } else { if (contains(DEFINES, OEM_DELI)) { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/deli.ico TARGET = "DELI SCAN2" } else { - RC_ICONS = ../../../app/scanner2/image_rsc/logo/logo.ico TARGET = HuaGoScan2 } } @@ -68,6 +60,11 @@ CONFIG(release, debug|release) { win32 { + if (contains(DEFINES, USE_SCRIPT)) { + RC_FILE += ../../../app/scanner2/resourceTmp.rc + } else { + RC_FILE += ../../../app/scanner2/resource.rc + } MY_OS = windows contains(QT_ARCH, i386) { diff --git a/tools/hgsetver/Release/hgsetver.exe b/tools/hgsetver/Release/hgsetver.exe new file mode 100644 index 00000000..a1094a04 Binary files /dev/null and b/tools/hgsetver/Release/hgsetver.exe differ diff --git a/tools/hgsetver/hgsetver.cpp b/tools/hgsetver/hgsetver.cpp new file mode 100644 index 00000000..1fba3b34 --- /dev/null +++ b/tools/hgsetver/hgsetver.cpp @@ -0,0 +1,222 @@ +锘// hgsetver.cpp : 姝ゆ枃浠跺寘鍚 "main" 鍑芥暟銆傜▼搴忔墽琛屽皢鍦ㄦ澶勫紑濮嬪苟缁撴潫銆 +// + +#include +#include + +static bool isLeap(int year) +{ + if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) + return true; + return false; +} + +static int getDays(int year, int month) +{ + if (2 == month) + { + if (isLeap(year)) + return 29; + else + return 28; + } + + if (4 == month || 6 == month || 9 == month || 11 == month) + { + return 30; + } + + return 31; +} + +static int getPatchVersion() +{ + SYSTEMTIME st; + GetLocalTime(&st); + + int year = st.wYear; + int day = st.wDay; + int month = st.wMonth; + + int ret = year % 100; + ret *= 1000; + + for (int i = 1; i < month; ++i) + { + ret += getDays(year, i); + } + + ret += day; + return ret; +} + +int main(int argc, char* argv[]) +{ + std::string brandFile; + std::string resourceFile; + std::string oemName = "OEM_HUAGAO"; + std::string cpu = "x86"; + + for (int i = 1; i < argc; i++) + { + char* z = argv[i]; + + if (z == strstr(z, "-brandFile=")) + brandFile = z + strlen("-brandFile="); + else if (z == strstr(z, "-resourceFile=")) + resourceFile = z + strlen("-resourceFile="); + else if (z == strstr(z, "-oemName=")) + oemName = z + strlen("-oemName="); + else if (z == strstr(z, "-cpu=")) + cpu = z + strlen("-cpu="); + } + + printf("brandFile:%s\n", brandFile.c_str()); + printf("resourceFile:%s\n", resourceFile.c_str()); + printf("oemName:%s\n", oemName.c_str()); + printf("cpu:%s\n", cpu.c_str()); + + if (brandFile.empty() || resourceFile.empty()) + { + return -1; + } + + int mainVersion = 0; + int subVersion = 0; + int buildVersion = 0; + int patchVersion = 0; + + FILE* fp = fopen(brandFile.c_str(), "r"); + if (fp != NULL) + { + while (feof(fp) == 0) + { + char lineContent[2048] = { 0 }; + if (NULL == fgets(lineContent, 2048, fp)) + { + continue; + } + + if (0 == mainVersion) + { + char* p = strstr(lineContent, "VERSION_MAIN"); + if (NULL != p) + { + p += strlen("VERSION_MAIN"); + while (isspace(*p)) + ++p; + mainVersion = atoi(p); + } + } + + if (0 == subVersion) + { + char *p = strstr(lineContent, "VERSION_SUB"); + if (NULL != p) + { + p += strlen("VERSION_SUB"); + while (isspace(*p)) + ++p; + subVersion = atoi(p); + } + } + + if (0 != mainVersion && 0 != subVersion) + { + break; + } + } + + fclose(fp); + } + +if (oemName == "OEM_LISICHENG") + buildVersion = 14; +else if (oemName == "OEM_HANWANG") + buildVersion = 16; +else if (oemName == "OEM_CANGTIAN") + buildVersion = 18; +else if (oemName == "OEM_ZHONGJING") + buildVersion = 20; +else if (oemName == "OEM_ZIGUANG") + buildVersion = 22; +else if (oemName == "OEM_DELI") + buildVersion = 24; +else if (oemName == "OEM_NEUTRAL") + buildVersion = 26; +else + buildVersion = 10; + + buildVersion = buildVersion * 10; + +if (cpu == "x64") + buildVersion += 1; +else + buildVersion += 0; + + buildVersion *= 100; + + patchVersion = getPatchVersion(); + + char version1[32] = { 0 }; + sprintf(version1, "%d.%d.%d.%d", mainVersion, subVersion, buildVersion, patchVersion); + char version2[32] = { 0 }; + sprintf(version2, "%d,%d,%d,%d", mainVersion, subVersion, buildVersion, patchVersion); + + std::string resourceData; + fp = fopen(resourceFile.c_str(), "r"); + if (NULL != fp) + { + fseek(fp, 0, SEEK_END); + long size = ftell(fp); + + fseek(fp, 0, SEEK_SET); + char* buf = new char[size + 1]; + fread(buf, 1, size, fp); + buf[size] = 0; + resourceData = buf; + delete [] buf; + + fclose(fp); + } + + if (resourceData.empty()) + { + return 0; + } + + size_t offset = 0; + while (1) + { + size_t pos = resourceData.find("0,0,0,0", offset); + if (std::string::npos == pos) + { + break; + } + + resourceData.replace(pos, strlen("0,0,0,0"), version2); + offset = pos + strlen(version2); + } + + offset = 0; + while (1) + { + size_t pos = resourceData.find("0.0.0.0", offset); + if (std::string::npos == pos) + { + break; + } + + resourceData.replace(pos, strlen("0.0.0.0"), version1); + offset = pos + strlen(version1); + } + + fp = fopen(resourceFile.c_str(), "w"); + if (NULL != fp) + { + fwrite(&resourceData[0], 1, resourceData.size(), fp); + fclose(fp); + } + + return 0; +} diff --git a/tools/hgsetver/hgsetver.sln b/tools/hgsetver/hgsetver.sln new file mode 100644 index 00000000..338b5a55 --- /dev/null +++ b/tools/hgsetver/hgsetver.sln @@ -0,0 +1,31 @@ +锘 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32228.343 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hgsetver", "hgsetver.vcxproj", "{39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Debug|x64.ActiveCfg = Debug|x64 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Debug|x64.Build.0 = Debug|x64 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Debug|x86.ActiveCfg = Debug|Win32 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Debug|x86.Build.0 = Debug|Win32 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Release|x64.ActiveCfg = Release|x64 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Release|x64.Build.0 = Release|x64 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Release|x86.ActiveCfg = Release|Win32 + {39A8C4E8-FF2B-4FEA-8959-8AF962279CDD}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5DE3477A-31B2-4C22-A7C6-56DD0D6E014B} + EndGlobalSection +EndGlobal diff --git a/tools/hgsetver/hgsetver.vcxproj b/tools/hgsetver/hgsetver.vcxproj new file mode 100644 index 00000000..adf858b1 --- /dev/null +++ b/tools/hgsetver/hgsetver.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {39a8c4e8-ff2b-4fea-8959-8af962279cdd} + hgsetver + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + + + + + \ No newline at end of file