AutoHotkey Community

It is currently May 27th, 2012, 12:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: December 8th, 2011, 11:17 pm 
Offline

Joined: September 17th, 2005, 6:43 pm
Posts: 242
Anonymous wrote:
From a few posts above:
Quote:
Code:
AHK2Exe.exe /in file.ahk /out file.exe /mpress 1

to enable mpress. Everything other than 1 is interpreted as not using mpress, as well as skipping the mpress switch completely.

Thank you so much anonymous :) Works like a charm.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2011, 2:35 am 
You can probably run mpress - or any other compressor of your choice - yourself on the command line after compiling...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2011, 2:38 am 
Offline

Joined: September 17th, 2005, 6:43 pm
Posts: 242
Anonymous wrote:
You can probably run mpress - or any other compressor of your choice - yourself on the command line after compiling...


Good point :) I am working on a Script Writer and it is a bit easier for me to implement that automatically so that the users do not have to worry about it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Where is the Passord Box
PostPosted: February 3rd, 2012, 2:28 pm 
Since im updating to AHK_L, i am missing the password box.
Why dont you have one too?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2012, 3:11 pm 
@GlabbichRulz: It has been removed as it is no longer supported as far as I know. If you want to protect your code (somewhat) use Mpress.exe
http://www.autohotkey.com/wiki/index.ph ... Protection


Report this post
Top
  
Reply with quote  
PostPosted: February 3rd, 2012, 8:09 pm 
GlabbichRulz wrote:
Since im updating to AHK_L, i am missing the password box.
Why dont you have one too?
I feel bad for you... I can decompile a passworded or /NoDecompile'd exe file in under a minute


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 11:26 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Hi fincs, can we please add following so also standard library of A_AhkExe is used:
Code:
FindLibraryFile(name, ScriptDir)
{
   libs := [ScriptDir "\Lib", A_MyDocuments "\AutoHotkey\Lib", A_ScriptDir "\..\Lib", SubStr(A_AhkPath,1,InStr(A_AhkPath,"\",1,0)) "Lib"]
;...

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 11:37 am 
Two suggestions (I don't compile but it just occured to me)

1) Add a checkbox for "Use Mpress.exe" and remembering the last user choice. If it can not find Mpress gray out the the control.

2) As it is a FAQ, perhaps add a note below the (c) notices saying something like "Note: Compiling a script does not guarantee protection of your source code."


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 11:45 am 
Online
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
HotKeyIt wrote:
Hi fincs, can we please add following so also standard library of A_AhkExe is used

That's already handled by A_ScriptDir "\..\Lib" (you're not supposed to move the compiler around). In fact, that's the behaviour of the original Ahk2Exe.
If what you want is just to automate script compilation and you somehow need to copy the compiler around, don't worry, because something to do that cleanly is in the works :)
Anonymous wrote:
Add a checkbox for "Use Mpress.exe" and remembering the last user choice. If it can not find Mpress gray out the the control.

There's already a checkbox for that, and it also remembers the last user choice ("Use MPRESS (if present) to compress resulting exe").
Anonymous wrote:
As it is a FAQ, perhaps add a note below the (c) notices saying something like "Note: Compiling a script does not guarantee protection of your source code."

That might be a good idea.

EDIT: look at this sneak-peak:
Code:
q := ComObjCreate("AutoHotkey.Compiler")

; You can directly compile the script via this function:
q.Compile(A_ScriptFullPath, A_ScriptDir "\wowsimple.exe", "", "", true)

; ... or have more control over the compilation process.

q.Open(A_ScriptDir "\wow.exe")
;q.AddScriptFile(A_ScriptFullPath) ; you can set the script to compile using this function...
q.CustomIcon("someIcon.ico")
q.AddScriptText("MsgBox Hello, world! This script was dynamically compiled :9", true) ; or use dynamic script text instead.

; This function allows you to add/modify/delete a custom resource.
test = Hello, world!
q.UpdateResource(10, "OhMyData", BinarySafeArray(test, VarSetCapacity(test))) ;RCDATA=10

; Remove unused icons
list = 4,5,6,7,8,9,10
Loop, Parse, list, `,
   q.UpdateResource(3, A_LoopField)

; Remove unused icon groups
list = 160,206,207,208,228,229,230
Loop, Parse, list, `,
   q.UpdateResource(14, A_LoopField)

q.UpdateResource(4, 211) ; Remove main menu
q.UpdateResource(5, 205) ; Remove InputBox dialog
q.UpdateResource(9, 212) ; Remove accelerators
q.Flush()

for t in q.EnumResourceTypes()
{
   line := ""
   for r in q.EnumResources(t)
      line .= r ", "
   StringTrimRight, line, line, 2
   text .= t ": " line "`n"
}
StringTrimRight, text, text, 1
MsgBox %text%

q.Close()
Run, "%A_ScriptDir%\wow.exe"

; This function creates a VT_UI1 SafeArray from a variable.
BinarySafeArray(ByRef data, size)
{
   arr := ComObjArray(0x11, size), pArray := ComObjValue(arr)
   DllCall("oleaut32\SafeArrayAccessData", "ptr", pArray, "ptr*", pData)
   DllCall("msvcrt\memcpy", "ptr", pData, "ptr", &data, "uptr", size, "cdecl")
   DllCall("oleaut32\SafeArrayUnaccessData", "ptr", pArray)
   return arr
}

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Last edited by fincs on February 4th, 2012, 11:59 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 11:50 am 
fincs wrote:
There's already a checkbox for that, and it also remembers the last user choice ("Use MPRESS (if present) to compress resulting exe").
My bad, didn't see it in the screenshot in the first post. What can I say, great minds think alike :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 12:00 pm 
Online
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Anonymous wrote:
My bad, didn't see it in the screenshot in the first post.

That's because the screenshot is outdated. You should run the real thing 8)

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2012, 7:59 pm 
Offline
User avatar

Joined: February 28th, 2011, 7:28 pm
Posts: 625
Location: Germany
Am I missing something or does it always error if the destination file does not yet exist? (I tested both the AHK_L download and the latest source.)
Also if the destination file does already exist, it seems it is not deleted but updated. Which means that any resources in the original file will also be present in the new file (+ if its not a compiled script the entire thing is corrupted / does not act as AHK script but whatever it was before.)

The COM thing looks really great. Do you already have source for it? I'd love to see :D

_________________
RECOMMENDED: AutoHotkey_L
Image
github - ImportTypeLib
Win7 HP SP1 32bit | AHK_L U 32bit


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2012, 9:19 pm 
Online
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
maul.esel wrote:
Am I missing something or does it always error if the destination file does not yet exist? (I tested both the AHK_L download and the latest source.)
Also if the destination file does already exist, it seems it is not deleted but updated. Which means that any resources in the original file will also be present in the new file (+ if its not a compiled script the entire thing is corrupted / does not act as AHK script but whatever it was before.)

It works for me :?:
maul.esel wrote:
The COM thing looks really great. Do you already have source for it? I'd love to see :D

I have a crude implementation of it that supports running the above script, however it's not ready yet.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2012, 9:54 pm 
Offline
User avatar

Joined: February 28th, 2011, 7:28 pm
Posts: 625
Location: Germany
Sorry. The error was actually caused by the bin file DDL begin on "(Default)". Changing it to Unicode 32bit made it work. Seems there was no initial setting to use. Now it works with "(Default)", too.

_________________
RECOMMENDED: AutoHotkey_L
Image
github - ImportTypeLib
Win7 HP SP1 32bit | AHK_L U 32bit


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2012, 3:24 pm 
Feature requests: Having an option to turn off auto-include from library files.
When I compile projects that I like to share the code with, it would be nice to don't automatically include the library functions, because they would be missing in my project's folder then and others would need to search for the functions.
Currently, I don't use the library to accomplish this, but it would be useful to have some of my functions in my library to be able to call them from everywhere while debugging.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: hughman, rrhuffy and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group