After an application is developed and ready to redistribute, create a setup.exe that includes all of the necessary files.
This topic summarizes which files to include on your distribution diskettes to support the LEADTOOLS Virtual Printer functions on WIN32 and x64 systems.
Note: You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license.
General Notes:
Environment-Specific notes:
32-bit Operating Systems: Unless otherwise noted, all 32-bit should be deployed to the System32 folder as shared files.
64-bit Operating Systems: Unless otherwise noted, all 32-bit files should be deployed to the SysWow64 folder and 64-bit files should be deployed to the System32 folder as shared files.
XP / Server 2003: If running within a service on an XP or Server 2003 machine you may run into an issue where the printer installs but doesn't receive the events. This is a result of the default DCOM authentication settings. To correct this, go to Start -> Run and enter "dcomcnfg". Then right click on Component Services -> Computers -> My Computer and select properties. On the Default Properties tab select "None" for the Default Authentication Level.
Destination directory structure specification:
Use the L_PrnInstallPrinter function to install the LEADTOOLS Virtual Printer Module. Pass the structure PRNPRINTERINFO to this function. The installation path specified in the pszRootDir member of the PRNPRINTERINFO structure is the root folder in which the LEADTOOLS Virtual Printer is installed. This folder should contain two sub-folders:
-\Bin. This folder should contain the LeadtoolsPrinter.exe executable file.
-\Spool. Used to store temporary files generated while printing.
Note: All users of this printer must have access to the folder passed to the pszRootDir member.
Printer Driver INF installation for Windows Vista and later:
Use the following function to install LEADTOOLS Virtual Printer Driver INF:
#define UPDP_UPLOAD_ALWAYS 0x00000002L
typedef HRESULT (*pUPLOADPRINTERDRIVERPACKAGE)(LPCTSTR pszServer,LPCTSTR pszInfPath,LPCTSTR pszEnvironment,DWORD dwFlags,HWND hwnd,LPTSTR pszDestInfPath,PULONG pcchDestInfPath);
typedef HRESULT (WINAPI * pINSTALLPRINTERDRIVERFROMPACKAGE) (LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, DWORD);
L_INT InstallDriverPackage(const L_WCHAR* pszInfPath, const L_WCHAR* pszEnvironment)
{
L_INT nRet = FAILURE;
HINSTANCE hInstance = LoadLibrary("Winspool.drv");
if (hInstance == NULL)
{
return nRet;
}
pUPLOADPRINTERDRIVERPACKAGE pUploadPackage = (pUPLOADPRINTERDRIVERPACKAGE)GetProcAddress(hInstance, "UploadPrinterDriverPackageW");
if (pUploadPackage != NULL)
{
TCHAR szDestInfPath[512];
DWORD dwDestLen = 512;
HRESULT hr = pUploadPackage(NULL,A2W(pszInfPath), pszEnviroment, UPDP_UPLOAD_ALWAYS, GetDesktopWindow(), szDestInfPath, &dwDestLen);
if(hr == S_OK)
{
pINSTALLPRINTERDRIVERFROMPACKAGE pInstallPrinterDriverFromPackage = (pINSTALLPRINTERDRIVERFROMPACKAGE)GetProcAddress((HMODULE)hInstance, "InstallPrinterDriverFromPackageW");
if(pInstallPrinterDriverFromPackage != NULL)
{
hr = pInstallPrinterDriverFromPackage(NULL, szDestInfPath, L"LEADTOOLS VIRTUAL PRINTER", pszEnvironment, 0);
if(hr == S_OK)
nRet = SUCCESS;
}
}
}
FreeLibrary(hInstance);
return nRet;
}
Install the 64-bit driver package by calling:
InstallDriverPackage(%Redist%\\DriverPackageX64\\LeadtoolsVirtualPrinter.INF, L"Windows x64");
Install the 32-bit driver package by calling:
InstallDriverPackage(%Redist%\\DriverPackageX86\\LeadtoolsVirtualPrinter.INF, L"Windows NT x86");
Note: For Network printing, it is possible to install both packages (x86 and x64) on the Server machine in order to support both types of client machines
Required LeadtoolsPrinter.exe files
These can be found in the <installationdir>\Redist\Virtual Printer\Common\Bin\ directory, where <installationdir> represents the directory in which you installed the LEADTOOLS toolkit.
This file should be placed in the Bin folder as described in the destination directory structure specification above.
Required COM Servers
These can be found in the <installationdir>\Redist\Virtual Printer\Common\ComSvr\ directory, where <installationdir> the directory in which you installed the LEADTOOLS toolkit.
These files can be placed in the Bin folder as described in the destination directory structure specification above.
The following files are required for all OS.
Redistributables |
Explanation |
Files to use (32-bit) |
LPCLB |
LEADTOOLS Printer COM server. Should be registered using regsvr32 (regsvr32 LPCLB06N.DLL). |
LPCLB06N.DLL |
LPCMG |
LEADTOOLS Printer COM Server. Should be registered using / RegServer (LPCMG06N /Regserver) |
LPCMG06N.exe |
LPWSE |
LEADTOOLS Printer COM Server. Should be registered using / RegServer (LPWSE06N /Regserver) and unregistered using /UnRegServer (LPWSE06N / UnRegServer). |
LPWSE06N.EXE |
LPCPN |
LEADTOOLS Printer COM server, Should be registered using regsvr32(regsvr32 LPCPN06N.DLL). |
LPCPN06N.dll |
LPPRNCON |
LEADTOOLS Printer COM server. Should be registered using regsvr32 (regsvr32 LPPRNCON.DLL). |
LPPRNCON.DLL |
LpPrinterThunk.exe |
LEADTOOLS Printer COM Server. Should be registered using / RegServer (LpPrinterThunk /Regserver) and unregistered using /UnRegServer (LpPrinterThunk / UnRegServer). |
LpPrinterThunk.exe |
Required DLLs for Win32 Applications
These files can be found in the <installationdir>\Redist\Virtual Printer\Common\Driver\Win32\ directory, where <installationdir>represents the directory in which you installed the LEADTOOLS toolkit.
The 64-bit Drivers can be found in the <installationdir>\ Redist\Virtual Printer\Common\Driver\Winx64\ directory, where <installationdir>, represents the directory in which you installed the LEADTOOLS toolkit.
These files should be deployed only for 32-bit operating systems.
Redistributables |
Explanation |
Files to use (32-bit) |
LPDRV |
Driver DLL |
LPDRV06N.DLL |
LPUID |
Driver DLL |
LPUID06N.DLL |
LPPMN |
Port DLL |
LPPMN06U.DLL |
LPDRV (64-bit Drivers), needed only for network printers. |
Driver DLL |
LPDRV06x.DLL |
LPUID (64-bit Drivers), needed only for network printers. |
Driver DLL |
LPUID06x.DLL |
Required DLLs for 64-bit Operating Systems (system32)
These files can be found in the <installationdir>\ Redist\Virtual Printer\Common\Driver\Winx64\ directory, where <installationdir>, represents the directory in which you installed the LEADTOOLS toolkit.
The 32-bit Drivers can be found in the <installationdir>\ Redist\Virtual Printer\Common\Driver\Win32\ directory, where <installationdir>, represents the directory in which you installed the LEADTOOLS toolkit.
The 32-bit Drivers should be deployed in the System32 folder.
These files should be deployed only for 64-bit operating systems.
Redistributables |
Explanation |
Files to use (32-bit) |
LPDRV |
Driver DLL |
LPDRV06x.DLL |
LPUID |
Driver DLL |
LPUID06x.DLL |
LPPMN |
Port DLL |
LPPMN06x.DLL |
LPDRV (32-bit Drivers), needed only for network printers. |
Driver DLL |
LPDRV06N.DLL |
LPUID (32-bit Drivers), needed only for network printers. |
Driver DLL |
LPUID06N.DLL |