Jump to content

Compile au3 scripts using a pipline


Go to solution Solved by SOLVE-SMART,

Recommended Posts

Posted

Hi
I want to compile the au3 scripts using a pipeline into an exe. (The exe I am planning to sign with a certificate afterwards)
I am doing this on Azure DevOps using a windows agent.

$autoitDir = Join-Path -Path "$(Agent.BuildDirectory)" -ChildPath "autoit-portable\latest\install\Aut2exe"
$autoitExe = Join-Path -Path $autoitDir -ChildPath "Aut2Exe.exe"

& "$autoitExe" /in "$srcDir\MyApplication.au3" `
                /out "$outDir\MyApplication.exe"

When I execute that on a computer when logged in to it, this works, the executable is created.

But when I do the same on the agent, it does not work. Unfortunately, even though there is the possibility to run Aut2Exe.exe directly from a command line, it still relies on a GUI being available. For instance to show error messages, they are not returned to the console.

Is there a way to use AutoIt in a pipeline?
Also, is the source code somewhere available so I could have a look by myself? ๐Ÿ™‚
I saw there are some repos linked, but none of them made the impression to me that it's the AutoIt source itself...

Thanks a lot!

ย 

ย 

  • Solution
Posted (edited)

Hi @avsย ,

I try to summarize: you compile a AutoIt script via Azure DevOps CI pipeline.
These means one or two of the pipeline yaml steps contain your Powershell actions, am I right? You could run this locally (or on a maschine which is not hosted on Azure) and in case you run the pipeline on the Windows Agents maschine, it fails. Right?

The part with the necessary GUI is a bit strange for my understanding. I believe this shouldn't be matter in any case. What ever, I suggest to have a look on GitHub workflows that compiling (build) the executable. Because this should work very similar to your variant on Azure DevOps. I cannot reproduce it, because I rather not use AutoIt much often anymore nor I can access Azure DevOps since I switched to GitLab (and/or GitHub), but I know these should be feasable without any interactive GUI present.

Here are two examples that could be helpful. The repositories are fromย @WildByDesignย who did a good job regarding the yaml files as far as I can see.

@avs I would also be interested to know why you want to do this in that specific way? Maybe you describe your goal even more, than the answers will hopefully also more precise ๐Ÿค .

Best regards
Sven

Edited by SOLVE-SMART

==> AutoIt related: ๐Ÿ”—ย Organization AutoIt Community,ย ๐Ÿ”— GitHub, ๐Ÿ”— Discord Server, ๐Ÿ”—ย Cheat Sheet,ย ๐Ÿ”—ย autoit-webdriver-boilerplate

Spoiler

๐ŸŒย Au3Forums

๐ŸŽฒ AutoIt (en) Cheat Sheet

๐Ÿ“Š AutoIt limits/defaults

๐Ÿ’Ž Code Katas: [...] (comming soon)

๐ŸŽญ Collection of GitHub users with AutoIt projects

๐Ÿžย False-Positives

๐Ÿ”ฎย Me on GitHub

๐Ÿ’ฌย Opinion about new forum sub category

๐Ÿ“‘ย UDF wiki list

โœ‚ย VSCode-AutoItSnippets

๐Ÿ“‘ย WebDriver FAQs

๐Ÿ‘จโ€๐Ÿซย WebDriver Tutorial (coming soon)

Posted

Exactly.
I want to compile an AutoItscript to get an application which I will deploy to other servers subsequently. We need to rely on that process because we're using a software which provides kind of extension possibilities using AutoIt. They provide some base scripts which we import and extend with our own code.

We started doing more complex things in our scripts and now the executable start being blocked by Defender (which is not bad). But since we still want our stuff to work, we want to create this pipeline to compile the scripts and afterwards sign the executables so they can be whitelisted and will not be blocked anymore.

I'll look into the repo you provided, thanks a lot, also for the quick response. I'll post an update here when I found a solution.

  • 1 month later...
Posted (edited)

I was able to get it working by replicating what Sven posted above.
I can now compile the scripts, sign the executable using a code signing certificate, package the binaries using choco, push it to a repo, everything in a pipeline.
After that I can deploy the executable(s) to the target servers using a different pipeline.

Very nice, working well now.ย 

Reason for doing that: Automation, and the fact that some security tools detected that the exes were built using AutoIt and therefore blocked them from execution. With this new process we can whitelist them because they are signed by us.

Danke fรผr die Hilfe!

Edited by avs
Posted

You're welcome @avs.ย Good to know that you could achieve your goal - nice.

Could you share your final yaml by any chance? I would love to see how you did it. Of course I have a idea on it, but a real example would be helpful.

Thanks in advanced @avsย โœŒ๏ธ .

Best regards, Sven.

==> AutoIt related: ๐Ÿ”—ย Organization AutoIt Community,ย ๐Ÿ”— GitHub, ๐Ÿ”— Discord Server, ๐Ÿ”—ย Cheat Sheet,ย ๐Ÿ”—ย autoit-webdriver-boilerplate

Spoiler

๐ŸŒย Au3Forums

๐ŸŽฒ AutoIt (en) Cheat Sheet

๐Ÿ“Š AutoIt limits/defaults

๐Ÿ’Ž Code Katas: [...] (comming soon)

๐ŸŽญ Collection of GitHub users with AutoIt projects

๐Ÿžย False-Positives

๐Ÿ”ฎย Me on GitHub

๐Ÿ’ฌย Opinion about new forum sub category

๐Ÿ“‘ย UDF wiki list

โœ‚ย VSCode-AutoItSnippets

๐Ÿ“‘ย WebDriver FAQs

๐Ÿ‘จโ€๐Ÿซย WebDriver Tutorial (coming soon)

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
×
×
  • Create New...