Jump to content

Recommended Posts

  • Moderators
Posted

Hi all,

A couple of recent threads have brought up the idea of an AutoIt script compiling another script from within itself - in both cases I mentioned that I had done such a thing as a coding exercise in the past. I thought it might be useful to show how such a thing could be done - so I went back to my old code (it was actually the first large script I ever wrote in AutoIt back in 2008 :o) and updated it for the current release.

The idea for WrapIt came from theWRAP - I found this app very useful as I was dabbling in JBasic at the time and was getting annoyed with all the run-time and image files that were needed to get the code to run. The idea of packing them all into a single executable which would expand them, run one of the expanded executables, and then delete all the files again seemed a good solution. However, as the author of theWRAP had left us the only available (unregistered) version was very limited in the number of files it could wrap. I was also investigating AutoIt at that time (you can guess which one I adopted long term! ;)) and realised that I could do the same sort of thing using FileInstall and Run. And so here is my version - WrapIt.

The zip contains the following:

WrapIt.au3 - the script

WrapIt.ico - an icon for the executable when compiled

WrapIt_Default.ico - a default icon for the wrapped executable

WrapIt.chm - a help file

There are also 3 of my UDFs which I have now incorporated into the script (replacing some very clunky code from 2008! :D)

GUIExtender.au3, ChooseFileFolder.au3, RecFileListToArray.au3

And here it is: WrapIt.zip

Just unzip them all into a folder and have a play. You will need to set the correct path for your own versions of Aut2Exe.exe, AutoItSC.bin, and upx.exe in the FileInstall string literals at lines #252, #253 and #256 - you do not need to compile the script for it to work.

As I only did this as a coding exercise (and no longer use JBasic so no longer need the capability) I am not really interested in maintaining the script. However, comments on how it might be improved are always welcome - it is never too late to learn. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Thanks for sharing!

I can remember being involved in a discussion over this ability quite some years ago, and the end result, if I remember rightly, was that you'd need most of the AutoIt install, which was deemed too clunky or undesirable to include in most instances, far better to point out and/or supply a full AutoIt install as a mandatory requirement.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

  • 2 years later...
  • Moderators
Posted

TheDecoder,

The compilation process for AutoIt changed with the release of v3.3.10.0 and that file is now longer needed - you now only need Aut2Exe (and upx if you want to compress the result).

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...