Anand_Rao Posted October 29, 2020 Share Posted October 29, 2020 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 More sharing options...
Musashi Posted October 29, 2020 Share Posted October 29, 2020 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) "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 More sharing options...
Anand_Rao Posted October 29, 2020 Author Share Posted October 29, 2020 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 More sharing options...
Confuzzled Posted October 30, 2020 Share Posted October 30, 2020 (edited) 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 October 30, 2020 by Confuzzled Link to comment Share on other sites More sharing options...
orbs Posted November 2, 2020 Share Posted November 2, 2020 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 More sharing options...
GokAy Posted November 3, 2020 Share Posted November 3, 2020 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. Link to comment Share on other sites More sharing options...
Confuzzled Posted November 3, 2020 Share Posted November 3, 2020 FileInstall does that as part of usual functionality. Why introduce yet more variables and code when you can use an inbuilt module? 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