The Install DLL (MyDll_NT.dll) contains functions to add and remove components of the printer driver like the Port Monitor, Print Processor, Driver and Printer. The functions of the Install DLL can also be used to change the DEVMODE members’ values and set the printer driver settings at install time. The Install DLL (MyDll_NT.dll) is used by the several installation samples including the InstallShield project, and can be used by any installation package which can call DLL functions.
About 64-bit installs:
Do not forget to choose the appropriate project configuration:
NT Release: for 32 bit installations
NT Release x64: for 64 bit installations
64 bit RTKs contains 32 bit MyDll_NT.dll for 64 bit operating systems. If a 64 bit MyDll_NT.dll is needed, one can add x64 platform in Visual Studio, and build a 64 bit MyDll_NT.dll.
In the RTK the Install DLL is a 32-bit DLL even when the Vusial Studio project is set to build the MyDll_NT.dll with NT Release x64option. The reason for this is that, some installers (e.g, InstallShield 12) can only create 32-bit Install executables, and can not load 64-bit DLLs. If the installer executable is a 64 bit, the MyDll_NT.dll has to be rebuilt and used in the place of the supplied MyDll_NT.dll in the RTK. The MyDll_NT.dll can be rebuilt with Visual Studio 2005/2008/2010. For more information, please see the following page in the manual: 32 bit application installing Black Ice printer driver on 64 bit system.
MSI Installers pass the parameters to the Install DLL through the registry. On 64-bit Windows, portions of the registry entries are stored separately for 32-bit applications and for 64-bit applications. In earlier Driver versions (32bit-64bit), this could cause problems when the 32-bit Install DLL tried to read the values written by the 64 bit MSI installer. Since version 13.23 revision 291, it does not matter whether the created MSI package is a 32-bit or 64-bit installer, the Install DLL can read the values properly. Use the HKEY_LOCAL_MACHINE\SOFTWARE\Black Ice Software LLC\<Driver Name>\PrinterVariablesValues key to store the values. Replace <Driver Name> with one of the following strings, depending on the product: ColorNT, MonoNT, EmfNT, PdfNT, ColorPlusNT, ColorTS, MonoTS, EmfTS, PdfTS, ColorPlusTS. For more information, please see our MSI printer driver install sample
Developers:
In the Windows 11/10/8/7 driver, the DEVMODE is handled as UNICODE. The Install DLL has to be compiled with the following project settings:
1. The Structure Alignment must be 1 byte.
2. The following defines must be defined in the project: UNICODE, _UNICODE, _WIN32_WINNT=0x0400
To change a member of the DEVMODE at install time, follow the steps below:
1. Call the dSetParameter() function from the Install DLL to set a member of the DEVMODE structure.
2. Repeat step 1 for each member of the DEVMODE you wish to set.
3. When all of the members are set to the required value, call the dDocumentProperties() function from the Install DLL to write the new settings to the printer.
When all of the members are set to the required value, call the dDocumentProperties() function from the Install DLL to write the new settings to the printer.
NOTE: To compile and link the Install DLL (MyDll.dll) the MFC Unicode libraries must be installed with the Microsoft Visual C.
The new MyDll_NT.dll should be copied to the Install Shield project “Compressed Files\Language Independent\OS Independent” folder.
The Black Ice printer drivers can be installed using a single function call, dInstallBlackIcePrinter or dInstallBlackIcePrinter2
dInstallBlackIcePrinter is available in version 8.70 and higher of the Black Ice printer drivers, dInstallBlackIcePrinter2 is available in version 13.73 and higher. The dInstallBlackIcePrinter2 function has an additional option that disables all dialogs and message boxes to support silent installations; otherwise the two function calls are equivalent.
MSI Install CustomActionData
UILevel and DELETEEXISTING properties needs to be set in Visual Studio at CustomActionData property in order to run the MSI installer in silent mode, or to configure the MSI installation to delete the defined Printer Driver if it’s already exists on the system.
UILevel and DELETEEXISTING was implemented in MyDLL_NT.DLL
Add CustomActionData = UILevel=[UILevel];DELETEEXISTING=[DELETEEXISTING]
if (UILevel < 4) then installer is running in silent mode
If (DELETE EXISTING = 1) then installer is deleting the printer driver, if the printer driver named XYZ already exists.
Troubleshooting – Installation Debug Logging:
The Install DLL (My_DLL.dll) have a built-in feature to generate detailed log files of the Black Ice Printer Drivers installations, API/RTK installations and install samples to let Developers and System Integrators to speed up troubleshooting and isolate problems. For more information please refer to the Enable Installation Logging section of the manual.
Sample Source Code Folder Location:
<RTK Installation Folder>\Install\InstallDLL
Project file: |
Compiler: |
Mydll2005.sln Mydll2008.sln Mydll2010.sln |
Visual Studio 2005 Visual Studio 2008 Visual Studio 2010 |
Mydll2012.sln |
Visual Studio 2012 |
Mydll2013.sln |
Visual Studio 2013 |
Mydll2015.sln |
Visual Studio 2015 |
Choose the appropriate project configuration:
NT Release: for 32 bit installations
NT Release x64: for 64 bit installations
Rebuild the project.
This section contains the following functions:
CreateRegistryKeyForApplicationStarting
Changing the Black Ice logo on the install form
This section does not available in the DEMO RTK.