In the QB64PE v3.10.0 announcement thread @RhoSigma mentioned 3 MinGW directories which add a lot of unnecessary weight to a QB64PE installation on Windows (something like 155 megabytes spread across 15000 files).
@Kernelpanic posted a VB Script file for removing those directories, and I posted a batch file to do the same.
Why did neither of us think to post a program in the language of the forum?
I dunno, but here's an attempt to set things right.
This is a useful, totally optional program which can double as a test of successful QB64PE installation.
@Kernelpanic posted a VB Script file for removing those directories, and I posted a batch file to do the same.
Why did neither of us think to post a program in the language of the forum?
I dunno, but here's an attempt to set things right.
This is a useful, totally optional program which can double as a test of successful QB64PE installation.
Code: (Select All)
Option _Explicit
'2023.12.29, J.S.Race. Public Domain.
'Have fun with it, because I'm done with it.
Dim ccomp$, yupok$
ccomp$ = ".\internal\c\c_compiler\"
Cls
'Verify that we're on Windoze....
'Old joke: "A computer is like air conditioning - it becomes useless when you open Windows" --Linus Torvalds
If Left$(_OS$, 9) <> "[WINDOWS]" Then
Print: Print "Sorry, this program is only for Windows"
End
End If
'Verify that we're in the QB64PE directory....
If Not (_FileExists(".\qb64pe.exe")) Then
Print: Print "Sorry, this program must be run from the directory which contains 'qb64pe.exe'"
End
End If
Print "***********************************************************************"
Print "* This program will delete three MinGW GCC directories which are *"
Print "* not required for QB64PE operation. *"
Print "* *"
Print "* These directories contain about 15000 files and consume about 150 *"
Print "* megabytes of disk space. *"
Print "* *"
Print "* These directories and the files they contain are required for legal *"
Print "* distribution of GCC and QB64PE, but you may safely and legally *"
Print "* delete them from your own personal installation. *"
Print "***********************************************************************"
Print
Input "Enter 'Y' (uppercase only) to proceed: ", yupok$
If yupok$ = "Y" Then
REMOVE_DIR (ccomp$ + "licenses")
REMOVE_DIR (ccomp$ + "opt")
REMOVE_DIR (ccomp$ + "share")
Else
Print "Operation aborted by user."
End If
Print
Print
End
Sub REMOVE_DIR (D$)
Dim O$
'QB64's "RMDIR" will not delete non-empty directories which means
'we would need to walk the tree of subdirectories deleting all files
'and subdirs contained within those directories before deleting the
'directories themselves... if we use QB64 commands only.
'Instead of doing that, we will let Windows handle all the gory details....
If _DirExists(D$) Then
O$ = "RD /Q /S " + Chr$(34) + D$ + Chr$(34) '("RD /Q /S" is silent, but deadly. Handle with care.)
Print O$
Shell _Hide O$
Else
Print "Directory not found "; Chr$(34); D$; Chr$(34)
End If
End Sub