olmanRvr

run compiler from .au3 script

4 posts in this topic

Hello Everybody,

I have a .au3 script.I'm trying to compile this script(compinfo2.au3) by the following code(2 different scripts).Running these shows no error but the .au3 file is not compiled.Please someone help me.

;SCRIPT1

Local $LocationAut2Exe = @ProgramFilesDir &'\AutoIt3\Aut2Exe\Aut2Exe.exe'

Run(' "C:\Users\pradeep\Desktop\compInfo2.au3' & $LocationAut2Exe & 'C:\Users\pradeep\Desktop\compInfo2.exe "?')

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

;SCRIPT2

ShellExecute ( @ScriptDir & '\Aut2Exe\Aut2exe.exe', ' /in "' & @Scriptdir & '\compInfo2.au3" /comp 4' )

 

Share this post


Link to post
Share on other sites



What should script 1 do as that doesn't make much sense?

Script2: Is the compiler really located as subdirectory of the scriptdir?

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

#3 ·  Posted (edited)

;SCRIPT1
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

Run(@AutoItExe & " " & $sScript) ;Runs compInfo2.au3(not compiled) and script compInfo2.au3 will compile the script

 

;SCRIPT2 = @DesktopDir & '\compInfo2.au3'
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

If Not @Compiled Then
    Run($sPathAut2Exe & ' /IN "' & $sScript & '" /COMP 4')
Else
    MsgBox(4096, "Ops", "I'm already compiled!")
EndIf

 

Edited by ThioFoX

Share this post


Link to post
Share on other sites

Hi,

Thanks for your reply.I have this script compInfo2.au3 om the desktop, which I want to compile programatically.

The compiler(Auto2Exe.exe) is at ---->Program Files\Autoit3\Auto2Exe\Auto2Exe.exe.

Script1 is just running compInfo2.au3 and outputs the results,but not compiling it.

Script2 as shown below(of TheoFox) is working perfectly.

;SCRIPT2 = @DesktopDir & '\compInfo2.au3'
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

If Not @Compiled Then
    Run($sPathAut2Exe & ' /IN "' & $sScript & '" /COMP 4')
Else
    MsgBox(4096, "Ops", "I'm already compiled!")
EndIf

So issue may be considered resolved.

Thanks a lot TheoFox & Jos for all the help.

cheers

olmar

 

 

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