Jump to content

How to build Auto IT using Maven or dotnet


Anand_Rao
 Share

Recommended Posts

I have a bunch of AutoIT scripts that are saved as .au3 files

Now I need to compile them using Aut2exe tool to generate EXE files

These EXE files will then be packaged into a zip and then this zip archive will be transferred onto my actual windows servers.

Is there a way I can build this using Maven or some other popular build tool?

Link to comment
Share on other sites

Of course it depends on the complexity of your project, but you could probably build such a tool with AutoIt itself.

- Create a list of all .au3 scripts with complete paths as e.g. .csv or .ini file.

- Based on this list, you compile the .exe's and put them into a .zip , using 7-Zip or the Zip functionality that is implemented in Windows.

(maybe there is already an AutoIt tool for this)

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

I could do it simply enough using a .bat or powershell. However, I need to be able to accomplish this using a more "standard" build tool that our enterprise CICD pipeline recognizes. If I can do this from one of those tools. I'm guessing I'll need to compile only in windows. So I guess i am looking at a .net project? If we can somehow achieve this within .net

Link to comment
Share on other sites

My head hurts. You want to use some third party application to surreptitiously drop your AutoIT code in place and execute it? You still need to get the runtime part out there somehow. Maybe put your business plan and justification to management to get permission rather than be sneaky about it.

I've seen (and made myself) some very convoluted batch files that can call and pass values to variables, make decisions and do handstands. Try documenting your code however and !!!

Consider the FileInstall function to bundle up all your utilities into the one file and have control over who does what and where. You only have to send out one file. You can even get it to parse the command line when called from a batch file or another program to work out which portion to expand and run.

Use an unique naming convention for your FileInstall files so there is little possibility of them overwriting other files that may already be present.

Pipe your output to console in case there are any popups. Be aware you need write permission for the location it is deployed in or carefully choose your working folders. Administrator access may also be required. You can always test for these situations in your code and make alternative decisions without too much fuss.

During compile time, the UPX /pack functionality can be used to compress your files so you don't even need to have an unzipper at the other end. Conversely it is the UPX portion that most often triggers the malware flags on your antivirus software. Submit your compiled code to VirusTotal and see if it is flagged by the big industry players.

Hint: Delete your dropped 'FileInstall' files after you have finished running them so only the original file you deployed remains. Makes it less tempting for others to fiddle and poke around. Same for any transient generated batch files that your code might use. You deliver one file with internal payloads and control operation by passing it parameters or it makes self-aware decisions on what to do based on the environment it finds itself in. Testing for return codes everywhere is critical.

If it is a once only deploy, use the SelfDelete function to clean up after yourself. Poof! Warning, leave this SelfDelete part till last to turn on, and do not test this without a backup as you will lose your only working copy... You have been warned.

Edited by Confuzzled
Link to comment
Share on other sites

seriously now. if copying files is your goal, WHAT kind of CI/CD do you have that CAN NOT do that? do tell, so we all know what NOT to use in our environment :-)

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...