I compiled a script to a .exe, but when I put that on a computer that does not have AutoHotKey.exe; it is asking for it. Doesn't the compile make a self-contained .EXE without the need to have AutoHotKey.exe installed?
Did I do something wrong?
Compiled script, needs AutoHotkey.exe?? Topic is solved
Re: Compiled script, needs AutoHotkey.exe??
Sounds like it.
How is it asking for Autohotkey.exe ?
How is it asking for Autohotkey.exe ?
Re: Compiled script, needs AutoHotkey.exe??
When I run, I get
----------------------------------------------
Can't Find:
C:\Program Files\App\AutoHotkey.exe
----------------------------------------------
----------------------------------------------
Can't Find:
C:\Program Files\App\AutoHotkey.exe
----------------------------------------------
Re: Compiled script, needs AutoHotkey.exe??
Haven't seen that before - try to compile again.
Otherwise you should take a close look at your script - if it's somewhere referencing that path.
Did you use some additional source code protection methods? If yes, which ones? If not, just show your script, or better, a snippet that allows to reproduce the problem.
Did you use special compiler directives?
Which AHK and compiler versions? Windows version?
Otherwise you should take a close look at your script - if it's somewhere referencing that path.
Did you use some additional source code protection methods? If yes, which ones? If not, just show your script, or better, a snippet that allows to reproduce the problem.
Did you use special compiler directives?
Which AHK and compiler versions? Windows version?
Re: Compiled script, needs AutoHotkey.exe??
I mean, the \App part of C:\Program Files\App\AutoHotkey.exe seems unusual.
That's not even the standard path that the AHK installer would suggest. Is it the path to your AHK program folder on your computer?
That's not even the standard path that the AHK installer would suggest. Is it the path to your AHK program folder on your computer?
Re: Compiled script, needs AutoHotkey.exe??
Thanks folks, I recompiled and now it seems to be working. I did use encryption, but after another compile it seems to have resolved itself. Very odd...
Re: Compiled script, needs AutoHotkey.exe??
Was it feiyue's method?
I have never looked into it, but iirc there is something about having autohotkey.exe nearby in order to compile...!?
Or something like that...
I have never looked into it, but iirc there is something about having autohotkey.exe nearby in order to compile...!?
Or something like that...
Re: Compiled script, needs AutoHotkey.exe??
Ok, I'm back to ask a different question, and I think I know why this wasn't working.
I am trying to use AHK_Encryptor to encrypt my script. Basically because I want to make it a commercial application and don't want people decompiling it with some utility readily available.
What Encryptor does is:
1. embed "AutoHotKey.exe" into the script - that's why it's got to be in the directory of the AHK_Encryptor.ahk script.
2. The encryptor also adds code to "install" AutoHotKey.exe at first execution into the same directory as the application .exe
3. That's because the de-cryption needs AutoHotKey.exe to run.
My procedure has been:
A. Encrypt my script with AHK_Encryptor
B. Compile the encrypted script
C. Run the executable
D. and, the executable goes and installs "AutoHotKey.exe" in the same directory as the compiled .exe
Encryptor needs "AutoHotKey.exe" to de-crypt the encrypted script before it runs.
Now mind you, a compiled script already has AutoHotKey.exe bundled within it, so the script itself doesn't need it - the decryption method seems to need it.
It only seems to create the AutoHotKey.exe on the first run of the encrypted/compliled .exe; because if I delete the AutoHotKey.exe file - it won't get recreated again, and hence I get the error that it can't find "AutoHotKey.exe"
So now my buyer is left with my .exe in the program directory where it got installed, and a "AutoHotKey.exe" in the same directory.
Hence - they can see my .exe is somehow related to AutoHotKey. They may not be able to de-crypt it, but it's a flag I'd like to prevent.
So, if the execution of the .exe DOES NOT extract and install AutoHotKey.exe into the directory the .exe is in (or is deleted by some stance) - you get a message that says "Can't find AutoHotKey.exe". That might happen because of file permissions, etc.
If anyone if familiar with the Encryptor script - or alternative methods to prevent decompiling a complied script - please chime in.
Thanks
I am trying to use AHK_Encryptor to encrypt my script. Basically because I want to make it a commercial application and don't want people decompiling it with some utility readily available.
What Encryptor does is:
1. embed "AutoHotKey.exe" into the script - that's why it's got to be in the directory of the AHK_Encryptor.ahk script.
2. The encryptor also adds code to "install" AutoHotKey.exe at first execution into the same directory as the application .exe
3. That's because the de-cryption needs AutoHotKey.exe to run.
My procedure has been:
A. Encrypt my script with AHK_Encryptor
B. Compile the encrypted script
C. Run the executable
D. and, the executable goes and installs "AutoHotKey.exe" in the same directory as the compiled .exe
Encryptor needs "AutoHotKey.exe" to de-crypt the encrypted script before it runs.
Now mind you, a compiled script already has AutoHotKey.exe bundled within it, so the script itself doesn't need it - the decryption method seems to need it.
It only seems to create the AutoHotKey.exe on the first run of the encrypted/compliled .exe; because if I delete the AutoHotKey.exe file - it won't get recreated again, and hence I get the error that it can't find "AutoHotKey.exe"
So now my buyer is left with my .exe in the program directory where it got installed, and a "AutoHotKey.exe" in the same directory.
Hence - they can see my .exe is somehow related to AutoHotKey. They may not be able to de-crypt it, but it's a flag I'd like to prevent.
So, if the execution of the .exe DOES NOT extract and install AutoHotKey.exe into the directory the .exe is in (or is deleted by some stance) - you get a message that says "Can't find AutoHotKey.exe". That might happen because of file permissions, etc.
If anyone if familiar with the Encryptor script - or alternative methods to prevent decompiling a complied script - please chime in.
Thanks
Re: Compiled script, needs AutoHotkey.exe??
I think my solution is to not use the Encryptor script - but, rather use mpress.exe to compress the executable. That provides a degree of protection, and actually improves the speed and size of the executable.
Re: Compiled script, needs AutoHotkey.exe??
If you look at the first few line of the encryptor there is facility for it to change the name of the included AutoHotkey.exe when it is extracted later, so you could make use of this to achieve what you want.
Edit: In particular, see this line and the comments a few line above.
For example, to make the extracted AutoHotkey.exe become renamed to abc.exe during extraction, change this line to
Edit: In particular, see this line
Code: Select all
Ahk=%A_ScriptDir%\AutoHotkey.exe
For example, to make the extracted AutoHotkey.exe become renamed to abc.exe during extraction, change this line to
Code: Select all
Ahk=%A_ScriptDir%\abc.exe
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Compiled script, needs AutoHotkey.exe?? Topic is solved
Compiled scripts are not bundled with AutoHotkey.exe by default (except maybe with AutoHotkey_H). A standard compiled script is a copy of AutoHotkeySC.bin which Ahk2Exe has inserted script text into as a "resource". AutoHotkeySC.bin is capable of loading a script only from this "resource", not any other source, hence the need for the "Encryptor" script to include AutoHotkey.exe.
mpress.exe does not improve the speed of script execution. It may or may not improve startup time, depending on whether file I/O is more or less costly than decompression.
mpress.exe does not improve the speed of script execution. It may or may not improve startup time, depending on whether file I/O is more or less costly than decompression.
Re: Compiled script, needs AutoHotkey.exe??
I was in your situation too. I think I could not use Encryptor but I Finally made it work.
First In the file result after convert to encoded ahk file I changed the lines that is suggested.
Code: Select all
#NoEnv
#NoTrayIcon
#SingleInstance off
SetBatchLines, -1
Ahk=%A_ScriptDir%\ini.exe ;Ahk=%A_ScriptDir%\AutoHotkey.exe
if (A_IsCompiled)
FileInstall, ini.exe, %Ahk% ;FileInstall, AutoHotkey.exe, %Ahk%
s=
s.="u565796926u1555740597u1259231568u2248437892u1075650729u73891"
s.="8535u580988478u244256284u2301702346u65716102u1925456907u3984"
...
Then with ResourceHacker.exe I opened the ini.exe and changed the icons, name , other things That you can see with ResourceHacker.exe.
So,The result of my project working in a PC that has not autohotkey installed.>
I hope it can be helpful for you.
Cheers.
If I was helpful consider Donate me. , plz
Who is online
Users browsing this forum: AlFlo and 133 guests