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!
 


“The world won’t care about your self-esteem. The world will expect you to accomplish something Before you feel good about yourself.”

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.


“The world won’t care about your self-esteem. The world will expect you to accomplish something Before you feel good about yourself.”

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!


“The world won’t care about your self-esteem. The world will expect you to accomplish something Before you feel good about yourself.”

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

    • tcox8
      By tcox8
      Hello all,
      Long story short: I am updating a program I created many years ago for our Help Desk. I haven't used AutoIt in a while so I downloaded it again. Of course there were several script breaking changes so I opted to download an older version of AutoIt (3.3.8.1) which worked. However when downloading the full Scite it produces the attached error when trying to compile my script. I need the full version of Scite to compile with options. Is it possible to download older versions of Scite or is there an easy fix for this issue? I have attempted reinstalling, uninstalling/rebooting/reinstalling to no avail.
      Thanks!

    • JohnNash
      By JohnNash
      Weird story. Been using Autoit for more than a year now. But recently moved to a new machine, so did a fresh install, and suddenly I saw menus I never saw before in the editor.
      For example, I Always used to have: Tools>Compile and then it would compile my au3 code. Now, the tools menu has a lot of options but after pressing Compile it goes to a whole new screen specifically for au3 code to select more options, also it debugs my code, which prevents compiling if badly coded.
      Of course this is fine, but I would really like to recompile some old crappy code I wrote, regardless of the mistakes that are still in there, also I am really used to the old setup I had,
      so kind of not done, but how do i get this 'bad'  configuration back? Does it have to do with the au3.properties file? What should I do with it....
      Thanks
       
    • Anas
      By Anas
      Hi,
      After I updated SciTE to v3.6.6, whenever I write a fold-able line (e.g. Do, For, While) SciTE will unfold all the code below it by it self.
      Before writing "While" at the beginning of the script:

       
      after writing While:

       
      Is this normal? if yes, can I stop it?
    • mLipok
      By mLipok
      In SciTE when I press CTRL+SHIFT+W then there is inserted a scpecial sign "ETB" 
      What it is ?

      I want also to ask whether this feature is used / useful ?
      I ask because I want to change the keyboard shortcut (in my own config)
    • Anas
      By Anas
      Hi,
      Is it possible to make Scite fold functions within regions?