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

    • tremolux66
      By tremolux66
      I use a monospace font for editing AutoIt scripts in SciTE (currently, CourierNew 9pt). Regardless of what font size I set in the configuration, when I start SciTE to resume editing the script text is one size smaller than I specified. When I type Ctrl+<numpad-slash> the text changes to the desired size. The same is true of the output pane, and I have to reset the size for both areas every time I start SciTE.
      IIRC, I've made few other changes to the configuration (e.g., changed the search highlight color and disabled Tidy), so this behavior seems odd. About SciTE says it's version 3.6.0 (Aug. 4, 2015).
      Any idea how to fix this?
    • user4157124
      By user4157124
      As they're opinion-based to some degree; how are AutoIt's best practices decided and do suggestions get considered?
      Some suggestions :
      For...To...Step...Next -loop variable-naming like $iN ($i1, $i2, etc.) : conforms to recommended naming convention, identifies level (albeit inverted to ExitLoop and ContinueLoop's convention) and enables SciTE selection-highlighting (requires minimum of 3 characters). Minimize logic in global scope, separate data & settings from logic, use of vertical space, project organization (folder structure, resource- and include file management). Example (loop variable-naming, minimizing logic in global scope and separation of settings from logic) :
      #include <Array.au3> Global Enum $RANDOM_RETURNFLOAT, _ $RANDOM_RETURNINTEGER Global Enum $EXITCODE_NONE Global Const $g_sChar0 = '-' Global Const $g_sChar1 = '+' Global Const $g_iAmountX = 10 Global Const $g_iAmountY = $g_iAmountX Main() Func Main() Local $aArray[$g_iAmountY][$g_iAmountX] For $i1 = 0 To $g_iAmountY - 1 For $i2 = 0 To $g_iAmountX - 1 $aArray[$i1][$i2] = Random(0, 1, $RANDOM_RETURNINTEGER) ? $g_sChar1 : $g_sChar0 Next Next _ArrayDisplay($aArray) Exit $EXITCODE_NONE EndFunc Example (project organization) :
      + project_folder + bak [backup files] + bin [distributed binaries and dependencies] + inc [non-standard include files] + res [resource files (icons, file+install files, etc.)] + usr [configuration files, databases, etc.] - script.au3 - script.exe Example (use of vertical space) :
      Func _DigitalRoot($iNum) Local $sNum = '' Local $aNum While $iNum > 9 $sNum = String($iNum) $aNum = StringSplit($sNum, '') $iNum = 0 For $i1 = 1 To $aNum[0] $iNum += Int($aNum[$i1]) Next WEnd Return $iNum EndFunc
    • wimhek
      By wimhek
      LS
      Is it possible to open file(s) in scite in read only mode ?
      If so, How ?
       
      Thnx
       
    • Hoth2001
      By Hoth2001
      I installed AutoIt to my computer 3 days ago...and have invested the last 3 days learning how to use it.
      As learned in the tutorials, whenever opening I new file in Scite editor I'd immediatley save the file
      I left the Scite Editor open for the past 3 consecutive days on my laptop
       
      No problem
       
      Today I closed Autoit for the first time, restarted my computer, and opened up the Scite Editor
      Now whenever I try to save a file I am prevented from doing so because I apparently don't have permission!?  
      And whenever I try to run any of the programs I've created over the past 3 days now I keep getting annoying popup notifications before I run them
       
      Problem
       
      To go around the issue, I copied a program originally saved in the AUtoIt folder to another folder (since I was barred from saving it in it's original AutoIt location)
      NOw when I run the code the mouse coordiantes are all off
      and I still get that pesky notification whenever I try to run a program
       
      Big Problem!!!
      Anyone have any clue why I'm going through this BS?
       
      1. I checked my User settings and YES I am the administrator on this cpu
      2. I tried to de-select the "read only" attribute for the AutoIt folder (everytime after doing this successfully the folder immediately and automatically reverts back to "read only")
       
      Any help would be MOST appreciated. I've attached screen shots of the annoying bus I keep getting
       
       


    • mati
      By mati
      Hi,
      I wonder if
      AutoIt3Wrapper_run_debug_mode = Y can include run information about functions which are called within the main code. So far I noticed in the console that the function itself is called but no specific run information from  inside the function is provided. Is there a chance to show the entire debug log including functions in the console?
      I furthermore noticed a stop of information when a loop is entered. What could be the reason for that?
       
      Thanks for help.