The purpose is to prevent potential bugs/error message to appear when application uses uninstall section of the inf and update the entries in sysoc.inf.
When 2 applications are uninstalled via it's inf, the whole portion of [Components] section added by HFSLIP is wipe out. (I think XP does not know how to process more than 1 [Components] section.) The error message appears when you click on "Add/Removes Windows Components" in Add/Remove Programs.
To prevent this, the [Components] section need to defrag. I think nlite & RMVi called it optimizing sysoc.inf. I called it defrag sysoc.inf since everyone understood what 'defrag' generally means
- Put DefragSysoc.exe in HFTOOLS (will only work from this location)
- Create HFSLIP_POST_DefragSysoc.cmd in HFTOOLS, with code or DL the simple cmd attachment
"%~dp0DefragSysoc.exe"HFSLIP_POST_DefragSysoc.cmd 148bytes 30 downloads
DefragSysoc.exe now match mulitple [Components] section's items using regular expression:
$sCmpList=StringRegExp (FileRead ($FHopen),'(.*=[^\d].*,\s?\d)',3)*Pls feedback if the regular expression match or miss some strings that is not part of [Components] items.
A backup copy is created in SOURCESS\I386\SYSYOCBAK.IN_ just in case.
This is the exact copy that HFSLIP created. (When expand, it's filename is SYSOC.INF, and not SYSOCBAK.INF)
DefragSysoc.exe includes some error handling situation. In such event, no changes will be made to your SYSOC.IN_
Error message will pop up, required user to acknowledge the problem found and script will exit.
DefragSysoc.exe will run silently/unattended if no problems are found and can defrag successfully.
A defraged sysoc.in_ file size should be smaller than SYSOCBAK.IN_
====Edit3:Add: /nobackup switch if you wish SYSOCBAK.IN_ to be deleted.
Change HFSLIP_POST_DefragSysoc.cmd to
"%~dp0DefragSysoc.exe" /nobackupAdd defrag runtime when use with /nobackup via DefragSysoc.log (loc in HFTOOLS)(DefragSysoc.exe generally runs under < 1 sec)
Pls test in virtual machine to verify.
I tested in XP Pro with hfslip-1.7.10_beta_J.
Hope this is useful...
Size: 356.97 Kb (365,541 bytes)
Edited by Geej, 30 April 2010 - 12:32 AM.