Jump to content
Anand_Rao

How to build Auto IT using Maven or dotnet

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?

Share this post


Link to post
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."

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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 :-)

 

Share this post


Link to post
Share on other sites

Hey Anand_Rao,

I just posted about using 7z for a similar task, maybe you can use the approach. Check it out if you like.

 

Share this post


Link to post
Share on other sites

FileInstall does that as part of usual functionality. Why introduce yet more variables and code when you can use an inbuilt module?

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...