Project FGCBA
History
This is a program I started writing in order to help addon pack makers. I was inspired to write it after the SysInternals addon packs (which were a favourite of mine) were withdrawn due to licensing issues...
I thought, why then can't I just download the files, and using just the addon's blueprint (the entries.ini file) build the addon ? This is when FGCBA's concept came into existence.
FGCBA was a program designed to read the addon's entries.ini file and simply list the needed files so that I could easily compress them to make my own addon. Soon I started adding more features to enhance it and increase its capabilities.
Features
In the current version, the following features are available:
- Pre-processing and parsing of the entries.ini and any referenced external INFs and reporting of common errors.
- Support for renaming files from their long names to their short names automatically based on the syntax specified by the addon creator.
- Testing of ready-made addons by simply dropping the CAB file on FGCBA.EXE. It will automatically uncompress the CAB to a temporary folder, uncompress any files inside and attempt to parse the entries file and any external dependancies.
Requirements
FGCBA requires the following programs to function properly:
- Microsoft .NET Framework 2.0 Final (because it is written in C#)
- Microsoft CAB SDK (for CabArc.exe)
Usage Information
FGCBA can run in one of 3 modes:
- Chain process files (entries.ini) / Create addon CAB mode
- Test addon CAB mode
- Test External INF mode
| Parameter | Meaning |
|---|---|
General Notes:
| |
| entries.ini | The entries.ini file to start parsing from. Relative and absolute paths are supported. |
| /cab:"AddOn_Cab.cab" | [Optional] Tells FGCBA to attempt to create a complete addon CAB and specifies the name of the CAB file to create.
|
| /useDI | [Optional] Tells FGCBA to parse the external INF (if one is referenced in entries.ini) by following the [DefaultInstall] section instead of the normal routine (ie: by following the [Optional Components] section). If the [DefaultInstall] section does not exist, this switch is ignored and parsing continues using the normal routine. |
| /QuirksMode | [Optional/EXPERIMENTAL] A special switch that tells FGCBA to ignore the absence of both the [txtsetup_files] and [dosnet_files] sections in the entries.ini file. It will also cause FGCBA to attempt to continue even if there are generated errors. This is untested, use at your own risk ! |
| /log:"LogFile.txt" | [Optional] Tells FGCBA to write detailed logging information into the specified log file, this information is very useful especially for diagnosing problems with FGCBA as it contains stack traces for any unexpected exceptions. If this switch is specified, FGCBA will not pause at the end of execution. |
In the 2nd mode, FGCBA accepts the following syntax:
where "AddOn.cab" specifies the addon CAB to test and the other switches have been explained in the table above.
AddOn CABs are tested by uncompressing to a temporary folder, looking for the 1st entries.ini file and then starting to process it normally, then the temporary folder is deleted at the end.
In the 3rd mode, FGCBA accepts the following syntax:>> Errorlevel return values:
0 - No errors
5 - Argument Error (invalid parameter / invalid CAB filename)
6 - Errors were generated
7 - A file was not found: entries.ini / CAB / external INF
8 - An error occured during creation of a CAB file
9 - Unsupported Path Format
10 - Uncaught exception (Crash) - This should almost never appear.
Download:
The latest version of FGCBA is currently: 0.897
You can download FGCBA here:
Site: Download FGCBA
md5: 76348B5128BBCF4E3F34F42672E15704
Changelogs:
0.86:
- Native support for switchless installer addon packs (and their checking.)
- Support for reading [SourceDisksNames] in addition to [SourceDisksNames.x86]
- No more warnings about [SourceDisksNames]/[SourceDisksNames.x86] not existing if these sections didn't exist in an External INF that didn't use the CopyFiles directive.
- Fixed minor bug where extra whitespace wasn't being removed when reading [dosnet_files] and [txtsetup_files] entries.
0.851:
- fixed: Fixed regression from LargeListDictionary using obsolete method to do a case-insensitive compare resulting in case-sensitive section matches.
- enhancement: Variables in AddReg / DelReg are checked if they are environment variables to prevent unnecessary warnings (eg: Unassigned Variable: %SystemRoot%, Check Whatever.inf)
0.85:
- fixed: CabArc.exe detection was not working (typo).
- fixed: Do not strip extra \r\n's from comments before 1st section in INF / INI file.
- fixed: No longer messing up of section ordering if INI/INF contained more than 10 sections (.NET HybridDictionary behaviour).
- fixed: i386 folder is now correctly added recursively into the AddOn CAB including any subfolders. (However, I can't get CabArc.exe to add Empty folders into the CAB no matter what I do...)
- updated: Reg2Inf engine to 0.25 (without experimental /RepVars support)
0.811:
- Fixed: Could not match section if any whitespace was present on same line as [SectionName]
- Fixed: SimpleINIEditor would sometimes stop parsing a section's data if it reached a comment.
- Fixed: Bug in ArrayList.BinarySearch caused reference mismatches.
0.81:
- Fixed: Could not match section if any whitespace was present on same line as [SectionName]
- Fixed: SimpleINIEditor would sometimes stop parsing a section's data if it reached a comment.
- Fixed: Bug in ArrayList.BinarySearch caused reference mismatches.
0.80:
- Complete rewrite of SimpleINIEditor.cs (v3)
- Syntax checks for AddReg / DelReg
- Syntax checks for ExtraFileEdits (check no. of poles) and make sure a number value is specified at the end of the line.
- Fixed a bug where in some cases special characters in section name would confuse SimpleINIEditor (fixed while rewriting)
- Support for launch with External INF as 1st parameter for pre-processing.
- Proper return of errorlevel values
- Complete switch to using only CabArc.exe (replace MakeCab.exe & Extract.exe) - Now only needs EXPAND.EXE and CABArc.exe, better code for checking their existence too !
- Code cleanup, Enhancements to logger.
- Check unassigned variables
- In case of double-directives (double AddReg= statement (eg: RVMUpPck.inf)), only the 1st instance is processed. - implement ref counts inside SimpleINIEditor
- Fixed uncompressing compressed External INF was broken (Regex One Liner Fix) (, RegexOptions.IgnoreCase).
- DestDirs - referenced section does not check RenameDictionary for possible renaming operations if the section contains a file previously referenced and has a rename operation set (situation occurs in uninstallable INFs)
- You could specify a non-existant section in the CopyFiles directive and FGCBA would not regard this as an error.
- Fixed: FGCBA was not detecting invalid syntax in [dosnet_files] section.
0.721:
- Fixed issue where filenames with characters like + caused internal dynamically generated Regular Expressions to fail.
0.72:
- Updated Reg2Inf to version 0.23.
- Reg2Inf will now not remove the magic comment if it fails to convert the REG file.
- Added DelReg functionality (to use you must insert a magic comment into the DelReg-referenced section pointing at the same REG file if the REG file contains removal instructions).
0.711:
- Fix for reading non-Unicode files (FGCBA will try to detect the encoding used for reading the REG file).
- Cosmetic Fixes in error messages.
0.71:
- Fix for Reg2Inf parser not properly converting empty keys (esp. REG_MULTI_SZ / REG_BINARY and REG_EXPAND_SZ)
- Added support for hex(0) (REG_NONE)
0.70:
- FINALLY full featured Reg2INF parser implemented into FGCBA (supports REG_SZ / REG_MULTI_SZ / REG_EXPAND_SZ / REG_DWORD / REG_BINARY)
- FGCBA will now be available for download in ZIP format (to reduce size and reduce bandwidth consumption)
0.69:
- Bug fixes in parsing of [SourceDisksNames.x86] section, was failing when the name was wrapped in quotes and preceeded by a space.
- Enhancements in the console output (more messages) and more information in the log file.
- Changed /SImode to /QuirksMode and added new functionality of continuing despite errors (Experimental - can cause broken addons)
- Bug fixes in argument parser to fix detection of double specified switches and invalid switches.
- Enabled AddOn testing mode to accept the same switches as the normal mode (except /cab of course which gets overridden internally).
- Minor fix in [dosnet_files] and [txtsetup_files] for better handling of empty lines (simply looking for them explicitly and dropping them).
0.68:
- Bug Fixing in parsing ProfileItems sections, some things were not being checked correctly.
- Fixed a bug due to AddShortcuts parser not making sure that it is adding the found shortcut names only once (causing an exception if 2 different shortcuts are present in the same ExternalINF with the same name)
- Fixed a bug with PNF dropping mecahnism incorrectly being case-sensitive.
- Implemented a proper logging mechanism that logs all console output + Internal Debug messages for help with diagnosing bugs in the future, this adds a new switch /log.
0.66:
- Major bug fix in shared variable substitution function when more than once variable is specified in the input dictionary.
- 100% compliance with Gosh MSFN TXTSETUP.SIF Guide and RyanVM TXTSETUP.SIF syntax (and strict checking and enforcement of the correct syntax, even the numbers are now checked and _x is processed).
- Files with _x flag are now correctly copied without being compressed
- Some cosmetic fixes and corrected some error messages (eg: changed [txtsetup_entries] to [txtsetup_files] in error messages)
- DefaultInstall warning restored, pause only at the end of execution to show non-fatal warnings (no more PAUSE in the middle of execution).
- Re-released to fix crash on output redirection by removing the screen buffer increase.
0.65:
- Some bug fixes
- Detection of variables incorrectly set more than once in entries.ini and External.INF.
- Moved variable substitution to shared functions and some optimization in variable substitution speed.
- In testing AddOn CAB, the CAB is no longer created (since this is not needed and wastes time), instead all prebuild checks are done and then FGCBA terminates.
0.611:
- Absence of [DefaultInstall] section in External INF is now ignored (but you can still use /useDI if it exists to check it).
0.61:
- Many bugfixes in External CAB creation (fixed putting LFNs in temporary MakeCab directive file causing MakeCab to fail)
- Fixes in CAB uncompressing in 2nd behaviour failing if using relative paths...
- Fixes in 8.3 compliance checking considering files with a - $ ! and ~ characters not compliant although those characters are valid.
- Fix bug with parsing empty [sysoc] section.
0.60:
- Checking of file type specified in 1st parameter via extension, FGCBA will only run if the file extension if INI or CAB.
- Fixed a bug with [DefaultInstall] and [Optional Components] directives processing being incorrectly case-sensitive.
- Added new behaviour for easy testing of AddOn CABs.
- Added checking of files for 8.3 compliance in entries.ini sections and svcpack catalogs.
- Minor improvements.
0.54:
- Fixed a bug where the new RefCount mechanism broke the workaround used for dropping PNF file from processing (in uninstallable INFs)
- Fixed a bug where specifying a relative path to the INI and using old behavior in /CAB would lead to MAKECAB not finding the needed files.
(Fixed by making FGCBA change the Current Directory to that containing the INF before creating the AddOnCAB)
0.53:
- Checking of AddReg, DelReg and DelFiles directives in Optional Components and [DefaultInstall] (when /useDI is specified) to make sure that sections referenced by them exist... (No more typos in the AddReg directive Ryan !)
- Addition of the /SImode switch.
- More precise syntax checking in [sysoc] section.
0.521:
- Moderate Improvements...
- Added ability to blindly add files to the AddOn CAB (For example: for directly overwriting files in I386) by creating a subfolder "i386" in the folder containing the INI file and putting these files there, subfolders are supported too...
- Improved argument parser to allow dropping of INI files on FGCBA.exe for quick pre-processing.
0.51:
- Semi-big changes...
- Error checking has been extended and improved: No more vague (No. of files here != there) unhelpful error messages (for the most part)...
- FGCBA checking uses a new mechanism which allows it to explicitly find out the names of repeated filename entries and orphaned entries in each of either interdependant sections in both External INF and entries.ini...
- Subtle syntax checking in [SourceDisksFiles] section of External INF
- Fixed bug with FGCBA dropping a .LNK file if a shortcut with the same name is defined with ProfileItems and it exists as a file defined by [SourceDisksFiles]...
0.50:
- Now FGCBA checks for orphaned files in CopyFiles sections (and names them too for easier troubleshooting) and checks for double entries in [SourceDisksFiles]...
- Referencing a file specified by [SourceDisksFiles] more than once in different CopyFiles section will trigger a warning (but not a fatal one and FGCBA will continue)
- If for some reason FGCBA fails to identify conflicting files, it will fallback to classic file number checking (except for LNK files that were defined by ProfileItems of course)
- This is accomplished through a RefCount table...
- FGCBA will now pause if non-fatal warnings happen to allow the user to evaluate the warnings first... (They are already displayed again after the creation of an AddOn CAB)...
0.49:
- Fix issues with case-sensitivity when matching sections and looking for keys.
- Now, only shortcuts that are defined with ProfileItems will be dropped if found in any CopyFiles sections (for support with uninstallable INFs)
- Some enhancements in INF parser...
- Now can re-create Kel's Uber Pack correctly (without the files that directly overwrite those in i386 folder)
0.45:
- Major rewrite of entries.ini parser:
- Syntax checking of txtsetup.sif entries, dosnet.inf and sysoc.inf entries.
- Improvements to RegEx match expressions.
- Support case where the external INF itself is renamed via Txtsetup.sif (but this is not recommended)
- Moved to dictionary approach for entries.ini parser and external inf parser renaming routines.
0.40:
- 85% rewrite of External INF parser:
- Finally multiple external CAB file INFs are now fully supported with enhanced error-checking for orphaned entries and duplicate CABs across multiple INFs.
- Much better support for entries.ini files that specify more than one INF file in [sysoc] section.
- Better error checking during CAB creation (check for empty CABs).
0.36:
- Added support for uninstallable INFs.
- Fixed support for INFs that create shortcuts (by intentionally dropping .lnk files from processing)
- Fixed issue when MakeCab.exe cannot find its temporary directives file if the %TEMP% variable had spaces.
0.35:
- Optimized Regular Expressions
- Enhancement: Now processes DestinationDirs and all sections referenced by it, checking to see if all files in [SourceDisksFiles] are
in the dependant [CopyWhatever] sections and vice versa, FGCBA now has the ability to rename files from Real Name to Short Name according to the external INF (like it already does with TXTSETUP.SIF)...
0.332a:
- Fixed a freeze in MakeCab.exe if launched without ShellEx.
- Added more error checking during compression of files.
- CabArc.exe now outputs to same window for diagnostic output.
- FGCBA now checks existance of MakeCab.exe and CabArc.exe before
creating any compressed files and prompts user to download MS CAB SDK if any of them doesn't exist...
(I even provide a tinyurl link to the direct download)...
0.331:
- Fixed a problem with renaming file from real name to DOS name as specified in TXTSETUP.SIF), eg: "SysInternals Bluescreen.scr" to "Bluescr.scr" if the name specified in TXTSETUP.SIF contained spaces (and quotes)
0.33:
- Fixed a problem with paths containing spaces when extracting compressed external INF for further processing and other problems with processing SourceDisksNames.x86 and SourceDisksFiles sections.
0.32:
- Fixed problem with parsing entries.ini file that did not have a [filenames] section...
- Changed SourceDisksFiles section not found in external INF from fatal error to warning as some addons use external INF only for creating shortcuts...etc., the warning will still be displayed to inform the user.
0.31:
- Fixed various problems with RegularExpressions matching in SVCPACK (now only .CAT files will be found)
- Fixed incorrect handling of paths
- Updated Usage Information to correctly point out all switches with
examples.
- Cosmetic Fixes.
- Fixed bug when handling paths with spaces (I got burned by that too)
0.30:
- Initial release with CAB building enabled.
Previous releases were only logic tests hence no changelogs prior to version 0.30 are available.
Report a Bug:
To report a bug please run FGCBA with the /log switch and then post it along with an example of the problem addon in the RyanVM.net forum thread which is accessible from the navigation bar on the left.
I will examine the logs and the addon and try to fix any bugs as soon as possible.
License:
Terms:
The license is simple, you are free to use this program for personal use.
To include in other programs please ask permission first (I like to know where FGCBA is being used).
This program is not open-source (yet) but I will release its source when I reach the 1.0 milestone. Please do not disassemble or reverse-engineer it.
Standard Disclaimer:
Although I try my best to make sure that FGCBA does not have bugs, it is still considered in a DEVELOPMENT STAGE, which means that it may contain bugs and I cannot be held responsible for any damage resulting from FGCBA's use.
Credits:
I would like to thank the following for helping in one way or another:
- RyanVM for his tremendous work (I wouldn't have thought about any of this if it wasn't for his awesome update packs).
- Xable for kindly hosting FGCBA.
- odyn1982 for testing and suggesting new features which led me to learn INF files and greatly enhance the ExternalINF Parser.
- Aserone for suggesting good features and for reporting bugs.
- Siginet for providing a forum.