JustinReno Posted January 2, 2008 Share Posted January 2, 2008 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 More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 You are getting the error at the icon. Why? I don't know. But that is where the issue is. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 How do you know its the icon? Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 It still doesn't work even if the icon is in the script directory. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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 "<" AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 Sorry for the delay in response, I left work, got home, and got back on the forums lol. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 I still cannot get the icon to work correctly without calling it like "/icon filenameinscriptdir.ico" AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 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 More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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") AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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)? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 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 More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 change $Icon = @ScriptDir&"\Icon.ico" to $Icon = "Icon.ico" AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 Ok, just a minute. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 What about the workaround I posted.... Didn't that work for you? It worked for me. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 (edited) No , it doesn't work. I'm stumped... Edit: What version of AutoIt do you have? Edited January 3, 2008 by JustinReno Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 (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 iconEDIT: Version 3.2.10.0EDIT2: 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 January 3, 2008 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 I copied that code exactly and it doesn't work. I'm really not sure what I can do about it. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 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 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now