ptrex Posted September 27, 2007 Share Posted September 27, 2007 (edited) RegFreeCOM Au3X Example Some time ago, someone in the support forum was asking if it is possible to distribute COM DLL's, on different machines, and not registering them. Well infact it is possible, using the MS SxS Manifest approach. For those who don't know what SxS is, it's an other word for ESCAPING DLL HELL : Quote Windows XP introduces a new COM activation model called registration-free COM, or Reg-Free COM for short. Simply stated, Reg-Free COM is a registry replacement for COM components. It works by expressing all of the standard component registration information that is typically installed into the system registry in a file that can be stored in the same folder as the application itself. More information on how to build RegFreeCOM Manifest files, look here : Simplify App Deployment with ClickOnce and Registration-Free COM Download this example. RegFreeCOM_Au3X_Example.zip Save it to a machine running at least XP, and don't register any AutoItX3.dll. Run the "RegFreeCOM_Au3X_Example.exe" and see what happenes. Copy it to an other machine an try again. You will see that you are liberated from DLL registration as of now. The SxS technique is using an XML Manifest file to replace the need to use "regsvr32" for registering the COM objects. For those who remember my example on how to create COM objects, without the need of a DLL. This is next complimentary technique,l that allow you to create, run and distribute COM objects, by just distributing some files. This is an other example : Make sure no Au3X.Dll is installed on that machine. Or run : regsvr32 "C:\Program Files\AutoIt3\AutoItX\AutoItX3.dll" /u In order to run this -> Compile the code to RegFreeCOM_Au3X_Example.exe And put it in the same folder as where the Manifest files are located. (Can be a USB stick) $oAutoIt = ObjCreate("AutoItX3.Control.1") $oAutoIt.Run("notepad.exe") ;Wait for the window "Untitled" to exist and be active $oAutoIt.WinWaitActive ("Untitled") $oAutoIt.Send("{Enter}") $oAutoIt.Send("This is an example of : ") $oAutoIt.Send("{Enter}") sleep(500) $oAutoIt.Send("How to get rid of the need of the registry,") $oAutoIt.Send("{Enter}") sleep(1000) $oAutoIt.Send("in order to run COM object like Au3X.dll") $oAutoIt.Send("{Enter}") sleep(1000) $oAutoIt.Send("{Enter}") $oAutoIt.Send("{Enter}") $oAutoIt.send("Enjoy!") See here for more REGFREE examples tested on different platforms : https://www.autoitscript.com/forum/topic/204813-use-autoitx-as-com-rot-object-without-regsvr32-registration/?do=findComment&comment=1472426 https://www.autoitscript.com/forum/topic/204813-use-autoitx-as-com-rot-object-without-regsvr32-registration/?do=findComment&comment=1472602 Enjoy !! ptrex Edited January 11, 2021 by ptrex yahaosoft, Professor_Bernd, mLipok and 1 other 4 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
JRSmile Posted September 27, 2007 Share Posted September 27, 2007 RegFreeCOM Au3X Example Some time ago, someone in the support forum was asking if it is possible to distribute COM DLL's, on different machines, and not registering them. Well infact it is possible, using the MS SxS Manifest approach. For those who don't know what SxS is, it's an other word for ESCAPING DLL HELL : More information on how to build RegFreeCOM Manifest files, look here : Simplify App Deployment with ClickOnce and Registration-Free COM Download this example. RegFreeCOM_Au3X_Example.zip Save it to a machine running at least XP, and don't register any AutoItX3.dll. Run the "RegFreeCOM_Au3X_Example.exe" and see what happenes. Copy it to an other machine an try again. You will see that you are liberated from DLL registration as of now. The SxS technique is using an XML Manifest file to replace the need to use "regsvr32" for registering the COM objects. For those who remember my example on how to create COM objects, without the need of a DLL. This is next complimentary technique,l that allow you to create, run and distribute COM objects, by just distributing some files. Enjoy !! ptrex GREAT !!! i love to see that this is possible, even on a win2000 machine. btw: could you look into the WinPCap problem i have with packet.dll can need your help $a=StringSplit("547275737420796F757220546563686E6F6C75737421","") For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4) Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI" Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile; MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-) Link to comment Share on other sites More sharing options...
gseller Posted September 27, 2007 Share Posted September 27, 2007 (edited) Ok, I see an icon in the title bar that is not the one used to compile and a run notepad button. Click on the run notepad and notepad opens. Without sharing the source code this is all I can see working. Notepad works from any old button.. LOL Care to share? edit: typo Edited September 27, 2007 by gesller Link to comment Share on other sites More sharing options...
ptrex Posted September 27, 2007 Author Share Posted September 27, 2007 @all Most of you will know WinPE or BartPE (running Windows from a bootable CD) Well those of you who have BartPE on the machine should look for *.Manifest files. And you wiill see that that's the secret to liberate you from the Registry, when running DLL's. So what I tested is this : 1. I Unregistered the Au3X COM DLL -> regsvr32 "C:\Program Files\AutoIt3\AutoItX\autoitx3.dll" /u 2. I copied the files from the 1st post, to a USB memory stick. And run the application. So as of know you can run the Au3X anywhere anyplace. Enjoy !! ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ptrex Posted September 27, 2007 Author Share Posted September 27, 2007 @gesller Open the "RegFreeCOM_Au3X_Example.exe.manifest" in Notepad and you will see the source. But without reading the background info I linked in the 1st post. It won't tell you much will it ?! regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
gseller Posted September 27, 2007 Share Posted September 27, 2007 Aha! I see. using the manifest to overide reg. Sweet! That will open the door to make many more portable apps.. Cool! Link to comment Share on other sites More sharing options...
ptrex Posted September 27, 2007 Author Share Posted September 27, 2007 @gesllerThat is one of the advantages of RegFreeCOM Dll's.Here are some more :The benefit of describing components in the system registry is that it enables them to be shared among multiple applications. It's also possible to register a component such that it can be installed and activated on another machine over the network. If your application is not using any of these capabilities, then this global machine registration can also be a huge liability for your application. First, ensuring every component is properly registered usually requires the overhead of a separate setup program, such as an MSI or EXE installer. Also, component registration may involve anywhere from dozens to thousands of registry keys, depending on the size of the component. If any one of these entries is corrupted, it can cause the application to fail. Having applications, components, and registration scattered all over the machine can make it very hard to properly manage application updates and uninstallation, particularly if some of the components are shared between multiple applications. This is probably COM's most prevalent problem as it makes some components and applications extremely fragile and difficult to maintain.So lookking at it the opposite way, AU3 can use "Manifest" COM objects without a need of a Registry.Example might be that you want to writ a SQLiteX database application and distribute it. But the downsite is that each client needs to register the SQLiteX DLL on the client.Using a SQLiteX.Manifest file solves the problem of registering it on each client. It will run as it is without the need of a registration in the registry.I hope this clarifies it a bit more.Regards,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
gseller Posted September 27, 2007 Share Posted September 27, 2007 You do write some sweet code! Thanx Link to comment Share on other sites More sharing options...
ptrex Posted September 28, 2007 Author Share Posted September 28, 2007 @All Updated the first post with a more visible example for the AU3 users. Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
GEOSoft Posted September 28, 2007 Share Posted September 28, 2007 @AllUpdated the first post with a more visible example for the AU3 users.Regards,ptrexLooks good but you might want to try editing this part of your first postOr run : regsvr32 "C:\Program Files\AutoIt3\AutoItX\AutoItX3.dl"l /u to get the closing quote in the right place. Just in case someone decides to copy/paste it. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ptrex Posted September 28, 2007 Author Share Posted September 28, 2007 @GEOSoft Thanks for noticing. Fixed in the first post. regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
toxicvn Posted October 24, 2008 Share Posted October 24, 2008 thank Link to comment Share on other sites More sharing options...
yahaosoft Posted November 11, 2012 Share Posted November 11, 2012 thank you very much! I used it in my project and worked well. Thanksgiving... Link to comment Share on other sites More sharing options...
ShawnJ007 Posted December 9, 2012 Share Posted December 9, 2012 This looks so promising! I've been trying to interface with a comvisible=false .NET DLL for quite some time now with no luck. I've tried reading through the MSDN resources on the topic, but I'm a little confused as where to get started... Any advice on how to create the manifest and required files for this technique from a DLL? Is there an easy way to view/browse the methods within the DLL that have become ready for use? PTrex your work is really impressive! Thanks!~ Link to comment Share on other sites More sharing options...
ptrex Posted December 11, 2012 Author Share Posted December 11, 2012 @ShawnJ007This is a +5 year old topic, so things have changed over time !First of all there are 2 unrelated questions coming from you :1. RegFree SxS technique has been changed by MS because of security since the version Vista and higher. Making this very hard to if not impossible to work. But don't worry because trancexx has added this feature native to AutoIT.Just reference the CLID in the objcreate like here.... ; Object identifiers Global Const $sCLSID = "{1A671297-FA74-4422-80FA-6C5D8CE4DE04}" ;Global Const $sIID = "{3D54C6B8-D283-40E0-8FAB-C97F05947EE8}" Global Const $sIID = Default ..... ; Create the hActiveX Local $oAutoIt = ObjCreate($sCLSID, $sIID, $hActiveX) I am not sure whether this is mentioned in the help file somewhere, best test it using the Beta version AU3.2. How to view / Methods / properties in a DLL :See here for a perfect solution created by trancexx called TypeLib Viewer Rgds,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ValeryVal Posted December 12, 2012 Share Posted December 12, 2012 @ptrex: I believe that you have in mind ; Create the hActiveX Local $oAutoIt = ObjCreateInterface($sCLSID, $sIID, $hActiveX) instead of ; Create the hActiveX Local $oAutoIt = ObjCreate($sCLSID, $sIID, $hActiveX) Is it truth? The point of world view Link to comment Share on other sites More sharing options...
ptrex Posted December 12, 2012 Author Share Posted December 12, 2012 No not realy ? But as I said you can only use it in the autoIT Beta 3.3.9.4 and higher I guess ? Here is a full working example expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=beta #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=Y Global $hActiveX ; Load the server module If @AutoItX64 Then $hActiveX = DllOpen(@ScriptDir & "\AutoItX3_x64.dll") Else $hActiveX = DllOpen(@ScriptDir & "\AutoItX3.dll") EndIf ;MsgBox(0,"x64",@AutoItX64) ; Object identifiers Global Const $sCLSID = "{1A671297-FA74-4422-80FA-6C5D8CE4DE04}" ;Global Const $sIID = "{3D54C6B8-D283-40E0-8FAB-C97F05947EE8}" Global Const $sIID = Default ; Or use keyword Default if you want to use the Default interface ID ; Error monitoring Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " ScriptLine: " & $oError.scriptline & " - " & $oError.windescription & @CRLF) Return EndFunc ;==>_ErrFunc ; Create the hActiveX Local $oAutoIt = ObjCreate($sCLSID, $sIID, $hActiveX) If $oAutoIt = 0 Then MsgBox(16,"Error", "Could not create the object, Common problem ActiveX not registered.") ; This will create a tooltip in the upper left of the screen $oAutoIt.ToolTip ("This is a tooltip", 550, 600) $oAutoIt.Sleep (3000) ; Sleep to give tooltip time to display ;Sleep(1000) $oAutoIt = "" DllClose($hActiveX) Rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New 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