4.1030版本

This commit is contained in:
gb 2022-07-27 17:05:46 +08:00
parent 09ca49bfc1
commit 9a70b24d00
10 changed files with 203 additions and 102 deletions

126
build.bat
View File

@ -1,88 +1,128 @@
echo off
echo "build.bat [hw | lsc] [x86 | x64] [0x100 | 0x...] [onlytwain]"
echo "build.bat [hw | lsc] [x86 | x64] [0x100 | 0x...] [onlytwain] [nov]"
set OEM=hg
set CPU=x86
set PID=0x100
set COMPILE_RANGE=""
set NOT_INCREASE_VER=""
set VAL=%1
if "%1"=="onlytwain" (
if "%VAL%"=="onlytwain" (
set COMPILE_RANGE="-only-twain"
) else if "%1"=="hw" (
set OEM=%1
)else if "%1"=="lsc" (
set OEM=%1
) else if "%VAL%"=="hw" (
set OEM=%VAL%
)else if "%VAL%"=="lsc" (
set OEM=%VAL%
) else (
if "%1"=="x64" (
set CPU=%1
) else if "%1"=="x86" (
set CPU=%1
if "%VAL%"=="x64" (
set CPU=%VAL%
) else if "%VAL%"=="x86" (
set CPU=%VAL%
) else if "%VAL:~0,2%"=="0x" (
set PID=%VAL%
) else if "%VAL%"=="nov" (
set NOT_INCREASE_VER="-nov"
)
)
set VAL=%2
if "%2"=="onlytwain" (
if "%VAL%"=="onlytwain" (
set COMPILE_RANGE="-only-twain"
) else if "%2"=="hw" (
set OEM=%2
)else if "%2"=="lsc" (
set OEM=%2
) else if "%VAL%"=="hw" (
set OEM=%VAL%
)else if "%VAL%"=="lsc" (
set OEM=%VAL%
) else (
if "%2"=="x64" (
set CPU=%2
) else if "%2"=="x86" (
set CPU=%2
if "%VAL%"=="x64" (
set CPU=%VAL%
) else if "%VAL%"=="x86" (
set CPU=%VAL%
) else if "%VAL:~0,2%"=="0x" (
set PID=%VAL%
) else if "%VAL%"=="nov" (
set NOT_INCREASE_VER="-nov"
)
)
set VAL=%3
if "%3"=="onlytwain" (
if "%VAL%"=="onlytwain" (
set COMPILE_RANGE="-only-twain"
) else if "%3"=="hw" (
set OEM=%3
)else if "%3"=="lsc" (
set OEM=%3
) else if "%VAL%"=="hw" (
set OEM=%VAL%
)else if "%VAL%"=="lsc" (
set OEM=%VAL%
) else (
if "%3"=="x64" (
set CPU=%3
) else if "%3"=="x86" (
set CPU=%3
if "%VAL%"=="x64" (
set CPU=%VAL%
) else if "%VAL%"=="x86" (
set CPU=%VAL%
) else if "%VAL:~0,2%"=="0x" (
set PID=%VAL%
) else if "%VAL%"=="nov" (
set NOT_INCREASE_VER="-nov"
)
)
set VAL=%4
if "%4"=="onlytwain" (
if "%VAL%"=="onlytwain" (
set COMPILE_RANGE="-only-twain"
) else if "%4"=="hw" (
set OEM=%4
)else if "%4"=="lsc" (
set OEM=%4
) else if "%VAL%"=="hw" (
set OEM=%VAL%
)else if "%VAL%"=="lsc" (
set OEM=%VAL%
) else (
if "%4"=="x64" (
set CPU=%4
) else if "%4"=="x86" (
set CPU=%4
if "%VAL%"=="x64" (
set CPU=%VAL%
) else if "%VAL%"=="x86" (
set CPU=%VAL%
) else if "%VAL:~0,2%"=="0x" (
set PID=%VAL%
) else if "%VAL%"=="nov" (
set NOT_INCREASE_VER="-nov"
)
)
set VAL=%5
if "%VAL%"=="onlytwain" (
set COMPILE_RANGE="-only-twain"
) else if "%VAL%"=="hw" (
set OEM=%VAL%
)else if "%VAL%"=="lsc" (
set OEM=%VAL%
) else (
if "%VAL%"=="x64" (
set CPU=%VAL%
) else if "%VAL%"=="x86" (
set CPU=%VAL%
) else if "%VAL:~0,2%"=="0x" (
set PID=%VAL%
) else if "%VAL%"=="nov" (
set NOT_INCREASE_VER="-nov"
)
)
echo oem=%OEM%
echo cpu=%CPU%
echo pid=%PID%
set BUILD_CMD="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
"%~dp0\sln\release\hgsetver.exe" "%~dp0\twain\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE%
if %COMPILE_RANGE%=="" (
%BUILD_CMD% "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=x86
%BUILD_CMD% "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=x86
if "%COMPILE_RANGE%"=="" (
set dev=""
for /f "tokens=1,2,* " %%i in ('reg QUERY "HKEY_CLASSES_ROOT\CLSID\{2E1517DA-87BF-4443-984A-D2BF18F5A908}\LocalServer32" /ve') do set dev=%%k
echo dev=%dev%
if %dev%=="" (
echo "Can not find Visual-Studio installing path"
goto end
)
%BUILD_CMD% "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=x86
call %dev%\..\..\..\vc\auxiliary\build\vcvars32.bat
)
"%~dp0\sln\release\hgsetver.exe" "%~dp0\twain\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE% %NOT_INCREASE_VER%
if %COMPILE_RANGE%=="" (
MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=x86
MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=x86
)
MSBuild.exe "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=x86

View File

@ -1,29 +1,39 @@
echo off
if "%1"=="hw" (
build.bat hw x86 0x1000
build.bat hw onlytwain 0x1002
build.bat hw onlytwain 0x7000
build.bat hw onlytwain 0x7002
build.bat hw onlytwain 0x7039
build.bat hw onlytwain 0x8000
build.bat hw onlytwain 0x9000
) else if "%1" == "lsc" (
build.bat lsc x86 0x8200
build.bat lsc onlytwain 0x8420
build.bat lsc onlytwain 0x8429
build.bat lsc onlytwain 0x8520
build.bat lsc onlytwain 0x8529
build.bat lsc onlytwain 0x8620
build.bat lsc onlytwain 0x8629
build.bat lsc onlytwain 0x8730
build.bat lsc onlytwain 0x8739
set OEM=""
set NOV=""
if "%1"=="nov" (
set NOV=%1
set OEM=%2
) else (
build.bat x86 0x100
build.bat onlytwain 0x200
build.bat onlytwain 0x300
build.bat onlytwain 0x400
build.bat onlytwain 0x139
build.bat onlytwain 0x239
build.bat onlytwain 0x439
build.bat onlytwain 0x402
set OEM=%1
set NOV=%2
)
if "%OEM%"=="hw" (
build.bat hw x86 0x1000 %NOV%
build.bat hw onlytwain 0x1002 %NOV%
build.bat hw onlytwain 0x7000 %NOV%
build.bat hw onlytwain 0x7002 %NOV%
build.bat hw onlytwain 0x7039 %NOV%
build.bat hw onlytwain 0x8000 %NOV%
build.bat hw onlytwain 0x9000 %NOV%
) else if "%OEM%" == "lsc" (
build.bat lsc x86 0x8200 %NOV%
build.bat lsc onlytwain 0x8420 %NOV%
build.bat lsc onlytwain 0x8429 %NOV%
build.bat lsc onlytwain 0x8520 %NOV%
build.bat lsc onlytwain 0x8529 %NOV%
build.bat lsc onlytwain 0x8620 %NOV%
build.bat lsc onlytwain 0x8629 %NOV%
build.bat lsc onlytwain 0x8730 %NOV%
build.bat lsc onlytwain 0x8739 %NOV%
) else (
build.bat x86 0x100 %NOV%
build.bat onlytwain 0x200 %NOV%
build.bat onlytwain 0x300 %NOV%
build.bat onlytwain 0x400 %NOV%
build.bat onlytwain 0x139 %NOV%
build.bat onlytwain 0x239 %NOV%
build.bat onlytwain 0x439 %NOV%
build.bat onlytwain 0x402 %NOV%
)

View File

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,1026,2022,7261
PRODUCTVERSION 4,1026,2022,7261
FILEVERSION 4,1030,2022,7271
PRODUCTVERSION 4,1030,2022,7271
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "宁波华高信息科技有限公司"
VALUE "FileDescription", "华高扫描仪应用程序"
VALUE "FileVersion", "4.1026.2022.7261"
VALUE "FileVersion", "4.1030.2022.7271"
VALUE "InternalName", "scanner.dll"
VALUE "LegalCopyright", "Copyright (C) 2022"
VALUE "OriginalFilename", "scanner.dll"
VALUE "ProductName", "HUAGOScan"
VALUE "ProductVersion", "4.1026.2022.7261"
VALUE "ProductVersion", "4.1030.2022.7271"
END
END
BLOCK "VarFileInfo"

View File

@ -75,25 +75,25 @@
<IncludePath>$(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath)</LibraryPath>
@ -120,6 +120,7 @@
</Link>
<PostBuildEvent>
<Command>mkdir $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)
copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).exp" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).lib" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"

View File

@ -248,8 +248,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,1026,2022,7261
PRODUCTVERSION 4,1026,2022,7261
FILEVERSION 4,1030,2022,7271
PRODUCTVERSION 4,1030,2022,7271
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -266,12 +266,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "宁波华高信息科技有限公司"
VALUE "FileDescription", "华高扫描仪应用程序"
VALUE "FileVersion", "4.1026.2022.7261"
VALUE "FileVersion", "4.1030.2022.7271"
VALUE "InternalName", "sane.dll"
VALUE "LegalCopyright", "Copyright (C) 2022"
VALUE "OriginalFilename", "sane.dll"
VALUE "ProductName", "HUAGOScan"
VALUE "ProductVersion", "4.1026.2022.7261"
VALUE "ProductVersion", "4.1030.2022.7271"
END
END
BLOCK "VarFileInfo"

View File

@ -76,25 +76,25 @@
<IncludePath>$(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath)</LibraryPath>
@ -116,6 +116,7 @@
</Link>
<PostBuildEvent>
<Command>mkdir $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)
copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).exp" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).lib" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"
move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)"

Binary file not shown.

View File

@ -21,7 +21,7 @@ enum oem
#define GET_ENUM_VALUE_W(e, v) \
if(L###e == v) return e;
static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main = 0, bool twain_only = false);
static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main = 0, bool twain_only = false, bool nov = false);
int main()
{
@ -37,7 +37,7 @@ int main()
if (pos != std::wstring::npos)
pe.erase(pos);
std::wcout << L"Usage: " << pe.c_str() << L"<path-file> [-pid product_id lead with '0x'] [-main main-ver, all version will be omitted if this was not given or be ZERO] [-cpu x86|x64] [-oem hw|lsc] [-only-twain change twain project only]\r\n";
std::wcout << L"Usage: " << pe.c_str() << L"<path-file> [-pid product_id lead with '0x'] [-main main-ver, all version will be omitted if this was not given or be ZERO] [-cpu x86|x64] [-oem hw|lsc] [-only-twain change twain project only] [-nov not change version]\r\n";
cmd->release();
DWORD pid = process_util::get_parent_process(GetCurrentProcessId());
@ -52,9 +52,21 @@ int main()
return -1;
}
{
wchar_t* buf = NULL;
int len = 0;
cmd->to_command_line(buf, &len);
buf = new wchar_t[len + 4];
cmd->to_command_line(buf, &len);
buf[len] = 0;
std::wcout << buf << std::endl;
delete[] buf;
}
oem vendor = OEM_NONE;
bool x86 = true, twain_only = cmd->has(L"-only-twain");
bool x86 = true, twain_only = cmd->has(L"-only-twain"), nov = cmd->has(L"-nov");
int main = 0, pid = 0x100;
if (cmd->parameter(L"-main"))
@ -85,7 +97,7 @@ int main()
std::wstring file(cmd->parameter(1));
STR_TO_ABSOLUTE_PATH(file);
set_ver(file.c_str(), vendor, x86, pid, main, twain_only);
set_ver(file.c_str(), vendor, x86, pid, main, twain_only, nov);
cmd->release();
return 0;
@ -312,7 +324,10 @@ namespace rc
{
oem o;
int product_id;
bool change_out_dir;
}CHGPARAM, *LPCHGPARAM;
bool __stdcall change_out_dir(std::wstring& cont, oem o);
static std::wstring load_file(const wchar_t* file, bom* bm)
{
std::string cont("");
@ -778,6 +793,8 @@ namespace rc
pos = cont.find(L"OEM_", end);
}
change_out_dir(cont, o);
std::string bomstr("");
if (bm == BOM_UNICODE)
coding_util::bom::from_unicode(cont.c_str(), cont.length() * 2, got_str, &bomstr);
@ -867,6 +884,34 @@ namespace rc
return true;
}
bool __stdcall change_out_dir(std::wstring& cont, oem o)
{
bool ok = false;
std::wstring first = L"<OutDir>", last(first), target(L"$(SolutionDir)..\\..\\release\\win\\$(PlatformTarget)\\OEM\\");
int bgn = 0, end = 0;
last.insert(1, L"/");
if (o == OEM_HANWANG)
target += L"hanvon\\";
else if (o == OEM_LISICHENG)
target += L"lanxum\\";
else
target += L"huagao\\";
while ((bgn = cont.find(first, bgn)) != std::wstring::npos)
{
bgn += first.length();
end = cont.find(last, bgn);
if (end != std::wstring::npos)
{
ok = true;
cont.replace(bgn, end - bgn, target);
bgn += target.length() + last.length();
}
}
return ok;
}
bool __stdcall change_output(std::wstring& cont, LPCHGPARAM param)
{
std::wstring target(L"huagao"), first(L"<TargetName>"), last(L"</TargetName>");
@ -893,11 +938,14 @@ namespace rc
}
}
if (ok && param->change_out_dir)
ok = change_out_dir(cont, param->o);
return ok;
}
};
static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main, bool twain_only)
static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main, bool twain_only, bool nov)
{
bool ret = false;
bom bm = BOM_UTF8;
@ -925,17 +973,17 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main
while (change_oem(unic, vendor))
{
if (!twain_only)
if (!nov)
{
if (main && !change_main(unic, main))
break;
if (!change_sub(unic, sub, main))
break;
if (!change_build(unic, build))
break;
if (!change_patch(unic, patch))
break;
}
if (!change_build(unic, build))
break;
if (!change_patch(unic, patch))
break;
if (!change_product_id(unic, pid))
break;
@ -1001,6 +1049,7 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main
rcf = base + L"\\..\\twain\\twain.vcxproj";
STR_SIMPLIFY_PATH(rcf);
param.change_out_dir = !twain_only;
if (!rc::change_file(rcf.c_str(), &param, rc::change_output))
{
std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl;

View File

@ -6,15 +6,15 @@
#define OEM_NONE
#define VERSION_MAIN 4
#define VERSION_SUB 1026
#define VERSION_SUB 1030
#define VERSION_BUILD 2022
#define VERSION_PATCH 7261
#define VERSION_PATCH 7271
#define TO_STR(a) #a
#define TO_VER_STR(vs) TO_STR(v##vs)
#define VERSION_STR(a, b, c, d) TO_VER_STR(a.b.c.d)
#define PRODUCT_ID 402
#define PRODUCT_ID 239
#define MAKE_PID(pid) 0x##pid
#define PASTE_DEF(a, b) a##b
#define FINAL_STR(a, b, c) TO_STR(a##b##c)

View File

@ -46,18 +46,18 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\sdk\include\;$(IncludePath)</IncludePath>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<LibraryPath>$(LibraryPath)</LibraryPath>
<TargetName>huagaotwain402.ds</TargetName>
<TargetName>huagaotwain239.ds</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\sdk\include\;$(IncludePath)</IncludePath>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\</OutDir>
<IntDir>$(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
<LibraryPath>$(LibraryPath)</LibraryPath>
<TargetName>huagaotwain402.ds</TargetName>
<TargetName>huagaotwain239.ds</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>