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] and I believe even tk + certain [extension]s. The pure Tcl version--freewrapTCLSH--generates an executable that's typically just over a quarter of a megabyte. ---- Alex [[Vizantinos?]] provides a recipe [http://groups.google.com/groups?q=freewrap+decrypt+group:comp.lang.tcl*&hl=en&lr=&ie=UTF-8&selm=3957b880.0305181722.4fb7216d%40posting.google.com] for reverse engineering a Freewrap-ped application. Dennis follows that up with a simple counter-recipe for use of a private encryption key. ---- Latest version (5.6) gives up source code encryption [http://freewrap.sourceforge.net/freewrap_history.html]. ---- [MG] notes on May 12th, 2005 that a '''v6.0''' seems to be available, since the start of the year, according to the download's page. It uses Tcl 8.4.8. ---- See also [tbcload] and [Freedelivery] ---- In a world with [Starpack]s, [mktclapp], and so on, what's the point of freeWrap? One benefit is that freeWrap builds in [BLT]. [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] I ''had'' had the same experience, but now things have changed... What was happening is that version 6.0 of Freewrap uses UPX to compress the executable. However, UPX doesn´t work when the executable calls itself, as Freewrap must (to use the zip vfs). So, only a core part of the Freewrap executable is UPX-compressed. As a result, if you run upx -d on Freewrap, it will run, but render it unusable. The solution is simple: a non-UPX version of Freewrap. I just got an e-mail from [Dennis LaBelle] telling me that version 6.1 has been released with no UPX. Hooray! So, [MG], you should be able to use FreeWrap again. [A/AK] It's OK to use UPX when the executable calls itself. However, 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 someone has UPX-ed freewrap and wants to decompress it, or he has decompressed freewrap and wants an UPX-ed one, it's 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. [EKB] Thanks, [A/AK]. But these are deep waters for me... Am I right in thinking that the change will need to happen in the Freewrap makefile? Here are (I think) the relevant lines: $(PROG)$(EXE): $(PROG)_bare$(EXE) zipdir\freewrap.tcl zipdir\freewrapCmds.tcl zipdir\$(PROG).ico del $(PROG)$(EXE) ... echo /freewrap.tcl >zipdir\_freewrap_init.txt echo $(PROGREV) >>zipdir\_freewrap_init.txt copy /b $(PROG)_bare$(EXE)+$(TOP)\null.zip $(PROG).zip cd zipdir $(ZIP) -rA9 ..\$(PROG).zip *.* cd .. ren $(PROG).zip $(PROG)$(EXE) del freewish$(FW_EXT).exe copy $(PROG)$(EXE) freewish$(FW_EXT).exe freewish$(FW_EXT).exe ..\generic\setinfo.tcl freewrap$(FW_EXT).exe copy $(PROG)$(EXE) freewish$(FW_EXT).exe ... $(PROG)_bare$(EXE): $(OBJ) $(LIBSOPEN) link /OUT:$(PROG)_bare$(EXE) $(OBJ) $(LFLAGS) $(LIBS) $(OBJSTKTBL) # $(TOP)\upx -9 $(PROG)_bare$(EXE) (The last line was not commented out in version 6.0.) The ideal situation is UPX compression with the ability to edit resources. (Having zip/unzip/upx -d/upx as part of the process is no problem.) [A/AK] No, my main point is that there's no need to modify freewrap's makefile, whether it uses UPX or not. 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. If some other version of freewrap will be compresses with UPX again, you may decompress it with upx -d, edit its resources, then compress with upx, then adjust with zip -A. 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 it will make it uncompressed. There is no need in ''zip -A'' until you want to turn compressed freewrap into uncompressed and back again ''without recompilation''. ---- [Category Application]