Jump to content

Running the Compiler


Recommended Posts

I'm making my own small script editor and this line supposedly isn't the correct syntax for running the compiler:

Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In <"&@TempDir&"\Script.au3> /Out <"&FileSaveDialog("AutoIt Script Editor - Compile Save Location", @ScriptDir, "Executables(*.exe)")&"> /Icon <"&FileOpenDialog("AutoIt Script Editor - Compile Icon", @ScriptDir, "Icons(*.ico)")&"> /Comp 4")

For the "@Tempdir&"\Script.au3" is just "Beep(1000, 100)".

I have tried a bunch of variations of the script line but nothing was successful. Anyways, does this line work for anybody else?

Thanks.

Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Works fine if you point to an icon in the script directory. I think the working directory may be the problem. If you tell it to use "\icon iconname.ico" and iconname.ico is in the script directory it works fine. If you point it to the full path "C:\whatever\folder\icon.ico" it will not work.

Link to comment
Share on other sites

Sorry for not responding faster, I had to leave too. :)

I'll try this though:

Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In "&@TempDir&"\Script.au3 /Out "&FileSaveDialog("AutoIt Script Editor - Compile Save Location", @ScriptDir, "Executables(*.exe)"))

Link to comment
Share on other sites

So this should work fine as a workaround since I cannot figure out why it doesn't like to use fullpaths for the icon:

$icopath = FileOpenDialog("AutoIt Script Editor - Compile Icon", "C:\Program Files\AutoIt3\Icons", "Icons(*.ico)")
$splitpath = StringSplit( $icopath, "\" )
If Not FileExists( @ScriptDir & "\" & $splitpath[UBound($splitpath) - 1] ) Then
    FileCopy( $icopath, @ScriptDir & "\" & $splitpath[UBound($splitpath) - 1] )
EndIf
Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In "&@TempDir&"\Script.au3 /Out "&FileSaveDialog("AutoIt Script Editor - Compile Save Location", @ScriptDir, "Executables(*.exe)") & " /icon " & $splitpath[UBound($splitpath) - 1] & " /Comp 4")
Link to comment
Share on other sites

Thats a workaround I tried:

FileWrite(@TempDir&"\Script.au3", GUICtrlRead($Edit))
$IconPath = FileOpenDialog("AutoIt Script Editor - Compile Icon", @ScriptDir, "Icons(*.ico)")
FileCopy($IconPath, @ScriptDir&"\Icon.ico")
$Icon = @ScriptDir&"\Icon.ico"
Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In "&@TempDir&"\Script.au3 /Out "&FileSaveDialog("AutoIt Script Editor - Compile Save Location", @ScriptDir, "Executables(*.exe)")&" /Icon "&$Icon&" /Comp 4")   
FileDelete(@TempDir&"\Script.au3")

But it doesn't work. It just gives me a message of the command line parameters.

Link to comment
Share on other sites

Make sure this workaround is copy and pasted exactly as is. It does not return any compiler error for me and compiled my script just fine with the correct icon

EDIT: Version 3.2.10.0

EDIT2: Change 'Run(' to 'MsgBox(0, "test", ' so that we can see how the aut2exe commands are displayed as we pass them to the compiler

Edited by danwilli
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...