更换sane/scanner/lang三个模块名称,避免与第三方APP模块名称冲突

This commit is contained in:
gb 2023-10-20 11:06:30 +08:00
parent 4b01b1adc9
commit d0174b82a4
20 changed files with 89 additions and 60 deletions

View File

@ -100,18 +100,18 @@ rem ----------------------------------------------------------------------------
mkdir %LIB_PATH%
mkdir %COMMON_LIB_PATH%
MSBuild.exe "%~dp0\lang\lang.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\lang\ /p:OutDir=%BIN_PATH%\
MSBuild.exe "%~dp0\lang\yuyanbao.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\lang\ /p:OutDir=%BIN_PATH%\
if %ERRORLEVEL% neq 0 goto end
call :move_libs %BIN_PATH% lang %LIB_PATH%
copy /y %LIB_PATH%\lang.lib %COMMON_LIB_PATH%
MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\scanner\ /p:OutDir=%BIN_PATH%\
call :move_libs %BIN_PATH% yuyanbao %LIB_PATH%
copy /y %LIB_PATH%\yuyanbao.lib %COMMON_LIB_PATH%
MSBuild.exe "%~dp0\device\scannerqd.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\scanner\ /p:OutDir=%BIN_PATH%\
if %ERRORLEVEL% neq 0 goto end
call :move_libs %BIN_PATH% scanner %LIB_PATH%
copy /y %LIB_PATH%\scanner.lib %COMMON_LIB_PATH%
MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\sane\ /p:OutDir=%BIN_PATH%\
call :move_libs %BIN_PATH% scannerqd %LIB_PATH%
copy /y %LIB_PATH%\scannerqd.lib %COMMON_LIB_PATH%
MSBuild.exe "%~dp0\sane\sanexy.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\sane\ /p:OutDir=%BIN_PATH%\
if %ERRORLEVEL% neq 0 goto end
call :move_libs %BIN_PATH% sane %LIB_PATH%
copy /y %LIB_PATH%\sane.lib %COMMON_LIB_PATH%
call :move_libs %BIN_PATH% sanexy %LIB_PATH%
copy /y %LIB_PATH%\sanexy.lib %COMMON_LIB_PATH%
goto end
REM move_libs src_dir src_name dst_dir

View File

@ -1,4 +1,4 @@
LIBRARY scanner
LIBRARY scannerqd
EXPORTS
hg_scanner_initialize
hg_scanner_uninitialize

View File

@ -1,8 +1,9 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by scanner.rc
// Microsoft Visual C++ 生成的包含文件。
// 供 scannerqd.rc 使用
//
// 新对象的下一组默认值
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>C:\Program Files\HuaGoScan\HuaGoScan.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -70,9 +70,9 @@ BEGIN
VALUE "CompanyName", "宁波华高信息科技有限公司"
VALUE "FileDescription", "华高扫描仪应用程序"
VALUE "FileVersion", "4.40.17100.23069"
VALUE "InternalName", "scanner.dll"
VALUE "InternalName", "scannerqd.dll"
VALUE "LegalCopyright", "Copyright (C) HUAGOScan 2023"
VALUE "OriginalFilename", "scanner.dll"
VALUE "OriginalFilename", "scannerqd.dll"
VALUE "ProductName", "HUAGOScan"
VALUE "ProductVersion", "4.40.17100.23069"
END

View File

@ -22,7 +22,7 @@
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{9ed4b425-73e0-423e-9712-455e777481b4}</ProjectGuid>
<RootNamespace>scanner</RootNamespace>
<RootNamespace>scannerqd</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -118,7 +118,8 @@
</IgnoreAllDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\ /Y </Command>
<Command>copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\ /Y
$(SolutionDir)movlib.bat $(TargetName) $(PlatformTarget) huagao</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -347,7 +348,7 @@
<Text Include="..\..\code_device\hgdriver\wrapper\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="scanner.rc" />
<ResourceCompile Include="scannerqd.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -453,7 +453,7 @@
<Text Include="..\..\code_device\hgdriver\wrapper\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="scanner.rc">
<ResourceCompile Include="scannerqd.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>

View File

@ -1,4 +1,4 @@
LIBRARY lang
LIBRARY yuyanbao
EXPORTS
lang_initialize
lang_get_supported_languages

View File

@ -22,14 +22,14 @@
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{7776ab6d-6296-4f7a-a6ed-e9a4d6290dd9}</ProjectGuid>
<RootNamespace>lang</RootNamespace>
<RootNamespace>yuyanbao</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@ -42,7 +42,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
@ -103,11 +103,11 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>lang.def</ModuleDefinitionFile>
<ModuleDefinitionFile>yuyanbao.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
</Command>
<Command>copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\ /Y
$(SolutionDir)movlib.bat $(TargetName) $(PlatformTarget) huagao</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -128,7 +128,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>lang.def</ModuleDefinitionFile>
<ModuleDefinitionFile>yuyanbao.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
@ -148,7 +148,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>lang.def</ModuleDefinitionFile>
<ModuleDefinitionFile>yuyanbao.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
@ -173,7 +173,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>lang.def</ModuleDefinitionFile>
<ModuleDefinitionFile>yuyanbao.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
@ -202,7 +202,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="lang.def" />
<None Include="yuyanbao.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -43,7 +43,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="lang.def">
<None Include="yuyanbao.def">
<Filter>源文件</Filter>
</None>
</ItemGroup>

View File

@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ 生成的包含文件。
// 供 sane.rc 使用
// 供 sanexy.rc 使用
//
#define IDCANCEL2 3
#define IDD_INDICATOR 101

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -367,9 +367,9 @@ BEGIN
VALUE "CompanyName", "上海中晶科技有限公司"
VALUE "FileDescription", "中晶扫描仪应用程序"
VALUE "FileVersion", "4.37.20000.23034"
VALUE "InternalName", "sane.dll"
VALUE "InternalName", "sanexy.dll"
VALUE "LegalCopyright", "Copyright (C) MICROTEKScan 2023"
VALUE "OriginalFilename", "sane.dll"
VALUE "OriginalFilename", "sanexy.dll"
VALUE "ProductName", "MICROTEKScan"
VALUE "ProductVersion", "4.37.20000.23034"
END

View File

@ -22,9 +22,9 @@
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6eec8a02-7f98-4422-8ed6-2434d43bd1e1}</ProjectGuid>
<RootNamespace>sane</RootNamespace>
<RootNamespace>sanexy</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>sane</ProjectName>
<ProjectName>sanexy</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -113,12 +113,13 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>$(ProjectDir)sane.def</ModuleDefinitionFile>
<ModuleDefinitionFile>$(ProjectDir)sanexy.def</ModuleDefinitionFile>
<AdditionalManifestDependencies>
</AdditionalManifestDependencies>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\$(TargetName) /y</Command>
<Command>copy "$(TargetPath)" C:\Windows\twain_32\HuagoTwain\ /Y
$(SolutionDir)movlib.bat $(TargetName) $(PlatformTarget) huagao</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -139,7 +140,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>$(ProjectDir)sane.def</ModuleDefinitionFile>
<ModuleDefinitionFile>$(ProjectDir)sanexy.def</ModuleDefinitionFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
@ -160,7 +161,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>scanner.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>$(ProjectDir)sane.def</ModuleDefinitionFile>
<ModuleDefinitionFile>$(ProjectDir)sanexy.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
@ -184,7 +185,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>scanner.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>$(ProjectDir)sane.def</ModuleDefinitionFile>
<ModuleDefinitionFile>$(ProjectDir)sanexy.def</ModuleDefinitionFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
@ -243,13 +244,13 @@
<ClInclude Include="scanner.h" />
</ItemGroup>
<ItemGroup>
<None Include="sane.def" />
<None Include="sanexy.def" />
</ItemGroup>
<ItemGroup>
<Text Include="..\..\code_device\hgsane\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="sane.rc" />
<ResourceCompile Include="sanexy.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -163,7 +163,7 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="sane.def">
<None Include="sanexy.def">
<Filter>源文件</Filter>
</None>
</ItemGroup>
@ -171,7 +171,7 @@
<Text Include="..\..\code_device\hgsane\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="sane.rc">
<ResourceCompile Include="sanexy.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>

View File

@ -3,17 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33214.272
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sane", "..\sane\sane.vcxproj", "{6EEC8A02-7F98-4422-8ED6-2434D43BD1E1}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sanexy", "..\sane\sanexy.vcxproj", "{6EEC8A02-7F98-4422-8ED6-2434D43BD1E1}"
ProjectSection(ProjectDependencies) = postProject
{9ED4B425-73E0-423E-9712-455E777481B4} = {9ED4B425-73E0-423E-9712-455E777481B4}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scanner", "..\device\scanner.vcxproj", "{9ED4B425-73E0-423E-9712-455E777481B4}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scannerqd", "..\device\scannerqd.vcxproj", "{9ED4B425-73E0-423E-9712-455E777481B4}"
ProjectSection(ProjectDependencies) = postProject
{7776AB6D-6296-4F7A-A6ED-E9A4D6290DD9} = {7776AB6D-6296-4F7A-A6ED-E9A4D6290DD9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "twain", "..\twain\twain.vcxproj", "{C3B47CE2-27CE-4509-AB59-3C0F194F0FCE}"
ProjectSection(ProjectDependencies) = postProject
{6EEC8A02-7F98-4422-8ED6-2434D43BD1E1} = {6EEC8A02-7F98-4422-8ED6-2434D43BD1E1}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "setup", "setup", "{F6774650-403F-476C-8373-2EA8D4AF06FF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hgsetver", "hgsetver\hgsetver.vcxproj", "{A7528596-FBA2-4FFF-8649-C8D0EEBC6554}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lang", "..\lang\lang.vcxproj", "{7776AB6D-6296-4F7A-A6ED-E9A4D6290DD9}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yuyanbao", "..\lang\yuyanbao.vcxproj", "{7776AB6D-6296-4F7A-A6ED-E9A4D6290DD9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

12
sln/movlib.bat Normal file
View File

@ -0,0 +1,12 @@
# movlib proj-name cpu oem
set NAME=%1
set CPU=%2
set OEM=%3
set SRCDIR=%~dp0\..\..\release\win\%CPU%\OEM\%OEM%\
set DSTDIR=%~dp0\..\..\sdk\lib\win\%CPU%\OEM\%OEM%\
mkdir "%DSTDIR%"
move /y "%SRCDIR%\%NAME%.exp" "%DSTDIR%"
move /y "%SRCDIR%\%NAME%.lib" "%DSTDIR%"
move /y "%SRCDIR%\%NAME%.pdb" "%DSTDIR%"

View File

@ -147,7 +147,7 @@ namespace load_sane_util
sane_path = reg_get_app_installing_path(&reg_path);
if (!sane_path.empty())
{
sane_path += L"\\sane.dll";
sane_path += /*L"\\sane.dll";*/ L"\\" + m2u(MODULE_NAME_SANE, CP_UTF8);
load_dll(sane_path.c_str(), &sane_module);
if (sane_module)
{

View File

@ -601,6 +601,20 @@ static void copy_type(std::string& to, Str64 from)
{
to = load_sane_util::ansi2utf8(from.data());
}
static std::wstring scanner_status_desc(int ss)
{
#define RETURN_IF_MATCH(v) \
if(ss == v) \
return L###v;
RETURN_IF_MATCH(SCANNER_STATUS_NOT_INIT);
RETURN_IF_MATCH(SCANNER_STATUS_READY);
RETURN_IF_MATCH(SCANNER_STATUS_SCAN_1);
RETURN_IF_MATCH(SCANNER_STATUS_SCANNING);
RETURN_IF_MATCH(SCANNER_STATUS_STOPPED);
return std::move(L"unknown statu " + std::to_wstring(ss));
}
template<typename T>
bool list_value_at(std::list<T>& lst, int ind, T& t)
@ -1060,6 +1074,8 @@ Result huagao_ds::identityOpenDs(const Identity& id)
}
Result huagao_ds::identityCloseDs(const Identity&)
{
load_sane_util::to_log(1, L"identityCloseDs, scanner status is '%s'\r\n", scanner_status_desc(scanner_status_).c_str());
if (notify_close_thread_.get() && notify_close_thread_->joinable())
notify_close_thread_->join();