JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 (edited) It won't let me copy it so I have to type it:C:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe /In C:\Docume~1\Jar\Locals~1\Temp\Script.au3 /Out C:\Documents and settings\Jar\Desktop\AutoIt Script Editor\Beep.exe /Icon Icon.ico /Comp 4 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 And Icon.ico is in the currently running scriptdir right? not the scriptdir of the script to be created right? Also look at this and let me know the results: If Not FileExists( "C:\Script.au3" ) Then FileWrite( "C:\Script.au3", 'MsgBox(0,"Test","It Worked")') FileCopy( @ProgramFilesDir&"\AutoIt3\Icons\filetype3.ico", @ScriptDir&"\testico.ico" ) Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In C:\Script.au3 /Out C:\saveme.exe /icon testico.ico") It should create script.au3 on C:\ and convert to saveme.exe also on C:\ AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 BRB, 5 minutes AutoIt3 Online Help Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 Wow, thanks, that works well, I'll convert my script to that structure, thanks! Let me post back. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 (edited) If that worked for you, then the workaround I posted back here should work too.Hmmm, let me know what works for you. 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 Ok, I'm completely sorry, I had to go and eat dinner. Anyways, here is my code that doesn't work... I tried to follow your structure of that script... FileCopy( @ProgramFilesDir&"\AutoIt3\Icons\filetype3.ico", @ScriptDir&"\testico.ico" ) Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In C:\Script.au3 /Out C:\saveme.exe /icon testico.ico") $Path = FileSelectFolder("AutoIt Script Editor - Select Save Directory", @HomePath) $FileName = InputBox("AutoIt Script Editor - Type File Name", "Please type in your wanted file name:") $Icon = FileOpenDialog("AutoIt Script Editor - Choose Icon", @HomeDrive, "Icons(*.ico)") $EXEPath = $Path & "\" & $FileName FileWrite($Path, GUICtrlRead($Edit)) FileCopy($Icon, @ScriptDir&"\Icon.ico") Run(@ProgramFilesDir&"\AutoIt3\Aut2Exe\Aut2exe.exe /In "&$Path&$FileName&" /Out "&$EXEPath&" /Icon "&$Icon&"") Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 (edited) Okay, I took another look at this and came up with a function I think can work for you. expandcollapse popup#region Test Code $return = Aut2ExeThisFile('MsgBox(0,"test","It Worked")') If Not @error Then MsgBox(0, "Success", $return) Else If @error = 1 Then MsgBox(0, "Error", "The Cancel button was pushed.") ElseIf @error = 2 Then MsgBox(0, "Error", "The Timeout time was reached.") ElseIf @error = 3 Then MsgBox(0, "Error", "The InputBox failed to open. This is usually caused by bad arguments.") ElseIf @error = 4 Then MsgBox(0, "Error", "User canceled or closed Folder Selection window.") EndIf EndIf #endregion ;~ Aut2ExeThisFile(GUICtrlRead($Edit)) ; For You To Use Func Aut2ExeThisFile($AutoitCode) $Path = FileSelectFolder("AutoIt Script Editor - Select Save Directory", @HomePath) If @error Or $Path = "" Then SetError(4) Return @error EndIf $FileName = InputBox("AutoIt Script Editor - Type File Name", "Please type in your wanted file name:") $FileName = StringReplace($FileName, " ", "_") ; no spaces allowed - MAY NEED TO ADD OTHER ILLEGAL CHARACTER CHECKS HERE !!!!! If @error Then If @error = 1 Then SetError(1) Return @error EndIf If @error = 2 Then SetError(2) Return @error EndIf If @error = 3 Then SetError(3) Return @error EndIf EndIf $EXEPath = $Path & $FileName FileWrite($Path & $FileName & ".au3", $AutoitCode) $icon = FileOpenDialog("AutoIt Script Editor - Compile Icon", "C:\Program Files\AutoIt3\Icons", "Icons(*.ico)", 1) $splitpath = StringSplit($icon, "\") If Not FileExists(@ScriptDir & "\" & $splitpath[UBound($splitpath) - 1]) Then FileCopy($icon, @ScriptDir & "\" & $splitpath[UBound($splitpath) - 1]) EndIf Run(@ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe /In " & $Path & $FileName & ".au3" & " /Out " & $EXEPath & ".exe" & " /Icon " & $splitpath[UBound($splitpath) - 1]) Return $FileName & ".au3 was compiled to:" & @CRLF & $EXEPath & ".exe" & @CRLF & "Icon Used: " & $splitpath[UBound($splitpath) - 1] EndFunc ;==>Aut2ExeThisFile 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 Thanks, I'll try it out and report back. Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 OHHHHH, at first it didn't work again.But I examined the Success message it gave me and this is what it read:MsgTest.au3 was compiled to:C:\Documents and Settings\Jar\DesktopMsgTest.exeIcon Used: filetype2.ico Link to comment Share on other sites More sharing options...
JustinReno Posted January 3, 2008 Author Share Posted January 3, 2008 Ok, well I fixed the path problem:$EXEPath = $Path & $FileNameTo this:$EXEPath = $Path & "\" & $FileNameBut, after I reran it, it still gave me a msgbox telling me the command line usage of Aut2exe.exe, even though the script said it was a success. This isn't a big priority for me right now, but you can still work on it if you like.Just ask me if you want the full source to this small (98 line) editor. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 Please post full source, shouldn't be a problem to implement. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Valik Posted January 3, 2008 Share Posted January 3, 2008 Honestly, if you don't know the basics of paths (particularly those with spaces), give up now and go to work on something a little more basic. That goes for both of you, people with 1500+ and 800+ posts have been on the forum long enough by now to spot simple errors like not quoting paths. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 LOL, thanks for the ass comment Valik, but I have already posted multiple working scripts for this. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 Honestly, if you don't know the basics of paths (particularly those with spaces), give up now and go to work on something a little more basic. That goes for both of you, people with 1500+ and 800+ posts have been on the forum long enough by now to spot simple errors like not quoting paths.I think... in an asshole way... Valik is trying to say, quotes paths that have spaces in them.I'm glad I come here everyday to try and help, just for this.Fuck that! AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Valik Posted January 3, 2008 Share Posted January 3, 2008 If you call scripts that don't accept icons with spaces in the name/path as "working" and don't understand why that works until somebody points it out to you, then I guess you did post "working" scripts. Link to comment Share on other sites More sharing options...
DW1 Posted January 3, 2008 Share Posted January 3, 2008 I used the workaround of replacing spaces with "_" underscores. I didn't think of the quotes, for whatever reason. Bonehead move on my part. I still don't understand why you have to come in and post like an asshole. I appreciated the knowledge you had to share, and I thank you for it. Why did you have to be a fucking dick about it though? Made you feel good? Fuck you dick! AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Valik Posted January 3, 2008 Share Posted January 3, 2008 I still don't understand why you have to come in and post like an asshole.Because I am an asshole.Why did you have to be a fucking dick about it though?Because I am a dick.Fuck you dick!And that'll be a 24-hour ban. Just because somebody is a dick to you doesn't mean you get to curse them like a 12-year old. Link to comment Share on other sites More sharing options...
John117 Posted January 3, 2008 Share Posted January 3, 2008 (edited) Yeah! -Thats right, only Phallic Valik gets to curse like a 12-year old on this forum! Edited January 3, 2008 by Hatcheda Link to comment Share on other sites More sharing options...
danwantsin Posted January 3, 2008 Share Posted January 3, 2008 Yeah! -Thats right, only Phallic Valik gets to curse like a 12-year old on this forum!LMAO Link to comment Share on other sites More sharing options...
Valik Posted January 3, 2008 Share Posted January 3, 2008 Ban evasion ramps up the punishment considerably danwilli. You can come back in 2 weeks unless you do something else that's stupid. 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