Sign in to follow this  
Followers 0
JustinReno

Running the Compiler

42 posts in this topic

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.

Share this post


Link to post
Share on other sites



You are getting the error at the icon.

Why? I don't know.

But that is where the issue is.

Share this post


Link to post
Share on other sites

How do you know its the icon?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

If you remove the icon portion, the problem is gone.

If you change the icon to an icon in the script folder and do not use a full path, it compiles fine.

Share this post


Link to post
Share on other sites

It still doesn't work even if the icon is in the script directory.

Share this post


Link to post
Share on other sites

This works right?

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

You need to not include ">" and "<"

Share this post


Link to post
Share on other sites

Sorry for the delay in response, I left work, got home, and got back on the forums lol.

Share this post


Link to post
Share on other sites

I still cannot get the icon to work correctly without calling it like "/icon filenameinscriptdir.ico"

Share this post


Link to post
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)"))

Share this post


Link to post
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")

Share this post


Link to post
Share on other sites

It's sloppy, with no cleanup (may want to delete the icon after compile if it wasn't in the scriptdir before, but leave it if it was), but it works.....

Right (working for you)?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

change

$Icon = @ScriptDir&"\Icon.ico"

to

$Icon = "Icon.ico"

Share this post


Link to post
Share on other sites

Ok, just a minute.

Share this post


Link to post
Share on other sites

What about the workaround I posted....

Didn't that work for you? It worked for me.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

No :) , it doesn't work. I'm stumped...

Edit: What version of AutoIt do you have?

Edited by JustinReno

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I copied that code exactly and it doesn't work. :)

I'm really not sure what I can do about it.

Share this post


Link to post
Share on other sites

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

Post what the msgbox returns plerase

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
Sign in to follow this  
Followers 0