Jump to content
LFCavalcanti

Compiling scripts from console with AutoIt3Wrapper

Recommended Posts

LFCavalcanti

Hi!

Backstory to understand my need:

I'm building something similar to what Chunk VNC was, using the Single Click function from UltraVNC to provide remote support.

My "little monster" is actually working, but the "solution" will have 3 modules:

  • SUPPORT: Users will open or install so IT Pros can access their system.
  • VIEWER: IT Pros use to connect to User systems and perform their maintenance
  • GENERATOR: The IT Pro uses to define the configuration for both the SUPPORT and VIEWER apps, like language files for text, SERVER address and ports, Company name, etc.

I've attached a screenshot of the SUPPORT app that is done.

Before anyone points the finger, no I'm not planning on just copying the AutoIt3 files to my project folder and distribute them, I intend to get the IT Pro who will use the GENERATOR to install SciTE and AutoIt3 then the GENERATOR will use them to compile the other two apps.

The thing is, I need this to be simple, I thought about the GENERATOR having a single screen where the IT Pro can fill in all the information, select the language file and so on, then the GENERATOR compiles both "au3" sources for the SUPPORT and VIEWER.

I'm using the ResourceEx UDF from Guiness and MetroUI UDF from BBs19. I even made some changes to the MEtroUI, that I shared here.

This project will be uploaded to my Github account as soon I get this GENERATOR working, so people can actually use it.

The problem:

As explained, I need to compile the AU3 source files and perform an Resource Update. SciTE does that for me, right, but I just find sloppy making the GENERATOR open the script on the installed SciTE, clicking in the menus, waiting the process to end and then exit.

When I hit the Compile or Build on SciTE, it generates this output:
 

Spoiler

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\SOURCE\client\IntermixClient.au3"
+>17:34:35 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00010416  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0416)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Fernando\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Fernando\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\SOURCE\client\IntermixClient.au3
+>17:34:35 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\SOURCE\client\IntermixClient.au3" /out "C:\Users\Fernando\AppData\Local\AutoIt v3\Aut2exe\~AU8787.tmp.exe" /nopack /icon "img\icon.ico" /comp 2
+>17:34:37 Aut2exe.exe ended.C:\Users\Fernando\AppData\Local\AutoIt v3\Aut2exe\~AU8787.tmp.exe. rc:0
>17:34:37 Performing the Program Resource Update steps:
...>Updating Program Version information.
...>Adding / Removing 14 resource(s).
>17:34:37 Program Resource updating finished successfully.
+>17:34:37 Created program:E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\COMPILADO\IntermixClient.Exe
+>17:34:38 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 3.515

I've tried emulating this using the promt with console commands:

Spoiler

AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\SOURCE\client\IntermixClient.au3"

Spoiler

aut2exe.exe  /in "E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\SOURCE\client\IntermixClient.au3" /out "E:\_ARQUIVOS\PROJETOS\PROJETO INTERMIX\VERSION\0.1.0\COMPILADO\IntermixClient.Exe" /nopack /icon "img\icon.ico" /comp 2

It returns an error saying it was not possible to perform a resource update, poiting an TMP file on the ".../AppData/Local/AutoIt3/".

As I understand, it runs the AutoIt3Wrapper, then the Wrapper should call the Aut2Exe to compile the script and then the Wrapper incorporate the resources into the compiled Script. It generates the file into a TMP one then copies to the directory defined in the Wrapper Directive.

I know this seems strange, that you think I might be trying to pack AutoIt into my project with no F*** given, no... I just want to automate the compilation process, if there's no solution using console commands, I'll need to automate the process sending keyboard and mouse commands, what will be ugly and problematic.

So... any help is a heaven's gift at this point.

GUI1.png

GUI2.png


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
Jos

Show me the total text of the CMD window when running the shown AutoIt3Wrapper command in an CMD window.

Jos

 

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LFCavalcanti

Hi Jos,

I attached the images in order, basically there's no console output, just the error I mentioned...

Note: The CMD here is running with admin privileges.

 

I tried running the first command, calling the Wrapper:

1.png.38a048ced220a697144c5f5093f76653.p

It executed but no output, also no file in the directory:
4.thumb.png.2a545b1f1733d3137e201e089481

I executed the same command again, then tried calling the Au2Exe:

2.png.426d9aaf5ee630feb248ae9a5e0f8727.p

No console output but returned this error:
3.png.3377dd199b71abbfe9250bbe5b5d5bd9.p


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
Jos

The last error is likely due to not having put the shown temp directory in the "white list" of your antivirus.

Can you try running the first command again but first go the the directory that contains your sourcefile, that is what happens in SciTE when pressing F5/F7.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LFCavalcanti
2 hours ago, Jos said:

The last error is likely due to not having put the shown temp directory in the "white list" of your antivirus.

Can you try running the first command again but first go the the directory that contains your sourcefile, that is what happens in SciTE when pressing F5/F7.

Jos

IT WORKED! THANK YOU!

I would never guess the wrapper had to be called from the source file directory.

Now... the last question, as I said, people will be required to download the full SciTEAutoIt3 package in order to use the GENERATOR in my project, using the commands like this... am I breaking any copyright or moral guideline around here?


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
Jos
1 minute ago, LFCavalcanti said:

I would never guess the wrapper had to be called from the source file directory.

I know this is what happens when ran from SciTE, so was guessing that that would be the difference, but will have a look to see why this is a dependency. 

3 minutes ago, LFCavalcanti said:

Now... the last question, as I said, people will be required to download the full SciTEAutoIt3 package in order to use the GENERATOR in my project, using the commands like this... am I breaking any copyright or moral guideline around here?

Don't see why that would be needed. Is your basic Application also a compiled AutoIt3 script? If so you could use that to run any generated sourcecode as long as you ensure all source is available in the master file. There is not much to worry about as far as licenses, just respect common courtesy and do not modify the sources. 

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos
24 minutes ago, LFCavalcanti said:

I would never guess the wrapper had to be called from the source file directory.

Just tried it like you did and it works fine when I have the AutoIt3 directory as the workingDir. Even tried it like you did with a mapped drive, so have no idea how to replicate your issue.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
LFCavalcanti
On 05/05/2016 at 3:43 PM, Jos said:

Just tried it like you did and it works fine when I have the AutoIt3 directory as the workingDir. Even tried it like you did with a mapped drive, so have no idea how to replicate your issue.

Jos

Might be because I'm using Windows 10?

I tried setting the Aut2Exe location with a directive, same problem... if you can do it without calling the Wrapper from the source directory, this is just weird.

 

On 05/05/2016 at 3:27 PM, Jos said:

Don't see why that would be needed. Is your basic Application also a compiled AutoIt3 script? If so you could use that to run any generated sourcecode as long as you ensure all source is available in the master file. There is not much to worry about as far as licenses, just respect common courtesy and do not modify the sources. 

Jos

 

I asked here about having the Aut2Exe and Wrapper together with the project files some time ago, people were not too kind on it, even when I reassured I would give the appropriate credits and copyright notes.

It would certainly make it easier for an IT Pro not versed in AutoIT to download the installer from my repo, run the GENERATOR and use the remote access tool without having to mess around with the source files. Not that I don't want to, since I'll publish it on Github, but people can do stupid things if given the chance.

The only sources I'm messing with are the UDFs, like the MetroUI, but I posted which changes I made on the UDF's thread. I think that fair... right?


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
VIP
5 minutes ago, LFCavalcanti said:

people can do stupid things if given the chance.

Let's branding and publicity, and do not fear someone will modify it.
If you do not want somebody to modify your source code,  it is best to keep your own and do not public it!
 


Regards,
 

Share this post


Link to post
Share on other sites
LFCavalcanti
1 minute ago, Trong said:

Let's branding and publicity, and do not fear someone will modify it.
If you do not want somebody to modify your source code,  it is best to keep your own and do not public it!
 

You didn't get my point...

I don't want to REQUIRE people to change source files or manually compile them to use the application. If they want to, fine...


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
VIP

My point of open source is to learn! Not just to see!
End users do not need the source code of the project, they need something that can run right away.
How I can compile C++ projects to exe, while I do not know anything about C++?

There are a few of my shallow thinking, i apologize if it is wrong or opposite views of someone.


Regards,
 

Share this post


Link to post
Share on other sites
Jos
42 minutes ago, LFCavalcanti said:

It would certainly make it easier for an IT Pro not versed in AutoIT to download the installer from my repo, run the GENERATOR and use the remote access tool without having to mess around with the source files. Not that I don't want to, since I'll publish it on Github, but people can do stupid things if given the chance.

Not sure you understood the point I was trying to make. Why compile at all? all you need is the STUB that allows for running the source directly which could be your/any compiled script as well.

@Trong , I am not sure what point you are trying to make but I have the feeling a lot is lost in translation back and forth . ;)

Jos

 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
VIP

sorry for my bad english.

I think he is trying to compile all files with a bat file!


Regards,
 

Share this post


Link to post
Share on other sites
LFCavalcanti
41 minutes ago, Trong said:

My point of open source is to learn! Not just to see!
End users do not need the source code of the project, they need something that can run right away.
How I can compile C++ projects to exe, while I do not know anything about C++?

There are a few of my shallow thinking, i apologize if it is wrong or opposite views of someone.

Yeah, that is why I'll upload all the source files to Github this weekend.

The sources will be used to generate two executables, one for an IT technician to access an User PC and the other the User will run in it his computer so the technician access it.

IF the IT person who will deploy the "solution" on his Help Desk doesn't want to mess around with the source files, I'll make an GENERATOR, to input the UltraVNC repeater information, language files for the text and so on... this GENERATOR will compile both executables and the TI pro just deploy them.

If that person wants to change the code, etc, just open the sources files and mess around with them. (Mess here is meant as learn and modify as needed).

29 minutes ago, Jos said:

Not sure you understood the point I was trying to make. Why compile at all? all you need is the STUB that allows for running the source directly which could be your/any compiled script as well.

@Trong , I am not sure what point you are trying to make but I have the feeling a lot is lost in translation back and forth . ;)

Jos

 

As I explained for @Trong, the compiled "exe" are easier to deploy for the users. The app will have both the function to run UltraVNC and establish a reverse connection to the Repeater and be installed, to solve problems with UAC restricitions.

25 minutes ago, Trong said:

sorry for my bad english.

I think he is trying to compile all files with a bat file!

I'm not an native English speaker myself, I'm from Brazil. XD

  • Like 1

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
LFCavalcanti

Hey @Jos and @Trong...

Here's the repo: https://github.com/LFCavalcanti/intermix

Still working on naming conventions and other stuff, time is a limited resource.


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
Uzzi

Hi I've this error:

Error adding file: files\vncos.dll .rc2
Target exe is not created, abandon build.rc:2

Can You help me?

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

  • Similar Content

    • Jos
      By Jos
      7/8/2018: Uploaded a new SciTe4AutoIt3.exe v18.708.1148.0 installer.
      It has been over a year since the last update of the full SciTE4AutoIt3 installer whch mainly had to do with the fact that Neil was moving toward v4 of SciTE and I wanted to wait for a stable version.
      Any help with testing this version before general release is appreciated.
      Also any feedback is welcome in caseI missed something or suggestions for improvement before releasing.
      ==> SciTE4AutoIt3 v18.708.1148.0
      Enjoy,
      Jos

      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 8-7-2018 *** Merged the SciTE v 4.1.0 by Neil Hodgson with our own version of SciTE. (Jos)     This is a major change from the previous version so ensure you update all files including LUA or else you will get errors!     - SciLexer au3: Fixed issues with nested CommentBlocks not always showing the correct color.     - SciLexer au3: Change any line starting with # and no recognised keyword to be shown with the Pre-Processor in stead of default.     - Changed Shortcut for AU3INFO to Ctrl+Shift+F6.     - Moved the session restore logic for (save.session.advanced=1)into SciTE in stead of LoadSession.lua as that was clearing the recent files list of the last session       when opening a file by double cliking it. This is fixed with this change.       Default remains 0 so when a file is double clicked the last session isn't restored unless you add this to SciTEuser.properties:       "save.session.advanced=1"     - updated Tools.lua replacing [s%] with [ /t] to avoid empty lines being stripped by those functions. (Thanks Enyby) *** Updated AutoIt3Wrapper v18.708.1148.0 (Jos)     - 17.224.935.1 Added /autoit3dir to au3stripper commandline, when provided to AutoIt3Wrapper., to ensure the included files are for the correct AutoIt3 directory     - 17.224.935.2 Added directives:          #AutoIt3Wrapper_Res_CompanyName=          ;Company field          #AutoIt3Wrapper_Res_LegalTrademarks=      ;Trademark field     - 17.224.935.5 Fixed Versioning when files contain backets ->  ()     - 17.224.935.6 Added support for :          #AutoIt3Wrapper_Au3stripper_Stop_OnError=        ;(Y/N) Continue/Stop on Warnings.(Default=N)     - 17.224.935.7 added INI support for:           [Other]            Au3Stripper_Stop_OnError=n     - 17.224.935.10 Minor changes in console messages     - 17.224.935.11 Modifications from JPM:         - add #AutpIt3Wrapper_Res_Cursor_Add         - "clean" a little bit AutoIt3Wrapper.au3 *** Updated Au3Stripper v18.708.1148.0 (Jos)     - 17.224.935.1 Fixed crash when an include file contains longer record than 4096 characters.     - 17.224.935.2 Changed /rsln to replace @ScriptLineNumber in the Master script with "XXX/YYY". XXX is the master script linenumber, YYY is the Merged script linenumber.     - 17.224.935.3 Fixed issue detecting #cs #ce when a space was missing after the directive.     - 17.224.935.4 Changed Close/Open logic for Tracelog to (hopefully) avoid the hardcrash.     - 17.224.935.5 improved speed avoiding rereading include files to determine the max rec len.     - 17.224.935.6 improved speed by re-coding the check for long records.     - 17.224.935.7 Made sure the returncode is the highest from all iterations in stead of the last iteration.     - 17.224.935.8 fix for reported bug: https://www.autoitscript.com/trac/autoit/ticket/3623#comment:4     - 17.224.935.9 added support for #autoit3wrapper_autoit3dir     - 17.224.935.10 Fixed support for #autoit3wrapper_autoit3dir when followed by linecomment                     Stop processing when include file isn't found.     - 18.624.1847.1 strip the leading and trailing double quotes from the autoit3dir directive to avoid an error when they are specified.     - 18.624.1847.2 Fixed Hardcrash in the Include logic     - 18.624.1847.3 Fixed Hardcrash in Func stripping logic by enlarging the base table size     - 18.702.1556.1 Fixed regression bug with the Translate option.     - 18.703.1808.2 Fixed regression bug with the Stripping FUNC logic for the first found FUNC. *** Updated SciTEConfig v18.708.1148.0 (Jos)     - 17.224.935.1 No updates *** Updated Tidy v18.708.1148.0 (Jos)     - 17.224.935.1 Added option  to copy comments from #CS to #CE. Default is to copy the comments.                    Added Tidy Parameters:  /Skip_CE_Comment or /scec will skip this copy action                    Added INI option:                      * * *  Add comment to #CE/#CommentEnd and make it the same as the #CS/CommentStart Comments.                      ce_comment=1     - 17.224.935.2 Fix issue with Copy comments on comment start - end     - 17.224.935.4 Fix another issue with Copy comments on comment start - end -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check the online documentation for an overview of all extra's you get with this installer.
    • sumanth1980
      By sumanth1980
      Here i am wrote a simple lines to install basic applications but when i clicked on one application/program to install it was working fine but when i cancel the program in the middle to install another program it was not working. I am not an expert in this but i want a solution for this ... Can any one help me on this....
      ORG-1.au3
    • red0fireus
      By red0fireus
      When I run my script without compiling it, it works just fine.
      When I compile the script and run it this part of the script doesn't run properly. Here's my terrible explanation of what's supposed to happen but doesn't once its compiled.
      I have part of the script call the Function _Update well once it calls _Update it runs ShellExecute("C:\Test\test\run\Email.au3") immediately and doesn't wait 5 minutes. 
      $iMinutes = 5 $hTimer = TimerInit() Func _Update() AdlibRegister(_Update, 2000) If TimerDiff($hTimer) > ($iMinutes * 60000) And ProcessExists($recheck) Then ;ConsoleWrite("5 minutes have passed!" & @CRLF) ShellExecute("C:\Test\test\run\Email.au3") AdlibUnRegister(_Update) $hTimer = TimerInit() ElseIf Not ProcessExists($recheck) Then AdlibUnRegister(_Update) EndIf EndFunc Anyone have any suggestions on what I can do to fix this?
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I was trying to insert function header to the functions of my script, but, in the SciTE console, this appears:
      Function or struct definition not found, unable to insert header. @Jos Any suggestion?
      Thanks in advance.

      Best Regards.
×