Jump to content

Defraging sysoc.inf in your SOURCESS


Geej

Recommended Posts

Simply place all four files (shown below) in HFTOOLS and let both run as they will abort if not needed.

- DefragSysoc.exe and HFSLIP_POST_DefragSysoc.cmd

- Defrag2Sysoc.exe and HFSLIP_POST_Defrag2Sysoc.cmd

In the future, consider (if it makes sense to you) combining DefragSysoc.exe and Defrag2Sysoc.exe, with a branch to the correct logic.

This seems obvious. Doesn't make sense to have to need both versions when they could be combined. And on those rare occasions when there are more than 2 components sections, couldn't it be made to handle those, too, if indeed it is always better to only have 1 section?

Just putting the cmd file(s) in HFTOOLS causes them to be run, right?

No one has addressed the question "Why would you not want to run it and defrag sysoc.inf?" And if we always would want to run it, shouldn't we lobby tommyp to fold the functionality of this into HFSLIP itself? Giving full credit to Geej, of course. Then you wouldn't have to add anything anywhere. I mean, if the actions of HFSLIP causes this situation, and if it is better if this situation is cleaned up, then shouldn't HFSLIP "clean up its own house"? (Absolutly no offense meant, tommyp! :) ) I guess if Geej is right in his original post and both nLite and Ryan's Integrator both do something similar, it kind of implies ... Well, anyway, just a thought to consider. I realize that there could very well be extremely valid reasons that I am not aware of as to why it should be an "external" option, or maybe not be done at all. I'm interested in hearing the opinions of others, especially tommyp and fdv. After all, their thoughts are the ones that matters most, with their experience, knowledge, and control of the inner workings of HFSLIP.

Cheers and Regards

Edited by bphlpt
Link to comment
Share on other sites


Lilla, bphlpt & Mino

Just to sum up my thought too...

Lilla has pointed correctly that this is a subtle problem that most are not aware of. I only aware of it when I was learning inf addon. I observed nlite & RMVi user do not complain after uninstall application from sysoc.inf. Which made me observed/monitor entry to sysoc.inf after an uninstall. Hence my observation that the whole portion made by HFSLIP is wipe out after sysoc.inf did an update to it's entry. Also I compare sysoc.inf made by nlite & RMVi. nlite can combined any multiple section of [Components] while RMVi only combine 1st & last sections of [Components], leaving out the middle [Components].

Most of HFSLIP's user do not test the uninstall part of sysoc.inf application. So I think they do not see this subtle problem.

If user do not feed their HLSliped sourcess to nlite or RMVi, this utility is useful. No harm using it, right?

bphlpt, just follow post #1 instruction if you want to use it. Ignore #9. #9 is developed due to the unique situation of Lilla. I hope any user who wish to defrag their sysoc.inf, please stick to #1 instruction. (There is no need to download both exe.). Also I use #1's exe myself

In my opinion, if you use HFSLIP only to slipstream, then I think it is pretty essential. Unless you don't use sysoc addon.

Min0, there is no fix [Components] section in your SOURCE. It may varies by the number of [Components] section. I'm unable to write a complex script when input varies. Hence user need to ensure sysoc.inf In SOURCE has a predefined sequence. You only need to edit once in your SOURCE. After that, you can re-slip over and over again. (not too hard, right?)

The problem only appear when an application does it uninstall thru it's inf and update the entry (by deleting) in sysoc.inf. You need to check the program's inf whether it has an update to sysoc entry or not. This part is subjective.

I would also love to hear from others esp tommyp and fdv too

Cheers

Link to comment
Share on other sites

Could this be a solution: I've wrote a script for defragmenting, regardless how many components-sections are inside of the inf. I compared it with the INFs of Lilla's attachement - the result is exactly the same. When no changes are required, probably tommy can add it into HFSLIP?

@ECHO OFF

SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

CALL :DfrgInf SOURCESS\I386\SYSOC.IN_
GOTO :EOF

-------------------------------------------------------------------------
Function: DfrgInf - Defragments an INF-file (e.g. SOURCESS\I386\SYSOC.IN_)
Parameters:
%1 - Path and name of the compressed INF-file (*.IN_)
-------------------------------------------------------------------------
:DfrgInf
SET infFile=%1
IF EXIST !infFile! (
SET tmpInf=%~n1.INF
SET tmpPrefix=~dfrg_
SET section=
SET sects=
DEL !tmpPrefix!*.tmp >NUL 2>NUL
EXPAND !infFile! !tmpInf!>NUL
FOR /F "tokens=1 delims=|" %%a IN (!tmpInf!) DO (
SET line=%%a
SET firstChar=!line:~0,1!
IF !firstChar!==[ (
SET section=!line:[=!
SET section=!section:]=!
SET sects=!sects! !section!
) ELSE IF NOT !section!_==_ (
ECHO %%a>>!tmpPrefix!!section!.tmp
)
)
ECHO.>!tmpInf!
FOR %%s in (!sects!) DO (
IF EXIST !tmpPrefix!%%s.tmp (
ECHO [%%s]>>!tmpInf!
COPY !tmpInf!+!tmpPrefix!%%s.tmp !tmpInf! >NUL 2>NUL
DEL !tmpPrefix!%%s.tmp
ECHO.>>!tmpInf!
)
)
MAKECAB !tmpInf! !infFile!>NUL
DEL !tmpInf! >NUL 2>NUL
)
GOTO :EOF

Edited by Mim0
Link to comment
Share on other sites

Mimo, I agree, it would be GREAT if tommyp could including your script (or whatever it takes to handle all situations) in HFSLIP.

bphlpt, just follow post #1 instruction if you want to use it. Ignore #9. #9 is developed due to the unique situation of Lilla. I hope any user who wish to defrag their sysoc.inf, please stick to #1 instruction. (There is no need to download both exe.). Also I use #1's exe myself

In my opinion, if you use HFSLIP only to slipstream, then I think it is pretty essential. Unless you don't use sysoc addon.

To this I would add, from my experience, if you follow the instructions in post #1 (uses SysocDefrag.exe and HFSLIP_POST_SysocDefrag.cmd) and you get a popup (similar to the one shown below), then try using the instructions in post #9 (uses Sysoc2Defrag.exe and HFSLIP_POST_Sysoc2Defrag.cmd) and see if that doesn't work for you as it works for me. The popup below (if it applies to you) will appear when HFSLIP.cmd runs SysocDefrag.exe.

SysocDefrag.exe: Error Found (message title)

3 [components] sections detected.

This script will work with only 2 [components] sections.

Nothing has been modifed.

Geej, thank you again for your good work. I feel the above should be added to your instructions because don't see any reason why my very vanilla build would be "unique". I fully expect there will be others that need to use Sysoc2Defrag too. I wonder if the right one to use (SyocDefrag or Syoc2Defrag) is related to the CD one uses for their source. I use a MSDN CD, as shown below.

My very vanilla build:

o Windows XP Pro Gold (aka SP0). Source: MSDN CD contains both Pro & Home, I use the Pro branch.

o I include almost all updates on mimo's list. I exclude a few like EUROPE updates and update for VM.

o I use mimo's file checker.

o I do not use HFCLEANUP, NLITE, or RYAN's stuff in my latest builds. I use only HFSLIP.

o I do not integrate drivers in my latest builds. I install the official drivers after I install the OS via HFSLIP CD.

o I include two addons for Microsoft CPL applets: Kels_ClearType_addon_v1.2.CAB, Kels_TweakUI_Addon_v2.10.0.0.cab

o I include HFANSWER.INI with just one non-default setting: I set the option to install the Registry Console.

o I include a few reg tweaks, mostly from Kellys-Korner-XP.com

o I include Sysoc2Defrag.exe & HFSLIP_POST_Sysoc2Defrag.cmd (SysocDefrag does not work with this very vanilla build)

I've attached my HFSLIP.log so anyone interest can see just how vanilla my build is.

HFSLIP.zip

Edited by Lilla
Link to comment
Share on other sites

Well, tommyp's opinion is to keep this as an external command. So between Geej and Mim0, can we get this finalized, spiffed up, and made as easy to use as possible such as a single exe or cmd file, so we can at least get this "officially" sanctioned and maybe listed under "User Contributions"? Maybe then after enough people learn about it and use it tommyp might change his mind. And who knows, we haven't heard fdv's opinion yet.

Cheers and Regards

Link to comment
Share on other sites

This is a test user can try.

To see sysoc.inf entry when sysoc perform a delete operation, you can perform the following test in virtual machine.

Do not defrag your sysoc.inf

Add these 3 applications to HFAAO:

(These have 'delete operation' to sysoc.inf when you uninstall the program.)

1) OpenSelectedURL_True_Addon.cab ;

2) Doug_UberIcon_AddOn_v2.0.7z (There is a small bug in it's inf. Pls edit it's inf in [sysoc.Edit] section)

[sysoc.Edit]

;%17%\sysoc.inf,Componets,UberIcon=*

%17%\sysoc.inf,Components,UberIcon=* ; replace with this line as there was a misspell of Components

3) RandomWallChanger_Addon.cab ;

Slipstream it. Then after you have install in VM, open up C:\WINDOWS\inf\sysoc.inf to view. (save a copy as backup to My documents)

You should see at least 3 entries in your sysoc.inf

[Components]
RWPC=ocgen.dll,OcEntry,RWPC.inf,HIDE,7
UberIcon=ocgen.dll,OcEntry,UberIcon.inf,HIDE,7
OpenSURL=ocgen.dll,OcEntry,OpenSURL.inf,HIDE,7

Close sysoc.inf

Now uninstall UberIcon 1.0.4 by clicking the 'Remove" button.

Open up Sysoc.inf again. The whole part of HFSliped [Components] sections is now gone. (just by uninstall 1 program)

===== Let do another test by cleaning up IE6 icon in Add/Remove Windows Components =====

OC_thumb.png

Edit sysoc.inf in My Documents and place a semi-colon at the beginning of UberIcon entry as below:

;UberIcon=ocgen.dll,OcEntry,UberIcon.inf,HIDE,7

Save the file and copy back to C:\WINDOWS\inf. Replace it when prompt.

Use/create this cleanup file, ClnupSYSOC.inf by right-click and Select 'Install'

;ClnupSYSOC.inf

[Version]
Signature=$Windows NT$

[Defaultinstall]
UpdateInis =SYSOC.Edit

[SYSOC.Edit]
%17%\sysoc.inf,Components,IEAccess=* ;Remove Internet Explorer 6 icon

Re-open sysoc.inf. You will see that HFSliped [Components] portion is wipe out too. (BTW, IE6 icon is gone now)

=====

All these problems would go away if sysoc.inf is defraged.

=====

It would be nice of Mim0 since he can provides the cmd script as it can defrag any numbers of [Components] sections.

The whole idea is to give a solution to it, irregardless who provide the solution.

Added #9 link alternative to #1 as per Lilla suggestion.

Link to comment
Share on other sites

This is a test user can try.

To see sysoc.inf entry when sysoc perform a delete operation...

Thx for the detailed explanation what can happen with a fragmented sysoc.inf. It's really great that you figured out that problem. Even if most of hfslip-users will not deinstall something, it makes sense to defrag it to become a more stable Windows. I'll do it in the next hfslip-run.

tommy.... no chance for integrating into hfslip? :)

@Geej

I have also Lilla's idea in mind to put a defragmenting-hint into the XP-List. But personally I prefer to do things with cmd's, if possible. But it's you're idea and your analysis to realize what the problem is.

What do you think?

Link to comment
Share on other sites

@Mim0

It would be great with your support of cmd script. Just put it on your xp-list.

I would love to withdraw support when a better solution to defrag is available. (Like yours)

It's for the benefit of the HFSLIP community. Cheers :D

Link to comment
Share on other sites

Please post up a clean and bug free way to do things and I'll try to integrate it. There's been a very big change in my life during the past week or so which seriously limits my computer time. So pls don't expect a quick turnaround.

Link to comment
Share on other sites

I already have a batch file knocked up somewhere for doing this on ini, sif and inf files.

If I remember correctly it creates the new file without empty lines, merges same-name label entries under a single lable and reorders all labels alphabetically.

So as not to steal Mim0's thunder I'll not post anything up for now and jump in only if the task proves more complicated than it at first seems.

Link to comment
Share on other sites

Don't want to steal Mim0's thunder at all, or Geej's either since he was the one to call attention to this problem and offer the first published solution! After all -

It's for the benefit of the HFSLIP community. Cheers :D

I would think Mim0 would welcome your experience and assistance in this matter. But I'm curious. Why were you using your batch file? Did you also discover this same problem? Why use this on ini, sif, and inf files? Do you use this on ALL such files in your SOURCESS? Does it fix a problem, speed up processing later, just make things neater? Do you still use it?

Cheers and Regards

Link to comment
Share on other sites

...

or Geej's either since he was the one to call attention to this problem and offer the first published solution

...

I would think Mim0 would welcome your experience and assistance in this matter.

Yes, Geej was the one who has figured out the problem and found the solution. I just made a cmd of Geej's idea because it's more in the hfslip-philosophy instead of an exe and a cmd could be integrated into hfslip. Hopefully!!! ;)

I implemented only what Geej has figured out. If there's a more flexible script than mine, plz share it with us :D

Edited by Mim0
Link to comment
Share on other sites

@bphlpt, I don't use it any more, it was originally intended to be used to break down large cmd scripts into smaller idividual scripts by their labels, but I found it more useful in the unattended arena for tidying the txtsetup.sif, dosnet.inf files etc.

I don't use it any more for those purposes because I haven't created unattended media for a good few years now.

@Mim0; More feasible isn't really the point.

tommyp doesn't wish to introduuce bugs into the system, therefore the need is to produce a solution which handles a broad range of situations, (possibly more than we need it for).

Basically the requirement should be for a solution which can be used on any of our ini, inf, sif type files. It should be able to work on any of those types regardless of whether they are or are not compressed and most importantly not mess with any of the content due to the inadequacies of the scripting language. Also due to the old timers and pensioners here it should ideally be able to work on Windows XP and Windows 2000!

Our ideal would be to be able to either call a 'label' in the main script to defrag one or more files or to include a seperate script which can be called as an option. I'd go along with the latter, at least for a period of time, in order that any potential untested bugs can be ironed out without destroying the main script.

@All; I'll try to dig the script out and see how difficult it would be to make it more broad-ranging for HFSlip or standalone purposes and keep you posted.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...