Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling / compression #32

Open
henriqueterada opened this issue May 28, 2023 · 11 comments
Open

Compiling / compression #32

henriqueterada opened this issue May 28, 2023 · 11 comments

Comments

@henriqueterada
Copy link

Hello, when I try compiling a script using compression, the neutron GUI gets corrupted. Just wondering if this is expected.

@SaifAqqad
Copy link
Contributor

How are you compressing the script?

@henriqueterada
Copy link
Author

henriqueterada commented May 28, 2023 via email

@SaifAqqad
Copy link
Contributor

Does the neutron UI open at all? or is there a thrown error?

If it does open but the HTML is corrupted, I think it might be a script encoding issue

@henriqueterada
Copy link
Author

Yes, neutron UI does open but HTML is corrupted.

@otomay
Copy link

otomay commented Jan 23, 2025

Did you make it? I'm trying and some lines that was working when .ahk script stops when compiled. I tried even without compression and got the same result.

A way to make it work when compiled is changing this line from Neutron.ahk:

url := "res://" this.EncodeUri(A_ScriptFullPath) "/10/" fileName

if A_IsCompiled
	;url := "res://" this.EncodeUri(A_ScriptFullPath) "/10/" fileName
	url := A_WorkingDir "/" fileName
else
	url := A_WorkingDir "/" fileName

and use fileinstall to extract your dependencies. Not fancy, but HTML would be exposed with "inspect" option anyways.

@The-CoDingman
Copy link

@henriqueterada I can confirm for you that compilation with compression does/can work with Neutron. I do both with my scripts. You would be best to give more information on the error you are seeing.

Did you make it? I'm trying and some lines that was working when .ahk script stops when compiled. I tried even without compression and got the same result.

A way to make it work when compiled is changing this line from Neutron.ahk:

url := "res://" this.EncodeUri(A_ScriptFullPath) "/10/" fileName

if A_IsCompiled
;url := "res://" this.EncodeUri(A_ScriptFullPath) "/10/" fileName
url := A_WorkingDir "/" fileName
else
url := A_WorkingDir "/" fileName
and use fileinstall to extract your dependencies. Not fancy, but HTML would be exposed with "inspect" option anyways.

@otomay That line is necessary for building enclosed compiled pieces. If you include your resources inside your compiled script as shown in the examples, then you can run webpages without extracting them.

@otomay
Copy link

otomay commented Jan 23, 2025

@The-CoDingman Yeah, I know, it's just a workaround for anyone having trouble.
For me, when compiled and loading from RCDATA, the following lines of my html file throws errors:

    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

IDK why. I tried both compressed and uncompressed. It only works loading from local file,

@The-CoDingman
Copy link

@otomay, interesting. I'm not sure what may be causing that on your end. I just slapped them into a pre-existing script I had and it worked without any issues. What compression method are you using?

@otomay
Copy link

otomay commented Jan 28, 2025

@The-CoDingman I tried with upx and without compression.

Maybe it's the compiler version on my personal computer. In another project on my work computer it worked nice;

On my work computer I'm with the v1.1.37.02 using U64 AutoHotKeyU64.exe in the base file and using upx to compress. When I get to my personal computer I'll share these details of it.

@The-CoDingman
Copy link

Hrm. I am using the Ahk v2 version of Neutron, it's possible that has something to do with it.

@otomay
Copy link

otomay commented Jan 29, 2025

yeah, maybe...

Just check in my PC and I'm in the same version for ahk and v1.1.37.02a0 for compiler. Weird, basically the same.
and for base file I'm using Unicode 64.

Maybe something with base file, maybe something with the project. Gonna try a few things and let you guys know if I discover something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants