加载HGversion动态库前替换进程目录,调整编译路径
This commit is contained in:
parent
16e3737f11
commit
4265f65353
|
@ -1,6 +1,7 @@
|
|||
#include "VersionDll.h"
|
||||
#include "base/HGDef.h"
|
||||
#include "base/HGInc.h"
|
||||
#include "base/HGUtility.h"
|
||||
|
||||
VersionDll::VersionDll()
|
||||
{
|
||||
|
@ -41,6 +42,16 @@ HGResult VersionDll::Load()
|
|||
{
|
||||
return HGBASE_ERR_FAIL;
|
||||
}
|
||||
|
||||
HGChar oldDir[256];
|
||||
HGBase_GetCurrentDir(oldDir, 256);
|
||||
HGChar moduleName[256];
|
||||
HGBase_GetModuleName(nullptr, moduleName, 256);
|
||||
HGChar newDir[256];
|
||||
HGBase_GetFilePath(moduleName, newDir, 256);
|
||||
|
||||
HGBase_SetCurrentDir(newDir);
|
||||
|
||||
#if defined(HG_CMP_MSC)
|
||||
#if defined(OEM_HANWANG)
|
||||
HGBase_CreateDll("HwVersion.dll", &m_dll);
|
||||
|
@ -59,6 +70,7 @@ HGResult VersionDll::Load()
|
|||
#endif
|
||||
#endif
|
||||
|
||||
HGBase_SetCurrentDir(oldDir);
|
||||
|
||||
if (NULL == m_dll)
|
||||
{
|
||||
|
|
19
build.bat
19
build.bat
|
@ -1,14 +1,13 @@
|
|||
set BUILD_CMD="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
|
||||
|
||||
set OEM=%1
|
||||
|
||||
if "%OEM%" == "hw" (
|
||||
%BUILD_CMD% ./build/windows/HGSolution.sln /m:6 /p:Configuration=HWRelease /p:Platform=x86
|
||||
MSBuild.exe ./build/windows/HGSolution.sln /m:6 /p:Configuration=HWRelease /p:Platform=x86
|
||||
) else (
|
||||
if "%OEM%" == "lsc" (
|
||||
%BUILD_CMD% ./build/windows/HGSolution.sln /m:6 /p:Configuration=LSCRelease /p:Platform=x86
|
||||
MSBuild.exe ./build/windows/HGSolution.sln /m:6 /p:Configuration=LSCRelease /p:Platform=x86
|
||||
) else (
|
||||
%BUILD_CMD% ./build/windows/HGSolution.sln /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe ./build/windows/HGSolution.sln /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -23,7 +22,7 @@ if "%OEM%" == "hw" (
|
|||
sed -i "s/HGImgProc/HWImgProc/g" HGScannerTmp.pro
|
||||
sed -i "s/logo.ico/Hanvon_logo1.ico/g" HGScannerTmp.pro
|
||||
qmake -r -tp vc HGScannerTmp.pro
|
||||
%BUILD_CMD% HanvonScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe HanvonScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
) else (
|
||||
if "%OEM%" == "lsc" (
|
||||
sed -i "s/OEM_HUAGAO/OEM_LISICHENG/g" HGScannerTmp.pro
|
||||
|
@ -34,10 +33,10 @@ if "%OEM%" == "hw" (
|
|||
sed -i "s/HGImgProc/LSCImgProc/g" HGScannerTmp.pro
|
||||
sed -i "s/logo.ico/Lanxum_logo.ico/g" HGScannerTmp.pro
|
||||
qmake -r -tp vc HGScannerTmp.pro
|
||||
%BUILD_CMD% LanxumScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe LanxumScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
) else (
|
||||
qmake -r -tp vc HGScannerTmp.pro
|
||||
%BUILD_CMD% HuaGoScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe HuaGoScan.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
)
|
||||
)
|
||||
del /f /s /q *.h
|
||||
|
@ -61,7 +60,7 @@ if "%OEM%" == "hw" (
|
|||
sed -i "s/HGVersion/HWVersion/g" HGUpgradeTmp.pro
|
||||
sed -i "s/logo.ico/Hanvon_logo1.ico/g" HGUpgradeTmp.pro
|
||||
qmake -r -tp vc HGUpgradeTmp.pro
|
||||
%BUILD_CMD% HWUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe HWUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
) else (
|
||||
if "%OEM%" == "lsc" (
|
||||
sed -i "s/OEM_HUAGAO/OEM_LISICHENG/g" HGUpgradeTmp.pro
|
||||
|
@ -70,10 +69,10 @@ if "%OEM%" == "hw" (
|
|||
sed -i "s/HGVersion/LSCVersion/g" HGUpgradeTmp.pro
|
||||
sed -i "s/logo.ico/Lanxum_logo.ico/g" HGUpgradeTmp.pro
|
||||
qmake -r -tp vc HGUpgradeTmp.pro
|
||||
%BUILD_CMD% LSCUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe LSCUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
) else (
|
||||
qmake -r -tp vc HGUpgradeTmp.pro
|
||||
%BUILD_CMD% HGUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
MSBuild.exe HGUpgradeApp.vcxproj /m:6 /p:Configuration=Release /p:Platform=x86
|
||||
)
|
||||
)
|
||||
del /f /s /q *.h
|
||||
|
|
Loading…
Reference in New Issue