Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making files more portable
#6
(10-21-2024, 05:14 PM)SMcNeill Wrote: I've always just found the easiest way to make a 7z self-extracting EXE is to use the 7z File Manager.  Select what files/folders I want, click the Add button, fill out the settings in the pop-up that makes the archive.  Just be certain to check the "Make SFX archive" button before clicking OK to finish.

Well, I don't wanna brag, but:

      Tongue
(Let's hear it for ludicrously long Send To menus!)
(Actually, "Quick7z exe" is the one that I would use.  The highlighted menu item turns a .ZIP file into a self-extracting .EXE that runs on Windows OR DOS.)

But anyway, the party trick I described actually runs the archived software from Windows TEMP folder then deletes it all without a trace when done.
  • Need to compile FIZZBUZZ.BAS and nothing else?  Simple click&drag FIZZBUZZ.BAS onto qb64pe_win-x86-3.14.1__(+GCC-13.2.0)_(Vista+)_7zXu.exe and after a few seconds  FIZZBUZZ.EXE will magically appear.
  • Want to install QB64PE?  Open a command prompt and type "qb64pe_win-x86-3.14.1__(+GCC-13.2.0)_(Vista+)_7zXu.exe UNPACK" and voila!  There it is!

(I append "_7zX" to the self-extractor file name to remind myself what it is.  "_7zXu" files have an UNPACK option.)

(Some anti-malware installations may complain about running executables from TEMP, but I haven't had any problems yet.  Knock on wood.  If worse comes to worst, 7Zip can unpack it's own installers, and many other types of installers as well.)

Depending on the batch script which drives the package, many other options may be available.  Here's an example of what  qb64pe_win-x86-3.14.1__(+GCC-13.2.0)_(Vista+)_7zXu.exe can do:

fullauto <name.ext> : Auto-select Basic IDE, or C/C++ console mode compile.
ide [name.ext]        : Start the QB64PE IDE.
cmdline                   : Open a Command Prompt in the QB64Pe temp directory, with PATH set appropriately.
bcomp <name.ext>      : Compile using QB64PE with the "-c" & "-s:exewithsource=true" flags.
cc <name.ext>         : Auto-select C or C++ console mode compile.
ccon <name.ext>       : Compile a Windows console-mode C program.
cppcon <name.ext>     : Compile a Windows console-mode C++ program.
cgui <name.ext>       : Compile a Windows GUI C program.
cppgui <name.ext>     : Compile a Windows GUI C++ program.
make [options]      : Run MinGW32 Make.
unpack [path]    : create a directory named "qb64pe" in the specified path, which must exist.

Default mode is fullauto if a filename is given and no mode is specified.
Default mode is ide if no filename is given and no mode is specified.

For a compiler suite like PE there is one big batch script driving everything.  If the UNPACK option is used then a whole set of batch files are made available (one for each option), allowing simple click&drag operation of the compiler(s) for simple uses.

(A note from the Distributor of TMI: After writing too many batch scripts for too many _7Zx archives I finally created a batch file generator that uses relatively simple .INI files to generate the needed batches.)

(protip for command-line noobs: don't type a stupidly long filename like " qb64pe_win-x86-3.14.1__(+GCC-13.2.0)_(Vista+)_7zXu.exe".  Use <TAB> command completion or right-click the .EXE and rename it first.)

The usefulness of this technique is subjective.  It started off with an "I wonder...." moment and turned into a pet project from there.
Reply


Messages In This Thread
Making files more portable - by JRace - 10-21-2024, 12:40 AM
RE: Making files more portable - by SMcNeill - 10-21-2024, 11:22 AM
RE: Making files more portable - by Dav - 10-21-2024, 01:14 PM
RE: Making files more portable - by JRace - 10-21-2024, 04:46 PM
RE: Making files more portable - by SMcNeill - 10-21-2024, 05:14 PM
RE: Making files more portable - by JRace - 10-21-2024, 05:29 PM
RE: Making files more portable - by grymmjack - 10-24-2024, 07:32 AM
RE: Making files more portable - by bplus - 10-24-2024, 02:07 PM
RE: Making files more portable - by euklides - 10-25-2024, 01:37 PM
RE: Making files more portable - by JRace - 10-26-2024, 02:16 PM



Users browsing this thread: 1 Guest(s)