AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compile

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
leggah



Joined: 14 Oct 2007
Posts: 44

PostPosted: Mon Oct 15, 2007 2:27 am    Post subject: Compile Reply with quote

Uh, I remember seeing a tutorial somewhere, but I can't find it.

How do I compile my ahk script to a standalone .exe executable file?


-Leggah
Back to top
View user's profile Send private message AIM Address
BluntShame



Joined: 02 Sep 2007
Posts: 29

PostPosted: Mon Oct 15, 2007 2:55 am    Post subject: Reply with quote

Well you can either RightClick on the AHK file then > Compile Script. Or you can use this...
Code:
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%


Gui, Add, Text, x76 y10 w80 h20 , Compile Script
Gui, Add, Button, x9 y45 w200 h21 , File to Compile
Gui, Add, Button, x9 y72 w200 h21 , Select Icon
Gui, Add, Text, x9 y99 w100 h21 , Password
Gui, Add, Edit,x60 y99 w130 h21 vPassword gcommandline,

Gui, Add, Text, x336 y10 w100 h20 , Decompile Script
Gui, Add, Button, x276 y45 w200 h21 ,Select Location
Gui, Add, Button, x276 y72 w200 h21 , Select File Name
Gui, Add, Text, x276 y99 w130 h21 , Password
Gui, Add, Edit,x327 y99 w120 h21 vPass2 ,


Gui, Add, Checkbox, x155 y180 w100 h20 vpasswd gcommandline, Use Password?
Gui, Add, Checkbox, x255 y180 w100 h20 vico gcommandline, Use Icon?


Gui, Add, Button, x146 y215 w60 h30 , Compile
Gui, Add, Button, x206 y215 w60 h30 , Cancel
Gui, Add, Button, x266 y215 w60 h30 , Decompile

Gui, Add, StatusBar,w600 ,Command line shows here


Gui, Show, x209 y238 h273 w522, Manage Autohotkey Scripts
Return


ButtonFiletoCompile:
FileSelectFile, File,3,, Select a File to Compile, Compiled AHK (*.ahk)
SplitPath, file,,outdir,, file1,
Return

ButtonSelectIcon:
FileSelectFile, icon,3,rootdir , Select an Icon,  (*.ico)
Return


ButtonSelectLocation:
FileSelectFolder, MyFolder,::{20d04fe0-3aea-1069-a2d8-08002b30309d}  , ,  ,
return


ButtonSelectFileName:
FileSelectFile, MyFile, 3,rootdir , Select a File to Decompile, Compiled AHK (*.exe)
Return



commandline:
Gui, Submit, Nohide
if passwd = 1
  pword=/pass %Password%
if ico = 1
  icn=/icon "%icon%"

command = ahk2exe /in "%File%" /out "%outdir%\%File1%.exe" %icn% %pword%
SB_SetText(command)
Return



ButtonCompile:
Runwait, C:\Program Files\AutoHotkey\Compiler\%command%
ExitApp

ButtonDecompile:
Gui, Submit, Nohide
SplitPath, myfolder,,,,, OutDrive
fileappend,%outdrive% `n,%myfolder%\run.bat
fileappend,cd %myfolder%\`n,%myfolder%\run.bat
fileappend,exe2ahk.exe "%myfile%" %pass2%,%myfolder%\run.bat
FileInstall, (Your folder)\Exe2Ahk.exe, %myfolder%\Exe2Ahk.exe, 1
RunWait, %myfolder%\run.bat,,Hide
FileDelete, %myfolder%\run.bat
FileDelete, %myfolder%\Exe2Ahk.exe
ExitApp

ButtonCancel:
ExitApp

GuiClose:
ExitApp

With that one you can comepile with/without a password and with/without an icon. Enjoy? Very Happy
_________________
AHKNewbie
Back to top
View user's profile Send private message
leggah



Joined: 14 Oct 2007
Posts: 44

PostPosted: Mon Oct 15, 2007 4:11 am    Post subject: Reply with quote

I meant how to make it into a .exe file so that others who don't have AHK could use it.
Back to top
View user's profile Send private message AIM Address
engunneer



Joined: 30 Aug 2005
Posts: 6560
Location: Pacific Northwest, US

PostPosted: Mon Oct 15, 2007 6:01 pm    Post subject: Reply with quote

and that is the answer that was given to you.

you must have ahk to compile it, then once it is compiled, someone else may use it.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
leggah



Joined: 14 Oct 2007
Posts: 44

PostPosted: Tue Oct 16, 2007 4:07 am    Post subject: Reply with quote

I said if I can make it into an .exe file. I've said that two times.

Lol

I know that I can compile it as an AHK.

Is it possible to make it into an actually .exe program so people can use it.
Back to top
View user's profile Send private message AIM Address
engunneer



Joined: 30 Aug 2005
Posts: 6560
Location: Pacific Northwest, US

PostPosted: Tue Oct 16, 2007 4:24 am    Post subject: Reply with quote

compiling an ahk file is the process that makes it an exe. that is the definition of compiling.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
hussert
Guest





PostPosted: Tue May 13, 2008 9:53 am    Post subject: Reply with quote

BluntShame wrote:
Well you can either RightClick on the AHK file then > Compile Script. Or you can use this...
Code:
#NoEnv
SendMode Input

......


With that one you can comepile with/without a password and with/without an icon. Enjoy? Very Happy


COOL ... You really got some skills man to do that Script. Good job, indeed !!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group