Skip to content

Commit

Permalink
增加 x64 和 x86 目标平台
Browse files Browse the repository at this point in the history
  • Loading branch information
Myitian committed Aug 27, 2023
1 parent f64a0bb commit 017c67a
Show file tree
Hide file tree
Showing 17 changed files with 1,635 additions and 523 deletions.
240 changes: 120 additions & 120 deletions QPDFErrorWrapper/QPDFErrorWrapper.vcxproj
Original file line number Diff line number Diff line change
@@ -1,121 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e0bb57fa-9ea3-4d36-84dc-f2d33906fcb4}</ProjectGuid>
<RootNamespace>QPDFErrorWrapper</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup>
<TargetName>wrapper</TargetName>
<OutDir>bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<Link>
<AdditionalDependencies>qpdf_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalDependencies>qpdf_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)\SharpPDFDecrypter\Resources\Wrapper_32.dll</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)\SharpPDFDecrypter\Resources\Wrapper_64.dll</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<Library Include="qpdf_32.lib" />
<Library Include="qpdf_64.lib" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="wrapper.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Constants.h" />
<ClInclude Include="DLL.h" />
<ClInclude Include="QPDFExc.hh" />
<ClInclude Include="Types.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e0bb57fa-9ea3-4d36-84dc-f2d33906fcb4}</ProjectGuid>
<RootNamespace>QPDFErrorWrapper</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup>
<TargetName>wrapper</TargetName>
<OutDir>bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<Link>
<AdditionalDependencies>qpdf_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalDependencies>qpdf_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)\SharpPDFDecrypter\Resources\Wrapper_32.dll</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)\SharpPDFDecrypter\Resources\Wrapper_64.dll</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<Library Include="qpdf_32.lib" />
<Library Include="qpdf_64.lib" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="wrapper.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Constants.h" />
<ClInclude Include="DLL.h" />
<ClInclude Include="QPDFExc.hh" />
<ClInclude Include="Types.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
94 changes: 49 additions & 45 deletions SharpPDFDecrypter.sln
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33801.468
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpPDFDecrypter", "SharpPDFDecrypter\SharpPDFDecrypter.csproj", "{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QPDFErrorWrapper", "QPDFErrorWrapper\QPDFErrorWrapper.vcxproj", "{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x64.ActiveCfg = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x64.Build.0 = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x86.ActiveCfg = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x86.Build.0 = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|Any CPU.Build.0 = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x64.ActiveCfg = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x64.Build.0 = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x86.ActiveCfg = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x86.Build.0 = Release|Any CPU
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|Any CPU.ActiveCfg = Debug|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x64.ActiveCfg = Debug|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x86.ActiveCfg = Debug|Win32
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|Any CPU.ActiveCfg = Release|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x64.ActiveCfg = Release|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x86.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {373691DD-1055-406F-A428-B7814C90EA35}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33801.468
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpPDFDecrypter", "SharpPDFDecrypter\SharpPDFDecrypter.csproj", "{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QPDFErrorWrapper", "QPDFErrorWrapper\QPDFErrorWrapper.vcxproj", "{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x64.ActiveCfg = Debug|x64
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x64.Build.0 = Debug|x64
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x86.ActiveCfg = Debug|x86
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Debug|x86.Build.0 = Debug|x86
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|Any CPU.Build.0 = Release|Any CPU
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x64.ActiveCfg = Release|x64
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x64.Build.0 = Release|x64
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x86.ActiveCfg = Release|x86
{E6543F0A-D4C8-4B1E-AD33-C717C6A70E02}.Release|x86.Build.0 = Release|x86
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|Any CPU.ActiveCfg = Debug|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x64.ActiveCfg = Debug|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x64.Build.0 = Debug|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x86.ActiveCfg = Debug|Win32
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Debug|x86.Build.0 = Debug|Win32
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|Any CPU.ActiveCfg = Release|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x64.ActiveCfg = Release|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x64.Build.0 = Release|x64
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x86.ActiveCfg = Release|Win32
{E0BB57FA-9EA3-4D36-84DC-F2D33906FCB4}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {373691DD-1055-406F-A428-B7814C90EA35}
EndGlobalSection
EndGlobal
12 changes: 10 additions & 2 deletions SharpPDFDecrypter/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace SharpPDFDecrypter
public partial class App : Application
{
public static readonly string AuthorPageAddress = "https://github.com/Myitian";
public static readonly string ProjectAddress = SharpPDFDecrypter.Properties.Resources.ProjectAddress;
public static readonly string License = SharpPDFDecrypter.Properties.Resources.LicenseIdentifier;
public static readonly string ProjectAddress = SharpPDFDecrypter.Properties.ResourcesText.ProjectAddress;
public static readonly string License = SharpPDFDecrypter.Properties.ResourcesText.LicenseIdentifier;

protected override void OnStartup(StartupEventArgs e)
{
Expand All @@ -41,6 +41,13 @@ protected override void OnStartup(StartupEventArgs e)
{
const string qpdfDll = "qpdf.dll";
const string wrapperDll = "wrapper.dll";
#if x64
File.WriteAllBytes(qpdfDll, SharpPDFDecrypter.Properties.Resources64.QPDF_64);
File.WriteAllBytes(wrapperDll, SharpPDFDecrypter.Properties.Resources64.Wrapper_64);
#elif x86
File.WriteAllBytes(qpdfDll, SharpPDFDecrypter.Properties.Resources32.QPDF_32);
File.WriteAllBytes(wrapperDll, SharpPDFDecrypter.Properties.Resources32.Wrapper_32);
#else
if (Environment.Is64BitProcess)
{
File.WriteAllBytes(qpdfDll, SharpPDFDecrypter.Properties.Resources.QPDF_64);
Expand All @@ -51,6 +58,7 @@ protected override void OnStartup(StartupEventArgs e)
File.WriteAllBytes(qpdfDll, SharpPDFDecrypter.Properties.Resources.QPDF_32);
File.WriteAllBytes(wrapperDll, SharpPDFDecrypter.Properties.Resources.Wrapper_32);
}
#endif
File.Open(qpdfDll, FileMode.Open, FileAccess.Read, FileShare.Read).Close();
File.Open(wrapperDll, FileMode.Open, FileAccess.Read, FileShare.Read).Close();
}
Expand Down
Loading

0 comments on commit 017c67a

Please sign in to comment.