ClickOnce w/ x64 DLL’s

I recently discovered this crucial bit of information:

I compile my project for x86 systems (vs Any CPU or x64). Just wanted you to be aware of this. Your last email stated “You must deploy the x64 ChilkatDotNet2.dll to x64 systems” which is not correct.  This is an important consideration for “Click Once” deployments which do not have built-in conditional installations as do MSI installations. So by compiling for x86, “Click Once” deployments need only distribute the 32 bit version of Chilkat for both 32 and 64 bit systems.

My understanding has been refined to this:  It is possible to run either x86 or x64 EXE’s on the x64 architecture, however, DLL’s loaded by the EXE must match the architecture of the EXE (x86 or x64).  My guess is that an EXE created in a managed .NET application compiled to “Any CPU” would be required to load a DLL matching the processor architecture.

The Windows Registry can also be an issue.  This post describes how the registry on x64 Windows is divided into 32-bit and 64-bit keys.  If your EXE is loading an ActiveX DLL (not a .NET assembly) then an x86 EXE would be reading the x86 keys, but if the ActiveX registry information is in the x64 keys, you’ll get an error when trying to create the object — probably a “class not registered” type of error.

ActiveX – Object to DLL Mapping

This table shows which objects are contained in which DLLs. If you use an object in the left-hand column of the table, then you need to deploy the corresponding DLL in the right-hand column.

AppSettings ChilkatUtil.dll
ChilkatAtom ChilkatXml.dll
ChilkatBounce ChilkatBounce.dll
ChilkatBz2 ChilkatBz2.dll
ChilkatCache ChilkatHttp.dll
ChilkatCert ChilkatCert.dll
ChilkatCertStore ChilkatCert.dll
ChilkatCharset2 ChilkatCharset.dll
ChilkatCompression ChilkatCompression.dll
ChilkatCreateCS ChilkatCert.dll
ChilkatCrypt2 ChilkatCrypt2.dll
ChilkatCSP ChilkatCert.dll
ChilkatCsv ChilkatCsv.dll
ChilkatDh ChilkatDh.dll
ChilkatDSA ChilkatDsa.dll
ChilkatEmailBundle2 ChilkatMail2.dll
ChilkatEmail2 ChilkatMail2.dll
ChilkatFtp2 ChilkatFtp2.dll
Gzip ChilkatGzip.dll
HtmlToText HtmlToXml.dll
HtmlToXml HtmlToXml.dll
ChilkatHttp ChilkatHttp.dll
ChilkatHttpRequest ChilkatHttp.dll
ChilkatHttpResponse ChilkatHttp.dll
ChilkatImap ChilkatImap.dll
KeyContainer ChilkatCert.dll
ChilkatMailMan2 ChilkatMail2.dll
ChilkatMht ChilkatMht.dll
ChilkatMime ChilkatMime.dll
ChilkatOmaDrm ChilkatCrypt2.dll
ChilkatPfx ChilkatPfx.dll
PrivateKey ChilkatCert.dll
PublicKey ChilkatCert.dll
ChilkatRar ChilkatZip2.dll
ChilkatRarEntry ChilkatZip2.dll
ChilkatRsa ChilkatRsa.dll
ChilkatRss ChilkatXml.dll
ChilkatService ChilkatService.dll
ChilkatSFtp ChilkatSsh.dll
ChilkatSFtpDir ChilkatSsh.dll
ChilkatSFtpFile ChilkatSsh.dll
ChilkatSocket ChilkatSocket.dll
ChilkatSsh ChilkatSsh.dll
ChilkatSshKey ChilkatSsh.dll
ChilkatSshTunnel ChilkatSsh.dll
ChilkatUpload ChilkatUpload.dll
UploadRcv ChilkatUpload.dll
ChilkatXml ChilkatXml.dll
ChilkatXmp ChilkatXmp.dll
ChilkatZipEntry2 ChilkatZip2.dll
ChilkatZip2 ChilkatZip2.dll
CkDataArray ChilkatUtil.dll
CkData ChilkatUtil.dll
CkString CkString.dll
CkStringArray ChilkatUtil.dll
Mailboxes ChilkatImap.dll
MessageSet ChilkatImap.dll
Spider ChilkatSpider.dll
UnixCompress ChilkatUC.dll

Permanent Unlock Code

Very quick question for you about distribution. Is it a simple matter of just using this unlock code in the appropriate place in the code and adding a reference to the dll in my project? Or, do I need to include and run your MSI with the installation of my own application for all of my customers?

You don’t need to run the .msi — it’s simply a matter of inserting the permanent unlock code into the UnlockComponent method call.

(If you’re using the ActiveX, you’ll also need to make sure the Chilkat DLL is registered via regsvr32 — and that is standard to all ActiveX’s and handled automatically by most installer programs.)