Posts: 117
Threads: 5
Joined: Nov 2015
I have 2 questions:
1/ How do you build the script into an executable?
2/ How do you run the script from the command line?
Posts: 12,074
Threads: 141
Joined: Dec 2002
12-13-2019, 05:20 PM
(This post was last modified: 12-13-2019, 05:28 PM by Gintaras.)
1. In Properties select role exeProgram. Optionally change outputPath. Then compile or run.
2.
https://www.quickmacros.com/au/help/edit...0line.html
Posts: 117
Threads: 5
Joined: Nov 2015
Thanks Gintaras.
Is the compiled files located in "%documents%/Au/Main/.compiled" folder? I saw a lot of numbered files in there but none of them ended with .EXE extension. How could I execute them?
Posts: 12,074
Threads: 141
Joined: Dec 2002
"%documents%/Au/Main/bin", but you can change it in Properties / outputPath.
Posts: 12,074
Threads: 141
Joined: Dec 2002
QM3 creates several files.
ScriptX.dll - contains compiled script code.
ScriptX.exe - unmanaged .NET Core app host program that loads the dll.
Au.dll - automation library.
64\AuCpp.dll and 32\AuCpp.dll - unmanaged dlls used by Au.dll in 64-bit and 32-bit processes.
Currently cannot create single .exe file.
Posts: 117
Threads: 5
Joined: Nov 2015
Somehow I don't see the "bin" folder under "/Au/Main" directory. The only folders I've seen under /Au/Main folder are:
.compiled
.temp
files
and files.xml and state.db files.
My current windows OS is Windows Server 2019 Essentials.
Posts: 12,074
Threads: 141
Joined: Dec 2002
What is the first line of the script? Should be like
/*/ role exeProgram; outputPath %AFolders.Workspace%\bin; /*/ //.
Let the script show a dialog. Then in Windows Task Manager right click the process and select "Open file location". The process is named like the script.
Posts: 117
Threads: 5
Joined: Nov 2015
Thanks Gintaras.
When I put the line you've mentioned as the first line in my script then I could see the "bin" folder now.
I don't know why when I click on the "New Script" button on the menu bar, the new script does not have that line at all.
Posts: 12,074
Threads: 141
Joined: Dec 2002
That line is added by the Properties dialog when in it you select role exeProgram. Also you can change outputPath. OK, Compile, and you have ScriptX.exe in outputPath folder.
Posts: 117
Threads: 5
Joined: Nov 2015
Thanks Gintaras, I could set the outputPath like you said and in my script I could see that line was added in.
But that option is not saved at all, I have to set the outputPath every time I create a new script. Is there a way to set it permanently?
Posts: 12,074
Threads: 141
Joined: Dec 2002
Posts: 117
Threads: 5
Joined: Nov 2015
I don't know, somehow it does not remember the new option for outputPath.
When I click "New Script", that option is blank again.
Posts: 12,074
Threads: 141
Joined: Dec 2002
Default outputPath value currently cannot be changed. But do you really want to create exe file for each script? Why not use the default role miniProgram?
Posts: 117
Threads: 5
Joined: Nov 2015
Actually I usually use the default role in miniProgram but when I want to create an EXE, I have to manually set the outputPath to the "bin" folder, 'cause it always blank there.