LFCavalcanti

Compiling scripts from console with AutoIt3Wrapper

17 posts in this topic

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



#2 ·  Posted (edited)

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

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

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
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
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
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
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
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

#10 ·  Posted

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

#11 ·  Posted

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

#12 ·  Posted

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

#13 ·  Posted

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

#15 ·  Posted

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

1 person likes this

--

"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

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

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

    • wakillon
      By wakillon
      SciTE Hopper : Jump to Any line by one click and many other helpfull functions !


      As Ashalshaikh suggested me after leaving me the task to continue >SciTE Hopper, i open a new Topic about it.
      It will be more easy for futures updates.

      Many helpfull functions in contextual menu.
      SciTE Hopper is now multipurpose.
      • Color Catcher added
      • BinaryToAu3Kompressor added
      • TinyAu3Search replaced by StringFinder
      • RegJumper added
      • Edit With SciTE added (available in Options)
      • SpecialCharactersViewer added (available in Tray menu)
      New Contextual Menu :

      For a right Click on a function :

      • Copy function name
      • Insert a function header
      • Cut function
      • Copy function
      • Delete function
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments

      For entire script :

      • Create a functions List
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments
      • ( Open in SciTE a ) Duplicate of current Script in Temp Dir
      • ( Open in SciTE a ) Duplicate of current Script in Same Dir
      • Explore Parent Script Folder
      • Copy Script name
      • Copy Script path
      • Find Unused Functions
      • Find Unused Variables
      • Set all functions in alphabetic order.( func headers and regions ( in fact, all lines between functions ) are not supported.)

      SciTE Editor New Contextual Menu if SciTE Hopper is added ( in Options ) to SciTE Editor :
      when you made a selection in SciTE Editor you can :

      • Open a Reg Key in Regedit using RegJumper
      • Open a Url in your default Browser
      • Search on google in your default Browser
      • Search on AutoIt Website in your default Browser
      Now Can be added to windows start (minimized)
      Options are available by Tray Menu.
      A double click on tray icon will open clipboard content to SciTE Editor ( Handy when you have copied some code from your browser )

      How to proceed for add SciTE Hopper to SciTE Editor :
      Run Scite Editor, run Scite Hopper ( compiled! ) go to Options and select Add/Remove to SciTE Tab. then click on Add button and it's done !
      Right click on SciTE Editor and choose SciTE Hopper in Contextual Menu for run it when you need it !
      Update of 07 Dec 2017
      TinyAu3Search is replaced by StringFinder

      Previous downloads : 1287
      Script and compiled version are available in the download section
       
      Thanks to Ashalshaikh, Melba23, Th3 MMA, Alzri2, taitel, Manadar, taz742, Yashield, Authenticity, Xenobiologist for their help
      and asdf8 for his >Includes Helper and azjio for his >FileSearch.

      Hope it help you and happy Scripting !

       
    • wakillon
      By wakillon
      For more details go to the Topic
    • JaredStroeb
      By JaredStroeb
      I need to open an application and send it keys in Session 0.  I have exe's working locally, I can see the application open in session 0 through interactive services, but my send commands do not go to the application.  The following article running-autoit-session-0, directs me to use ControlSend() however my application has no controls that can be identified by AutoIt v3 Window Info.  Get All Windows Controls also returned nothing for the application's handle.  
      What are my options?  
      Can this be done with AutoIt?
      Is there a different "relatively simple" library/tool to use? (I am familiar with C# if there is a viable library there )

       
    • Skysnake
      By Skysnake
      Scite comes up occasional, almost incidentally, in some support topics.  I have not found a "Scite" topic in the forums, so this is where I will start.  I have recently been using Scite intensively, specifically with a large project and I have certain issues.  I know that Scite is not an AutoIt product, but it is so closely integrated to the core release that it makes sense to raise issues and request support here.  If this is not the right please refer me to the right forum.
      Thx
       
      Skysnake
    • TrashBoat
      By TrashBoat
      I've messed around in scite theme settings and it left this blue bar , how can i get rid of it?
      Image (imgur)