How to put a QB64 program and all
its needed files into one EXE using
the FREE FilePacker 1.2 program.
|ABOUT THIS TUTORIAL: One draw back of a QB64 compiled program is that it needs a bunch of .DLL's in order to run. Wouldn't it be nice to have them all in just one file? A single EXE? Well this tutorial explains how to do just that, using the FREE FilePacker 1.2 utility to build a special EXE that, when started, will silently unpack all needed files and run the QB64 program. All you have to do is distribute the one EXE file.|
|1) Download FilePacker 1.2 by Jvwcomputing. FilePacker is free and can currently be found Here
or use Google to locate another download.
2) Start FilePacker and click Next to begin Making your packed EXE file.
|3) Here you can give your New Project a name in case you want to save it later. I named mine XE because I'm making a packed EXE out of my XE program.|
|4) Either Browse to or type in the folder containing all the source files you want to pack together. That will
include your QB64 compiled EXE and all the .DLL files that it requires to run and any other files your program
requires, like BMP's or WAV files, etc. Then Click Next.
This should be a total of 15 .DLL files, about 7.38MB's. Of course you will need to have compiled your program with QB64 first!
NOTE: If your program is just a Qbasic type program (only using Qbasic commands) you don't need to add all the DLL's. Only these 8 .DLL's are required to run a bare-bones Qbasic type program: libfreetype-6.dll, libgcc_s_sjlj-1.dll, libstdc++-6.dll, SDL.dll, SDL_image.dll, SDL_mixer.dll, SDL_net.dll, SDL_ttf.dll.
My program is a Qbasic type program, so I'm just adding the minimum .DLL's needed. This reduces the file size.
|5) Here you must check the EXE you want FilePacker to execute when unpacking your files. I choose XE.EXE because that's my QB64 program - you select your own.|
|6) Now you have some choices on how you want your packed EXE to behave. Do you want it to delete files after extraction?
Ask for a password when starting? Overwrite files when extracting? Choose what's best for you. Be sure to sleect
BEST compression level to make the smallest EXE file. Then click Next to continue.
TIP: For even more compression and to make a smaller packed EXE, use the UPX program on the DLL & you QB64 compiled EXE before packing them with FilePacker - you'll reduce the Packed EXE size up to 30%.
|7) More Choices! Where do you want the files to extract to on the users PC? Click on the Variables to see a wide selection. I selected *TempDir* so my files would unpack out of the way to a TEMP directory. Here you can specify an ICON for your packed EXE if you have one. And here you also get to name your packed EXE. Click Next when you're ready to proceed.|
|8) Last step! You may step back if you want to review your choices before going on. When you're ready to make your packed EXE click on the Build button and FilePacker should make your EXE!|
|9) That's it! If your lucky FilePacker just made a single EXE of all your files and now you just have 1 file to distribute and worry about instead of a bunch. Most people will never notice that it's a special EXE. What's more, you can even drag & drop a file on this new EXE and it will pass the command line parameters to the EXE inside!|