Freewrap

by Dennis LaBelle

homepage at http://freewrap.sourceforge.net/

The freewrap program turns Tcl/Tk scripts into single-file binary executable programs. There are various forms of this application - from wrapping pure-tcl scripts to wrapping tk to wrapping even tk + extensions.

The pure Tcl version -- freewrapTCLSH -- generates an executable that's typically just over a quarter of a megabyte.

What's special to freeWrap? One benefit in older versions was that freeWrap included BLT. Also, it encrypts the wrapped files (ZIP 2.0 style file encryption). And it comes with a complete implementation of zip (most functionality of the Info-ZIP library is implemented).


See also:

For other wrapping solutions, see:

... and so on.


Versions

Versions include (for a complete list, see the revision history ):

Versionrelease dateTcl version basisremarks
6.75January 5, 20238.6.13
6.70February 7, 20198.6.9now uses /zvfs mount point
6.63April 19, 20148.6.1
6.60April 25, 20138.6.0no BLT included anymore
6.5January 12, 20118.5.9BLT included again
6.42January 25, 20098.5.6
6.4January 28, 20088.5.0no BLT included anymore
6.0January 2, 20058.4.8

Notes on versions

Version 6.70 ...

- Happily, this version added new icon sizes (though sadly seems unable to put in the 256x256 variant via the -i option)

- One change that can have existing-script breaking implications is: wrapped files now have a system mount point of "/zvfs".


Notes

MG I've been using Freewrap since before I knew Starkits existed (and possibly since before they did exist?). I've read a lot of very long pages on how to use a Starkit to make an executable of a Tcl script, which several files and utilities to download.. and then I just drag-and-drop my Tcl script onto Freewrap and my executable is made. That's why I've kept using it. Though, lately (I think since I downloaded freeWrap 6), I've found that if I edit the icons or version info of my freeWrap'd executable with Resource Hacker, as I've always done, it no longer works, which is a downside that would make me consider switching to Starkits now.'

EKB The problem came in version 6.0 of Freewrap from using UPX to compress the executable. There is now a non-UPX version of freewrap (ver. 6.1). (The following note by A/AK was rearranged w/permission to remove EKB's questions.)

A/AK If the executable's tail is a zip archive (like in freewrap), the archive's table of contents must be adjusted when the preamable's size changes.

The standard InfoZIP's zip program can do it when the -A option is given. Thus, If you've downloaded freewrap 6.1 (no UPX), you may edit its resources, then compress the executable with upx, then use zip -A to make it usable again. Alternately, if some other version of freewrap will be compressed with UPX again, you may decompress it with upx -d, edit its resources, then compress with upx, then adjust with zip -A. Either way, the steps are easy:

 upx freewrap.exe / upx -d freewrap.exe
 zip -A freewrap.exe

No more need to wait for the next version of freewrap. No more feature requests to Dennis LaBelle causing him to switch between using and not using UPX compression with each subsequent version.

Of course, if you want to recompile freewrap, uncommenting the line with UPX in its makefile will make it compressed from the very start, and commenting the line will make it uncompressed. There is no need in zip -A until you want to turn compressed freewrap into uncompressed and back again without recompiling it.

SEH 20060103 -- I've been in touch with the author of the nifty XHTML-Editor package about whether he'd be willing to make the code available; he said he'd like to, but he lost it. It's a freewrapped program. Is there a simple way to unwrap a package and thus recover the code?

RH 2006-01-04 You can just unzip the executable. In pre freewrap 6.xx there was a encryption option. If he used it then unzipping gives you the encrypted files. For decryption have a look at the sources of freewrap.

SEH 20060104 -- Neither WinZip nor gunzip will recognize the executable as a file that can be unzipped. Can you provide more explicit instructions for unzipping an executable?

LES: it is compressed with upx. But after decompression, zip utilities still refuse to recognize it.

Dennis LaBelle: 2006-01-04 I extracted the source code from the XHTML-Editor application and sent it to the author today. This application was wrapped with freeWrap 4.x. I have a program (which I wrote) that can do such extractions.

wdb: 2006-04-03 The sources of the XHTML editor "MTE" are available [L1 ] from my HP [L2 ]. Thank you, Dennis Labelle! (Indeed, I had made it available as soon as I received Dennis' message. Sorry for the delay of my announcement. I did not know of this wiki page.)


DB: 2006-01-26 -- freeWrap 6.2 has been ported to Darwin and Mac OS X. The binaries are available at [L3 ]. An additional version called freewrapAQUA wraps Tcl/Tk applications with the Aqua interface of OS X.

Synic: 2006-09-05 -- Unfortunately, while the freeWrap 6.2 binaries from that URL do run on OS X they only produce Mac OS 9 compatible TCL apps. Attempting to run apps causes the OS 9 compatibility mode to start in order to run it (which isn't helpful if the disk has never had OS 9 installed).


PCO - 18 december 2010 - Because nobody seams to maintain this tool, I finally have ported again freewrap 6.2 onto Mac OS X Tiger / Intel. My release is based on the native Aqua interface (no X11) and permits to build integrated Mac applications (have a look on mine : BagPipe ).

You can find it here : freewrap6.2 .

At the same time, I have finalized the snack2.2.10 port onto Mac OS X Intel too, fixing a severe issue : input functions weren't implemented at all. As for the input and output gains setting.

You can find the full function snack 2.2.10 library here : Snack 2.2.10 and the source code here : Snack 2.2.10_src


Daniel Not sure from the above--can you, or can you not, put a larger set of icons in a freewrapped Windows exe, and if so, exactly how? Only small icons can be inserted via icon editors like Microangelo, and the "-i" option only replaces those specific sizes.

MG I believe (though someone who knows better than me can confirm/correct, hopefully) that you can only put in the icons which were there originally, at least using things like Resource Hacker or standard icon editors. Whether there are other programs which can add in new icons, I don't know, but I'm not aware of any - I think you'd need a copy of freeWrap that was compiled with all the icons you want.

slebetman Correct. In which case, Dennis, can you please release newer versions of freewrap with a larger set of supported icons compiled in. I know I can compile freewrap myself from sources to have exactly the icon set I need but I don't have access to MSVC.

EKB I use Heaventool's Resource Tuner [L4 ]. It costs about $40 and has a nice interface.


meinapril I like to get rid of the heavy load (1.4 MB) of tzdata inside. I know, it is Tcl. But not many need it. Deleting...? ->The zip file is encrypted. Build your own ...? -> Like build your own car?

aricb For future reference, deleting the contents of the page in order to ask a question is considered bad manners. I can't specifically answer your question, but if you don't get answers here, try asking at Ask, and it shall be given # 8.


One other note: I experienced problems with freeWrap in case one tries to execute it from a USB-flash drive connected via a USB-hub (2.0), instead, inserting and using the USB-drive via a USB-port connected to the motherboard of the PC or laptop should solve this problem (it did in my case...)


LK - 2012-12-18 00:44:54

I am using freewrapPLUS 6.51 on Windows to create a single executable with a -i myicons.ico option. However, only small icon in detail view of the file folder views is replaced with my icon, all situation requiring a larger icon still uses the default freewrap icon, even though all possible sizes and depths of the icon are included in myicons.ico. Several icon/resource editing programs such as IcoFX or Resource Tuner all show that the wrapped application contains, and only contains 4 size/depth variations of my icon (the 4 must-have as specified in the freewrap documentation); in particular, the executable does NOT contain any variation of the default freewrap icon. So how does the stand alone executable still display the default freewrap icon?

APN Say hello to the Windows Explorer icon cache :-) You may see if [L5 ] or [L6 ] help.