jugador Posted December 10, 2023 Share Posted December 10, 2023 (edited) @ptrex Using above link as reference, try registration free com on Chilkat (Crypt2 object) but getting error: Library not registered. Chilkat Crypt2 link: https://www.chilkatsoft.com/refDoc/xChilkatCrypt2Ref.html Chilkat download link: https://www.chilkatsoft.com/downloads_ActiveX.asp ChilkatAx-9.5.0-win32.sxs.manifest <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="ChilkatAx-9.5.0-win32.sxs" version="1.0.0.0" /> <file name="ChilkatAx-9.5.0-win32.dll" hashalg="SHA1"> <comClass clsid="{1AF44DC7-C896-46BA-B45B-C168FA7612A6}" tlbid="{004CB902-F437-4D01-BD85-9E18836DA5C2}" threadingModel="Apartment" progid="Chilkat_9_5_0.Crypt2" description="ChilkatCrypt2 Class 9.5.0.90"></comClass> <typelib tlbid="{004CB902-F437-4D01-BD85-9E18836DA5C2}" resourceid="1" version="1.0" helpdir="" flags="HASDISKIMAGE"></typelib> </file> <comInterfaceExternalProxyStub name="IChilkatCrypt2" iid="{380B144D-5AF4-4DC3-BBDF-AD8E25F16188}" tlbid="{004CB902-F437-4D01-BD85-9E18836DA5C2}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub> </assembly> Test.au3 Local $oErrorHandler = ObjEvent("AutoIt.Error", "__ErrFunc") #forceref $oErrorHandler __Example_A(@ScriptDir & '\' & "ChilkatAx-9.5.0-win32.sxs.manifest") Func __Example_A($manifest_FileName) Local $o_ActCtx = ObjCreate( "Microsoft.Windows.ActCtx" ) If Not IsObj($o_ActCtx) Then Return ConsoleWrite("ObjCreate failed.... Error code: " & Hex(@error, 8) & @CRLF) ConsoleWrite("=> Microsoft.Windows.ActCtx object created...." & @CRLF) $o_ActCtx.manifest = $manifest_FileName Local Const $o_progid = "Chilkat_9_5_0.Crypt2" Local $oCrypt = $o_ActCtx.CreateObject($o_progid) If Not IsObj($oCrypt) Then ConsoleWrite("ActCtx.CreateObject failed.... Error code: " & Hex(@error, 8) & @CRLF) $o_ActCtx = 0 Return EndIf ConsoleWrite("=> Chilkat_9_5_0.Crypt2 object created...." & @CRLF) $oCrypt.CryptAlgorithm = "aes" ;~ @error: Library not registered. $oCrypt = 0 $o_ActCtx = 0 EndFunc Func __ErrFunc($oError) With $oError ConsoleWrite(@CRLF & "COM ERROR DETECTED!" & @CRLF) ConsoleWrite(" Error ScriptLine....... " & .scriptline & @CRLF) ConsoleWrite(" Error Number........... " & "0x" & Hex(.number) & " (" & .number & ")" & @CRLF) ConsoleWrite(" Error WinDescription... " & StringStripWS(.windescription, 2) & @CRLF) ConsoleWrite(" Error RetCode.......... " & "0x" & Hex(Number(.retcode)) & " (" & Number(.retcode) & ")" & @CRLF) ConsoleWrite(" Error Description...... " & StringStripWS(.description, 2) & @CRLF) EndWith EndFunc @ptrex can you have a look if this method work for you on Chilkat Edited December 11, 2023 by jugador Link to comment Share on other sites More sharing options...
jugador Posted December 10, 2023 Author Share Posted December 10, 2023 after little bit of searching online got this link where @TheXman mention about using this Side-by-Side method. so tagging @TheXman also for help . Link to comment Share on other sites More sharing options...
TheXman Posted December 10, 2023 Share Posted December 10, 2023 (edited) 3 hours ago, jugador said: so tagging @TheXman also for help I'd rather not make any assumptions as to what kind of help you're looking for. Can you be more explicit as to what you would like my help with? Are you asking for help to gain a better understanding of how to create external side-by-side (sxs) manifests that allow the use of ActiveX DLL objects and methods without having to register the DLL using regsvr32? Are you asking for help gaining a better understanding of how to modify an exe's internal manifest to use ActiveX DLL objects and methods without DLL registration? I have working examples for both of those methods (internal manifest & external sxs manifest) so I can try to help you understand what's needed to get that to work. Are you asking specifically for help with why the script you posted above isn't working as expected? Or, are you asking for help with something else? Although I'm quite familiar with Chilkat's work, I've never had the need to use it in any of my projects, so I don't have a license for it. My Chilkat examples use his free objects, like the JSON object. As I hope you are aware, Chilkat's Crypt2 object requires a license. Do you have a Chilkat license? If not, then I would suggest you use one of his free objects while gaining a better understanding of how to use DLL's (like Chilkat's ActiveX DLL) without having to register them. Finally, I only used Chilkat's DLL as an example back then because he provided an easily accessible manifest for his objects and his work was very well documented, which made the creation of my internal and sxs manifest tools easier to develop and test. The tools I created for creating sxs manifests and modifying internal manifests are not specific to Chilkat. The process should work with any exe that uses such DLL's as long as a valid manifest, or the information needed to create the manifest, is available. Edited December 10, 2023 by TheXman jugador 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
jugador Posted December 10, 2023 Author Share Posted December 10, 2023 @TheXman I am using Chilkat for 2 year so It's not about Chilkat's Crypt2 object. but rather I am using Chilkat dll as a dummy example because I am too comfortable using it. Open this thread to understand how to use side-by-side(sxs) manifests to run any dll without registering. At OP post I provide ChilkatAx-9.5.0-win32.sxs.manifest and the au3 file to make myself clear about my requirment. but still look like it's not enough may be as I am not aware that it can be done 2 way 1) using external side-by-side (sxs) manifests without having to register the DLL using regsvr32 2) modify an exe's internal manifest to use ActiveX DLL objects and methods without DLL registration So to make myself clear I am looking for a way to use external side-by-side (sxs) manifests that allow to use of ActiveX DLL objects and methods without having to register the DLL using regsvr32. But it will be great learning experience for me if you could provide both the example using internal and external manifests to use DLL without registration And if this example is using Chilkat then it's even better for me to understand. Link to comment Share on other sites More sharing options...
TheXman Posted December 10, 2023 Share Posted December 10, 2023 4 minutes ago, jugador said: But it will be great learning experience for me if you could provide both the example using internal and external manifests to use DLL without registration And if this example is using Chilkat then it's even better for me to understand. I can try to help you with that. I'm sure that I still have those manifest tools & scripts that I created archived somewhere. I will find them and either create a stripped down example for you, explain the steps needed to do it, or both. The archived tools & scripts would've probably been saved with whatever version of the Chilkat's DLL was available at the time and their corresponding manifests. If so, then I'll supply them if necessary. As for the 2 different ways that I described, they are basically the same because they use the exact same manifest. The only difference is whether one would want to use the sxs method of distribution (the exe which has to be accompanied with its associated .manifest file) or to modify the exe's internal/embedded manifest, which means only the exe would need to be distributed. Each method has its advantages and disadvantages. Which method one should use, as far as I'm concerned, would depend on the use case. jugador 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
mLipok Posted December 10, 2023 Share Posted December 10, 2023 1 hour ago, jugador said: Open this thread to understand how to use side-by-side(sxs) manifests to run any dll without registering. Did you look carefully at mine Chilkat UDF ? There is a method of using this library without the need to register it. btw. You can also take a look at: also: Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
TheXman Posted December 10, 2023 Share Posted December 10, 2023 (edited) @jugador I'm more than happy to let others assist you and explain the way they did it. I'll stop gathering the info that I was compiling for you. I don't have much desire to participate in these forums anymore anyway. If you would like my assistance in the future, feel free to ask again. Edited December 10, 2023 by TheXman argumentum 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Andreik Posted December 10, 2023 Share Posted December 10, 2023 I am totally off topic this time but @TheXman this is the best About me I ever read on this forum. argumentum 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
jugador Posted December 11, 2023 Author Share Posted December 11, 2023 12 hours ago, TheXman said: I'm sure that I still have those manifest tools & scripts that I created archived somewhere. I will find them and either create a stripped down example for you, explain the steps needed to do it, or both. @TheXman let's put aside @mLipok ignorance may be he hasn't read the thread properly or overlooked the fact that I was talking about side-by-side (sxs) manifests technique. So do post what you have with the necessary step how to do it . Link to comment Share on other sites More sharing options...
mLipok Posted December 11, 2023 Share Posted December 11, 2023 4 hours ago, jugador said: let's put aside @mLipok ignorance may be he hasn't read the thread properly or overlooked the fact that... Maybe I worded it wrong (probably my fault). No, it's not ignorance but curiosity that forces you not to use this library in the way I proposed in my UDF. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
mLipok Posted December 11, 2023 Share Posted December 11, 2023 In other words, what problems do you encounter when using this library in the way I proposed? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
jugador Posted December 11, 2023 Author Share Posted December 11, 2023 (edited) @mLipok This thread is not about Chilkat or any other udf that you linked in your post. It's about learning side-by-side (sxs) manifests technique. check out this link: https://learn.microsoft.com/en-us/dotnet/framework/interop/configure-net-framework-based-com-components-for-reg Edit: change the thread title for you to "side-by-side (sxs) manifests query" to clear all your doubt what this thread about Edited December 11, 2023 by jugador Link to comment Share on other sites More sharing options...
mLipok Posted December 11, 2023 Share Posted December 11, 2023 So your reference to the Chilkat library and my UDF confused me. I apologize for the confusion I caused. jugador 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
mLipok Posted December 11, 2023 Share Posted December 11, 2023 57 minutes ago, mLipok said: In other words, what problems do you encounter when using this library in the way I proposed? it doesn't change the fact that I'm still curious Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Solution TheXman Posted December 11, 2023 Solution Share Posted December 11, 2023 (edited) 11 hours ago, jugador said: I was talking about side-by-side (sxs) manifests technique. So do post what you have with the necessary step how to do it . @jugador Looking at some of the links that you've provided, it appears that you've already done some research into side-by-side (sxs) assemblies. So I'll provide the following information based on that assumption, meaning my explanations will remain at a relatively high level and not delve into the details unless requested. Getting sxs working in AutoIt is not that difficult once you understand the steps that need to be done and why. If you have additional questions, which I'm sure you will, please don't hesitate to ask. The attached zip file contains all of the files and scripts that I will discuss in my example, except for the script that actually creates the manifest and ChilkatAx-9.5.0-x64.dll (which is too big to attach). I will provide details as to what my manifest tool does. As requested, I have provided an example using Chilkat. Here is a description of what's in the zip file: Chilkat_Manifest_9.5.0_All_Classes.xml: The <file> section from the full dll manifest. Chilkat_Manifest_9.5.0_Free_Classes.xml: The <file> section of the dll manifest that contains only free objects. Chilkat_SxS_Test.au3: The sxs example script. Chilkat_SxS_Test.exe: A compiled version of the The sxs example script. Chilkat_SxS_Test.exe.manifest: The sxs manifest needed by the compiled example. ChilkatAx-9.5.0-x64.dll: I had to remove this file from the zip because it was too big to attach. Please make sure it is in the script dir or PATH. ChilkatAx-9.5.0-x64.dll.manifest: The full Chilkat dll manifest. (only needed to get <file> section) test.json: A small test JSON file used by the example script. Making sure that you have unregistered any existing Chilkat dll, run "Chilkat_SxS_Test.exe". If successful, you should see the following output in notepad (tested on Win7 x64): Chilkat version = 9.5.0.76 { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } store.book[0] = { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 } store.book[0] Size = 4 As you can see in the test script (au3), the output is generated using properties and methods of "Chilkat_9_5_0.JsonObject" in the unregistered Chilkat Dll (that should be in the script dir or PATH) Let's drill down a little further. If you look at the script (au3), the real "magic" of creating the sxs manifest and removing the exe's internal manifest happens in an #AutoIt3Wrapper_Run_After directive. Of course this can be done in a standalone step, but I do it as a part of the compile. The output of that directive pretty much describes the process: 2023-12-11 07:45:22 Cmd Line Parms: -exe "C:\Users\<redacted>\Documents\ZZZ\Chilkat Side-by-Side Test\Chilkat_SxS_Test.exe" -include "C:\Projects\Personal\AutoIt\SxS_RegisterFree_COM_Manifest_Tool\Chilkat_Manifest_9.5.0_Free_Classes.xml" 2023-12-11 07:45:22 2023-12-11 07:45:22 2023-12-11 07:45:22 Script Started - SxS_RegisterFree_COM_Manifest_Tool v3.3.14.5 64-bit 2023-12-11 07:45:22 2023-12-11 07:45:22 Get manifest using API 2023-12-11 07:45:22 > Manifest successfully retrieved 2023-12-11 07:45:22 2023-12-11 07:45:22 Add "include" file to manifest 2023-12-11 07:45:22 > "C:\Projects\Personal\AutoIt\SxS_RegisterFree_COM_Manifest_Tool\Chilkat_Manifest_9.5.0_Free_Classes.xml" file added to manifest 2023-12-11 07:45:22 2023-12-11 07:45:22 Write external manifest 2023-12-11 07:45:22 > External manifest successfully written 2023-12-11 07:45:22 2023-12-11 07:45:22 Remove internal manifest 2023-12-11 07:45:22 > Internal manifest successfully removed 2023-12-11 07:45:22 2023-12-11 07:45:22 Script Ended - Execution time: 0.005 Secs - Exit Code: 0 2023-12-11 07:45:22 Basically, when I compile the script the manifest tool gets the compiled exe's internal manifest, reads the specified xml manifest file and adds its information to the exe's manifest, writes it out the updated manifest using the appropriate file name, and deletes the exe's internal manifest. My manifest tool is an AutoIt script that uses _WinApi functions from the WinAPIRes.au3 UDF library, it does not use any external utilities. However, I used Angus Johnson's ResourceHacker tool extensively in my development and testing. Because it has a command line interface, I had considered using it instead of the _WinAPI functions but I ultimately decided against it in an effort to make it totally independent of external utilities (and being the techie I am, I preferred to do it using code). Now, let's look at the manifest files. "ChilkatAx-9.5.0-x64.dll.manifest" is the Chilkat dll's full manifest provided by Chilkat. "Chilkat_9.5.0_Free_Classes.xml" is the the portion of that file that is used to modify the exe's manifest. It contains, from the <file> element of the full manifest, just a list of the free Chilkat objects. I could have used the full <file> element but I chose to use a subset to show that it isn't necessary. You only need the objects that will be used by the script. If you look at "Chilkat_SxS_Test.exe.manifest" you will see the exe's previous internal manifest that now includes the <file> element from the "Chilkat_9.5.0_Free_Classes.xml" file. That's pretty much it. It may be a lot to absorb at first, but it is pretty simple once you understand the information that needs to be pulled from the dll's manifest and added to the compiled exe's sxs manifest. There are a few little "gotchas" that you may run into, like having to touch the exe file's "modified date" if you make changes to the manifest without recompiling in order for the exe to pick up the changes. But the whole process is pretty straight forward. I'll give you a chance to absorb all of that information. As I said, I'm sure you'll have questions, especially about my "SxS_RegisterFree_COM_Manifest_Tool" and how it works with the exe's resource information, retrieves the manifest from it, and the removes it. As I mentioned, I just chose to write my own tool to create the manifest. It is much easier to use ResourceHacker, especially its command line interface. However, if you want to know more about the _WinApi functions I used to to manipulate the exe's resource information, feel free to do so. Since I stopped working on a reply after the other person's post, I cobbled all of this back together rather quickly. Hopefully, I didn't leave anything out, make any misstatements, or mistakes. I hope this helps. Additional links that may be useful: https://learn.microsoft.com/en-us/windows/win32/sbscs/guidelines-for-creating-side-by-side-assemblies https://learn.microsoft.com/en-us/windows/win32/sbscs/about-side-by-side-assemblies- Other associated topics listed on their pages. CHILKAT_SXS_EXAMPLE.ZIP Edited December 11, 2023 by TheXman Removed unnecessary global constant from the example script. argumentum, jugador and Musashi 1 2 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
jugador Posted December 11, 2023 Author Share Posted December 11, 2023 (edited) @TheXman Thanks for the code and the explanation how to use it . It may take few days to understand what you did. I used mt.exe to create the above manifests but that don't include progid and I have to write down all the progid by typing https://learn.microsoft.com/en-us/windows/win32/sbscs/mt-exe one question for now, is this portion needed if is not .net dll? <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/> </dependentAssembly> </dependency> Before I ask anything about SxS_RegisterFree_COM_Manifest_Tool, I must first understand all the manifests and xml details . Edited December 11, 2023 by jugador Link to comment Share on other sites More sharing options...
TheXman Posted December 11, 2023 Share Posted December 11, 2023 (edited) 50 minutes ago, jugador said: one question for now, is this portion needed if is not .net dll? I don't think I completely understand your question. I think you are asking what's needed in the exe's manifest if it is not a .Net dll. My discussion and example of sxs manifests is only in relation to dll's with COM/ActiveX interfaces, not .Net dll assemblies. As for what's needed in the example exe's manifest, just look at the "Chilkat_SxS_Test.exe.manifest" file. All that was needed from the Chilkat dll's manifest was the <file> section of the manifest's xml file. And more specifically, the only objects needed from the <file> section are those used in the compiled exe. Of course you can include all of the objects, but the only ones needed are the ones you used in the script. So all that is needed in a compiled AutoIt exe's manifest is the exe's original manifest information and the <file> element that defines the COM objects that will be used in the compiled exe and the associated <typelib> element. To be clear, the only part of the manifest below that was added to the exe's original manifest is the <file>...</file> element, which is defining the Chilkat COM objects used in the compiled exe. Minimum Chilkat_SxS_Test.exe.manifest (the example script only uses Chilkat's Chilkat_9_5_0.JsonObject object): <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <file name="chilkatax-9.5.0-x64.dll"> <typelib tlbid="{004cb902-f437-4d01-bd85-9e18836da5c2}" version="1.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" /> <comClass clsid="{82df90a6-29b8-4bfc-9433-76a7bc3e0e82}" threadingModel="Apartment" tlbid="{004cb902-f437-4d01-bd85-9e18836da5c2}" progid="Chilkat_9_5_0.JsonObject" description="ChilkatJsonObject Class 9.5.0" /> </file> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/> </dependentAssembly> </dependency> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> </application> </compatibility> </assembly> I hope that answers your question. If not, can you reword it or add more context so I can fully understand what you're asking? Update: For the record, I'm not familiar with the mt.exe tool that you referenced. It was not one of the tools that I used when learning about how to implement sxs manifests in order to use COM Dll's, without registration in AutoIt. Edited December 11, 2023 by TheXman jugador 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
TheXman Posted December 11, 2023 Share Posted December 11, 2023 (edited) 1 hour ago, jugador said: Before I ask anything about SxS_RegisterFree_COM_Manifest_Tool, I must first understand all the manifests and xml details Try not to dig too deeply, you will suffer from information overload. To understand what's needed in the external sxs manifest, using the example that I provided, I would start by first looking at the manifest provided by Chilkat for his Dll's. Because I compiled a 64-bit exe, that means look at "ChilkatAx-9.5.0-x64.dll.manifest". The only part of that file that you need to be concerned with is the part between <file> and </file>, inclusively. That is the part that needs to be added to the compiled exe's internal manifest in order to create the external sxs manifest. The contents of "Chilkat_Manifest_9.5.0_Free_Classes.xml" is the part of the full manifest that I added to the exe's original manifest. It only contains entries for the Chilkat objects that don't require a Chilkat license. I didn't need to strip it down to just those objects. I could've used the complete list of objects. So the combination of the original manifest and "Chilkat_Manifest_9.5.0_Free_Classes.xml" is what makes up the exe's external manifest ("Chilkat_SxS_Test.exe.manifest"). The only other important part of the whole process, was removing the exe's internal manifest from its resources so that it will look for the external manifest. What I just described is basically what my SxS_RegisterFree_COM_Manifest_Tool automates. Edited December 11, 2023 by TheXman jugador 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
jugador Posted December 12, 2023 Author Share Posted December 12, 2023 @TheXman Again thanks for the detail post. You mentioned 21 hours ago, TheXman said: My manifest tool is an AutoIt script that uses _WinApi functions from the WinAPIRes.au3 UDF library, it does not use any external utilities. so just an attempt but I haven't yet figure out how you get all those clsid & progid & description from the dll file with _WinApi functions. #include <WinAPIRes.au3> Local $o_Fpath = @ScriptDir & '\' & 'ChilkatAx-9.5.0-win32.dll' __Example1A($o_Fpath) Func __Example1A($o_Fpath) Local $o_Ext = StringRegExpReplace($o_Fpath, "^.*\.", "") If ($o_Ext <> 'exe') And ($o_Ext <> 'dll') Then Return Local $o_Name = (($o_Ext = 'exe') ? 1 : 2) Local $hInstance = _WinAPI_LoadLibraryEx($o_Fpath, $LOAD_LIBRARY_AS_DATAFILE) If Not $hInstance Then Return ConsoleWrite('> _WinAPI_LoadLibrary() Failed..... ' & @CRLF) Local $RT_MANIFEST = 24 Local $hResource = _WinAPI_FindResource($hInstance, $RT_MANIFEST, $o_Name) If Not $hResource Then _WinAPI_FreeLibrary($hInstance) ConsoleWrite('> _WinAPI_FindResource() Failed..... ' & @CRLF) Return Endif Local $i_Size = _WinAPI_SizeOfResource($hInstance, $hResource) Local $hData = _WinAPI_LoadResource($hInstance, $hResource) Local $pData = _WinAPI_LockResource($hData) Local $tData = DllStructCreate('CHAR[' & $i_Size + 1 & ']', $pData) ConsoleWrite('> $tData: ' & @crlf & DllStructGetData($tData, 1) & @crlf) _WinAPI_FreeLibrary($hInstance) EndFunc Link to comment Share on other sites More sharing options...
TheXman Posted December 12, 2023 Share Posted December 12, 2023 (edited) There seems to be a misunderstanding as to where the full Chilkat DLL manifests came from and where my manifest tool gets its information. Please keep in mind that I haven't looked at this stuff in 4-5 years. So my recollection of the details may be a bit hazy. As I said, I had to pull all of this code from my archives and cobble together the examples for you. If I recall correctly, the full Chilkat manifests came from the Chilkat site itself -- but I could be mistaken. My manifest tool gets its information from those manifest files, not from within dll file. However, that information does reside within the dll's resource information under the "Registry" folder. Therefore, the section of the manifest that needs to be added to the original manifest could be generated from the DLL itself. But again, that is not where my manifest tool gets that information. My manifest tool does retrieve and delete information in the compiled AutoIt exe's resource data but it does not touch the Chilkat dll in any way. Edited December 14, 2023 by TheXman jugador 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now