Sign in to follow this  
Followers 0
daslick

Custom compiler?

23 posts in this topic

I am trying to write a script that compiles a script.

Does anyone know if this is possible and how?

I just need pointed in the right direction.

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You can use the Aut2Exe tool. Run "c:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe" /? for Command Line Parameters.

Edited by spudw2k

Share this post


Link to post
Share on other sites

Hi daslick

Try this... "http://www.autoitscript.com/forum/index.php?act=attach&type=post&id=13185"

I've done it for a very specific use but you can adapt it to your own needs.

If any questions just ask (leave a personal message)... I'm not always connected but each time I'm on, I look for my messages.

Bye

FreeRider


FreeRiderHonour & Fidelity

Share this post


Link to post
Share on other sites

Thanks spudw2k, but I needed to do this on a machine without autoit/scite installed.

FreeRider - That looks perfect. It'll take me a while to cut the code down to what I

need... a simple _compile($au3script) function.

I'll post back with the results.

Share this post


Link to post
Share on other sites

Thanks spudw2k, but I needed to do this on a machine without autoit/scite installed.

FreeRider - That looks perfect. It'll take me a while to cut the code down to what I

need... a simple _compile($au3script) function.

I'll post back with the results.

Hmm... AutoIt isn't actually compiled like you seem to think it is... another compiler isn't going to work.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

is the compiler written in autoit?

i always assumed it was in c+++-+-++++---xxx/+++xx//-----+xxxxxx----++++/

Share this post


Link to post
Share on other sites

It appears that "Aut2Exe.exe" is required since it uses regread to get the compiler.

On my computer it is "C:\Program Files\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"

I need to be able to do this on the end users machine, without AutoIt3 installed

Share this post


Link to post
Share on other sites

It appears that "Aut2Exe.exe" is required since it uses regread to get the compiler.

On my computer it is "C:\Program Files\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"

I need to be able to do this on the end users machine, without AutoIt3 installed

As I've said. You can't.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Now that I think about this, we don't really know what it is exactly you want to do... but what you could do if you are just trying to run a script from scratch on another PC without autoit.exe installed on it, is use the .exe you sent (your script.exe) as the vessel to run it...

ie... take a look at /AutoIt3ExecuteScript or /AutoIt3ExecuteLine


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Okay. I don't take 'you can't' for an answer... I'll find a way.

Let me re-explain what I'm looking for.

I have a script that I want to compile for the end-user, but the problem is, I want the end user to be able to edit the exe and change a variable within it. I do not want it to ask the user for input when it opens, but I want a program/a way to edit that variable.

Share this post


Link to post
Share on other sites

Okay. I don't take 'you can't' for an answer... I'll find a way.

Let me re-explain what I'm looking for.

I have a script that I want to compile for the end-user, but the problem is, I want the end user to be able to edit the exe and change a variable within it. I do not want it to ask the user for input when it opens, but I want a program/a way to edit that variable.

Don't hard code the variable into the script as a literal string. Instead, use an ini file, text file, or registry to store the data that the variable contains. What is this variable anyway? If it is a specific location or folder, you can use AutoIt macros to get the locations of common directories.

- The Kandie Man ;-)


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

I want the end user to be able to edit the exe and change a variable within it

The easy way is to point that variable to read from some data file (*.ini), or just read it from the registry.

I don't think that you can compile AutoIt scripts without the AutoIt engine itself, you can use external SFX-archivator, and pack your script.au3 + compiled Script.exe, and then (as SmOke_N mention) you just run the script.au3 using the Script.exe interpretator (CMD> Start Script.exe /AutoIt3ExecuteScript "Script.au3").


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

I am trying to create a program that allows the end user to compile my script with 1 change.

I'm lost.

Share this post


Link to post
Share on other sites

Okay. I don't take 'you can't' for an answer... I'll find a way.

Let me re-explain what I'm looking for.

I have a script that I want to compile for the end-user, but the problem is, I want the end user to be able to edit the exe and change a variable within it. I do not want it to ask the user for input when it opens, but I want a program/a way to edit that variable.

I am trying to create a program that allows the end user to compile my script with 1 change.

I'm lost.

Regardless of what you "want", and "what you think" you can do... You can't allow your user to compile anything you / they / God does without having AutoIt.exe installed on their PC.

You've been given alternatives/work arounds... you're only wasting your time thinking it can be done.

AutoIt is Not a true compiled language, it's an interpreted one, which means that the script isn't actually compiled per say, it's kind of like FileInstall() as it's put in a stub.exe and then processed (in full code as you've typed it) at run time.

You've been given options of using an Ini to allow the user to put their own values in without having to re-compile, or using /AutoIt3ExecuteScript or /AutoIt3ExecuteLine to run a completely separate exe through the exe you have sent them.

If you can't accept these answers, I'm sorry, but it's just a limitation on AutoIt itself.

But please feel free to write a compiler that does what you want... We'd all be interested in it for sure :) .


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

You can't allow your user to compile anything you / they / God does without having AutoIt.exe installed on their PC.

Not trying to be contentious but that's not exactly correct. You could FileInstall() Aut2Exe.exe into a compiled script and have that script use it as a backend to compile whatever you want. I actually have a script that does this. It chokes on includes, of course, but works fine if none are needed, and technically AutoIt is not installed.

*Edit: Assuming that by compile, you did mean the Aut2Exe process. If you actually meant compile into byte code, then you're correct, but that wouldn't work with AutoIt installed either. :)

Edited by Saunders

Share this post


Link to post
Share on other sites

Okay. I don't take 'you can't' for an answer... I'll find a way.

Let me re-explain what I'm looking for.

I have a script that I want to compile for the end-user, but the problem is, I want the end user to be able to edit the exe and change a variable within it. I do not want it to ask the user for input when it opens, but I want a program/a way to edit that variable.

What you need is here...

http://www.autoitscript.com/forum/index.ph...c=64582&hl=

Share this post


Link to post
Share on other sites

Not trying to be contentious but that's not exactly correct. You could FileInstall() Aut2Exe.exe into a compiled script and have that script use it as a backend to compile whatever you want. I actually have a script that does this. It chokes on includes, of course, but works fine if none are needed, and technically AutoIt is not installed.

*Edit: Assuming that by compile, you did mean the Aut2Exe process. If you actually meant compile into byte code, then you're correct, but that wouldn't work with AutoIt installed either. :)

How is what I said not correct. He said he doesn't want to use the au2exe (I referred to it as the autoit.exe).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

But if you FileInstall it you can deploy the complier without having to "install" autoit.

Well... one of us have totally missed the boat I think. As I've said, I thought he made it abundantly clear he did not in fact want to use AutoIt's executables to compile... but I guess I could be wrong now that many are saying the same thing.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Okay. I don't take 'you can't' for an answer... I'll find a way.

Let me re-explain what I'm looking for.

I have a script that I want to compile for the end-user, but the problem is, I want the end user to be able to edit the exe and change a variable within it. I do not want it to ask the user for input when it opens, but I want a program/a way to edit that variable.

Will you take this answer:

You could make it look like it's doing what you want it to do. Kinda like a psuedo-custom-compiler, that really isn't a custom compiler at all. It may Look like a duck and Quack like a duck, but it might not be a duck.

Lol@My metaphor

You could Fileinstall Aut2Exe, upx.exe, and Autoit3SC.bin and move them to a temporary directory and pass the command line switches to them. You could even throw them up on a server and INetGet them.

Like many have said before me.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0