(12-21-2023, 09:25 PM)Kernelpanic Wrote: Nice Christmas present! Thanks to everyone who shows so much enthusiasm in their free time.
Thanks also for the tip about being able to delete unnecessary files. A bat file or a WSH script would be of no use because one don't know how the users' system is structured. It would perhaps make sense to include a text: “Please read the note” and then a short explanation.
Here is a first attempt with the new possibilities. The 7z file also contains the image. The path must be adjusted of course .
Code: (Select All)
'Neue Funktionen im Version 3.10.0 - $Embed + _Embedded$
'21. Dez. 2023
Option _Explicit
$Embed:'D:\Lab\QuickBasic64\Uebungen\Embed\Pizza2.jpg','Pizzawein'
Dim As Long piz
Screen _NewImage(1000, 650, 32)
piz = _LoadImage(_Embedded$("Pizzawein"), 32, "memory")
_PutImage (5, 4), piz
_FreeImage piz
End
Actually, a batch/PowersHell/VBS/whatever file like I described would work just fine. It would be written to use relative paths from wherever it was installed WITHIN the QB64PE directory tree (which is known, and identical for ALL Windows QB64Pe installations). The user's Directory structure OUTSIDE of the PE installation would be irrelevant.
Example batch file for Windows, which would run from the same directory as 'qb64pe.exe':
Code: (Select All)
@ECHO OFF
2023.12.19, J.S.Race. Public Domain.
SET CCOMP=.\internal\c\c_compiler
ECHO ***********************************************************************
ECHO * This program will delete three MinGW GCC directories which are *
ECHO * not required for QB64PE operation. *
ECHO * *
ECHO * These directories contain about 15000 files and consume about 150 *
ECHO * megabytes of disk space. *
ECHO * *
ECHO * These directories and the files they contain are required for legal *
ECHO * distribution of GCC and QB64PE, but you may safely and legally *
ECHO * delete them from your own personal installation. *
ECHO ***********************************************************************
ECHO.
SET /P YUPOK="Enter 'Y' (uppercase only) to proceed: "
IF NOT "%YUPOK%"=="Y" ECHO Operation aborted by user. & GOTO hawaii
@ECHO ON
RD /Q /S "%CCOMP%\licenses"
RD /Q /S "%CCOMP%\opt"
RD /Q /S "%CCOMP%\share"
@ECHO OFF
:hawaii
ECHO.
ECHO.
PAUSE
I've written countless little throwaway scripts like that over the years.
Speaking of relative paths: there would be no need to adjust the path in your demo if you use a relative path instead of a hard-coded absolute path. $Embed:'.\Pizza2.jpg','Pizzawein' would work for most people, regardless of their system directory structure.
A program being released into the world should not depend on any one person's choice of directory structure. It's bad form.
And now I'm hungry. Mmmm, pizza....