-1

I am developing a software in Visual Studio. I need to use the AutoIt DLLs but it only allows me to use these if I install the AutoIt software. How can I use a DLL in my program without installing the software?

Wolf
  • 9,679
  • 7
  • 62
  • 108
  • What do you mean "It only allows me when...", what does it do when it's not installed? – Tamir Vered Sep 24 '15 at 09:49
  • Maybe some of dependencies of dll or even dll, that you want to use need registration via regsvr – Spawn Sep 24 '15 at 09:49
  • @Spawn I believe regsvr can be called by code – netaholic Sep 24 '15 at 09:53
  • Who knows what "AutoIt" does when it's installed - it could put files and registry settings in all sorts of places that are required for any functionality to work. Some DLLs are self contained and you can just use, others have large dependency chains behind them. What sort of issue are you seeing when you attempt to use it without it being properly installed? – James Thorpe Sep 24 '15 at 09:57
  • What's the DLL?A COM DLL? An assembly .DLL? Are you _allowed_ to use the DLL without installing the software? – rbm Sep 24 '15 at 09:59
  • @netaholic, or by installer of user app – Spawn Sep 24 '15 at 10:03
  • @Spawn or call the installer of the app by code... – freedomn-m Sep 24 '15 at 10:12
  • Quick google: "AutoIt v3 is a freeware "... tl;dr - it's freeware, install it already! Bit further: "a open-source" [sic] - it's open-source, download the source (if you can find it) and add it to your solution in visual studio. AutoIt installer apparently installs tons of scripts, so just using the DLLs would not include these scripts. – freedomn-m Sep 24 '15 at 10:16

1 Answers1

1

Strange that this question isn't answered. AutoIt is both a stand-alone automation application AND an assembly which can be imported into a VS project.

I'm using AutoIt in VS and C#, since the site I'm testing with Selenium doesn't have straight-forward http authentication. With AutoIt I'm able to access the login prompt in the browser.

Download the zip file containing the following files:

AutoItX3.Assembly.dll
AutoItX3.dll
AutoItX3_x64.dll

(I'm not using the _x64 dll currently, but I've included it anyway.)

In the VS Project

  • Add an assembly reference to AutoItX3.Assembly.dll
  • Add an existing item: AutoItX3.dll (or AutoItX3_x64.dll if you want to use that) (SET IT TO "Copy if newer" in the properties)
  • Add the following using directive in the class: using AutoIt;

In my example, I'm accessing the login prompt with this code:

AutoIt.AutoItX.WinActivate("Authentication Required");
AutoIt.AutoItX.Send("User");
AutoIt.AutoItX.Send("{TAB}");
AutoIt.AutoItX.Send("Password");
AutoIt.AutoItX.Send("{ENTER}");