Skip to main content
Known Participant
November 24, 2016
Question

Creating a Release Build

  • November 24, 2016
  • 8 replies
  • 4780 views

Help! I have used the Basic example in the SDK as a basis to create my plug-in, it works fine on my machine so I built it to put on another machine, and discovered because it was in debug mode, it was using the debug version of the C++ libraries which aren't distributable, however when I change it to a release build then it just doesn't appear as an add-in (It is signed and reader enabled).

I don't know what I am missing \ what I should be doing in get this to work, it has been ages since I have done anything in C++ so the many many options in the project properties are lost in time.  I have spent nearly 4 days this and not made any progress.  Can you help? Or at least point me some areas to check? People to ask.

Thanks in advance.

Danny Banks

This topic has been closed for replies.

8 replies

Legend
December 20, 2016

Going off at a tangent...how about testing whether the plugin can load on the test machine, excluding Acrobat. Write a tiny standalone EXE to use LoadLibrary, then GetProcAddress On the .API and the exported function. If this fails you have something simpler to debug. Be sure to have NO OTHER FILES in the same folder as the API file to avoid confusing the module resolution.

Legend
December 6, 2016

I have no idea what that is, sorry. How about the test I suggested - what result?

Known Participant
December 6, 2016

You and me both...

The original test as I said

"Tested with all your conditions and nope, nothing.

So frustrated.

D"

Sorry not compiled another test program yet... will do later and let you know.

D

Known Participant
December 20, 2016

Right sorry other programs took my focus for a bit, I have compiled both the sample programs Basic and Show Permissions in Release Mode and they work fine in Adobe Acrobat, but my Project Release build still doesn't.

Though incidentally neither seem to be using MSVCP120.DLL or MSVCR120.DLL which is where this problem started from.

Any more ideas?

Legend
December 6, 2016

How about.... making the release build of a DIFFERENT sample project from the SDK. Does it work?

Known Participant
December 6, 2016

am genuinely just doing that.

Read somewhere to add the following information to the project file....

Don't really know what a lot of it means so don't know the impact it'll have so have not added it, would this fix my problem does anyone think.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" 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>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{B88D574E-35D4-4A27-8AF0-E2AD6BB9665B}</ProjectGuid>
    <ProjectName>LawmanAcrobatPlugin</ProjectName>
    <SccProjectName>SAK</SccProjectName>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseOfMfc>false</UseOfMfc>
    <PlatformToolset>v120_xp</PlatformToolset>
    <CLRSupport>false</CLRSupport>
  </PropertyGroup>
  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <PlatformToolset>v120_xp</PlatformToolset>
    <ConfigurationType>DynamicLibrary</ConfigurationType>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
    <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>
    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.api</TargetExt>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <OutDir>.\Release\</OutDir>
    <IntDir>.\Release\</IntDir>
    <TargetExt>.api</TargetExt>
    <LinkIncremental>true</LinkIncremental>
    <IgnoreImportLibrary>true</IgnoreImportLibrary>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Midl>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <MkTypLibCompatible>true</MkTypLibCompatible>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <TargetEnvironment>Win32</TargetEnvironment>
      <TypeLibraryName>.\Debug/BasicPlugin.tlb</TypeLibraryName>
      <HeaderFileName>
      </HeaderFileName>
    </Midl>
    <ClCompile>
      <AdditionalOptions>
      </AdditionalOptions>
      <Optimization>Disabled</Optimization>
      <AdditionalIncludeDirectories>..\src;C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\API\Include;C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\API\Public;C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\API\Public\sandboxpisdk;C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\API\Public\sandboxpisdk\client;C:\Lawman2013\LawmanSolution\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers;C:\Lawman2013\LawmanSolution\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\SDK;C:\Lawman2013\LawmanSolution\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\ADM;C:\Lawman2013\LawmanSolution\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\API;C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\simple-ipc-lib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>_DEBUG;WIN_PLATFORM;WIN32;_WINDOWS;WIN_ENV;ACRO_SDK_LEVEL=0x00060000;READER_PLUGIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BufferSecurityCheck>true</BufferSecurityCheck>
      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
      <ObjectFileName>.\Debug/</ObjectFileName>
      <ProgramDataBaseFileName>.\LawmanAcrobatPlugin.pdb</ProgramDataBaseFileName>
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level3</WarningLevel>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
      <CompileAs>Default</CompileAs>
      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <Culture>0x0409</Culture>
    </ResourceCompile>
    <Link>
      <AdditionalOptions>/EXPORT:PlugInMain %(AdditionalOptions)</AdditionalOptions>
      <AdditionalDependencies>odbc32.lib;odbccp32.lib;version.lib;shlwapi.lib;Dbghelp.lib;sandbox_pisdk_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <OutputFile>Debug/LawmanAcrobatPlugin.api</OutputFile>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <ProgramDatabaseFile>.\Debug/LawmanAcrobatPlugin.pdb</ProgramDatabaseFile>
      <SubSystem>Windows</SubSystem>
      <ImportLibrary>.\Debug/LawmanAcrobatPlugin.lib</ImportLibrary>
      <AdditionalLibraryDirectories>C:\Lawman2013\LawmanSolution\Adobe\PIBrokerSDK\API\Public\sandboxpisdk\libs\debug;..\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\API;..\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\adm;..\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers\SDK;..\Adobe\Acrobat DC SDK\Version 1\PluginSupport\Headers;..\LawmanAcrobatPlugin\Debug;..\Debug;.\;%(AdditionalIncludeDirectories)</AdditionalLibraryDirectories>
      <IgnoreSpecificDefaultLibraries>
      </IgnoreSpecificDefaultLibraries>
      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
    </Link>
    <PostBuildEvent>
      <Message>Copy to Acrobat Plug-ins...</Message>
      <Command>if not "%SDKPIDir%"a == ""a if not exist "%SDKPIDir%" mkdir "%SDKPIDir%"
if not "%SDKPIDir%"a == ""a copy "$(targetpath)" "%SDKPIDir%"
if not "%SDKPIDir%"a == ""a echo "$(targetname)" copied to "%SDKPIDir%".
if "%SDKPIDir%"a == ""a echo not performed. SDKPIDir environment variable not set.
</Command>
    </PostBuildEvent>
    <BuildLog>
      <Path>$(IntDir)$(ProjectName).log</Path>
    </BuildLog>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Midl>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <MkTypLibCompatible>true</MkTypLibCompatible>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <TargetEnvironment>Win32</TargetEnvironment>
      <TypeLibraryName>.\Release/BasicPlugin.tlb</TypeLibraryName>
      <HeaderFileName>
      </HeaderFileName>
    </Midl>
    <ClCompile>
      <DebugInformationFormat>None</DebugInformationFormat>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>MaxSpeed</Optimization>
      <PreprocessorDefinitions>NDEBUG;WIN_PLATFORM;WIN32;_WINDOWS;WIN_ENV;ACRO_SDK_LEVEL=0x00060000;READER_PLUGIN;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
      <ObjectFileName>.\Release/</ObjectFileName>
      <BrowseInformation>true</BrowseInformation>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <CompileAs>Default</CompileAs>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <WholeProgramOptimization>true</WholeProgramOptimization>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
  <SDLCheck>true</SDLCheck>
    </ClCompile>

    <ResourceCompile>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
    </ResourceCompile>
    <Link>
      <AdditionalDependencies>odbc32.lib;odbccp32.lib;version.lib;shlwapi.lib;Dbghelp.lib;sandbox_pisdk_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>

      <SuppressStartupBanner>true</SuppressStartupBanner>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <IgnoreSpecificDefaultLibraries>
      </IgnoreSpecificDefaultLibraries>
    </Link>


  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="..\Adobe\PIBrokerSDK\API\Public\sandboxpisdk\client\SandboxPIClient.cpp" />
    <ClCompile Include="PIMain.c" />
  </ItemGroup>
  <ItemGroup>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

Legend
December 5, 2016

I don't have much idea now, but let's confirm your symptoms/do a test. Does the problem happen when all of these apply.

1. Release build as a set up by Adobe's project, not modified settings

2. NOT Reader enabled.

3. Testing on SAME machine as build, SAME machine as worked with Debug build

4. Debug and all other custom plug-ins removed.

5. Installed to Acrobat PRO not Reader.

6. Confirmed running PRO.

7. Confirmed Acrobat NOT RUNNING using Task Manager (not just status bar)

8. Confirmed keyboard not touched while Acrobat started.

Known Participant
December 6, 2016

Tested with all your conditions and nope, nothing.

So frustrated.

D

Legend
December 1, 2016

So long as the broker isn't in the same folder: the PLUG_INS folder isn't added to the Windows search order.

Did you put your message in the PIHandshake routine, at the top, using MessageBox (not AVAlert)?

Known Participant
December 1, 2016

Yep that is exactly where I put it, built it on debug one message box, release nada.

D

Legend
December 1, 2016

1) Should be fine, a classic problem is adapting a sample, without changing this.

2) Sounds OK. A thought: does it use any private DLLs? If so it's no use putting them in the plug_ins folder with the plug-in.

Known Participant
December 1, 2016

It uses a Broker which uses an External DLL, but in itself no.

(The Broker has the external files with it).

I am so new to PDF plugins (and not used C++ in far too many years (I am a vb.net guy)). Can't help but feel there is something fundamental I am missing.

So frustrating... any ideas?

Legend
December 1, 2016

Which dependency check?

Known Participant
December 1, 2016

1) It is currently set to "TMS:LawManPDFPlugin"

2) I used Microsft Dependancy Walker... which confirmed it was using the runtime version of the files, but as it was not displaying so whilst a win, still doesn't work.

lrosenth
Adobe Employee
Adobe Employee
December 2, 2016

Developer prefixes MUST be four characters in length. They MUST also be registered with Adobe.

Yours (TMS) doesn’t qualify for either.

(NOTE: this isn’t your problem with loading – but it is a problem)

Bernd Alheit
Community Expert
Community Expert
November 25, 2016

Will the release plug-in loaded in Adobe Acrobat?

Known Participant
November 25, 2016

Nope not in that either, sadly.

Bernd Alheit
Community Expert
Community Expert
November 25, 2016

You can check your plug-in with this:

Dependency Walker (depends.exe) Home Page