Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Defraging sysoc.inf in your SOURCESS

- - - - -

  • Please log in to reply
31 replies to this topic

#1
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
I made this autoit utility (DefragSysoc.exe) to defrag sysoc.inf (In SOURCESS\I386\SYSOC.IN_) after HFSLIP has added new entries to the end of sysoc.inf.

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"
Attached File  HFSLIP_POST_DefragSysoc.cmd   148bytes   32 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" /nobackup
Add 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... :)

DefragSysoc.exe
Posted Image
Size: 356.97 Kb (365,541 bytes)
MD5: DF26D700B1882EEFB6C1840745F8303E

Posted Image

Edited by Geej, 30 April 2010 - 12:32 AM.



How to remove advertisement from MSFN

#2
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05
Environment:
Base is Windows XP Pro Gold (aka Service Pack 0).
Integrating SP3, IE8, WMP11, RDC7, and most other updates.
Did not use HFCleanup or nLite.

Having experienced the problem described in your article, I decided to try using DefragSysoc.
However, apparently it did not run as after running HFSLIP the backup file created by DefragSysoc (SOURCESS\I386\SYSOCBAK.IN_) does not exist.

I created HFSLIP_POST_DefragSysoc.cmd (contains only the line below)
"%~dp0DefragSysoc.exe"
I left the double-quotes in place as shown in the example in the article linked to below, please advise if they should be removed.

I placed DefragSysoc.exe and the above .cmd file in the HFTOOLS folder
Then I ran hfslip-1.7.10_beta_G.cmd.

Should this utility work with this beta?

Your article says that DefragSysoc.exe does some error checking. Perhaps it doesn't like something. I followed your instructions. In case it might be helpful, I've attached some files for you to look at.

Any clues you might offer would be appreciated.

Thank you, Lilla

Attached Files


Edited by Lilla, 19 February 2010 - 03:00 PM.


#3
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
The backup file created by DefragSysoc (SOURCESS\I386\SYSOCBAK.IN_) does not exist because in SOURCE\i386 folder, sysoc.in_ is still having 2 [Components] sections.
(SYSOC_2source_after.inf)


You should only have 1 edited sysoc.in_ in your SOURCE\i386 folder.
(SYSOC_1sourceEDITED_before.inf is preferred, just rename to sysoc.inf & compressed it to sysoc.in_)

How SYSOC_2source_after.inf comes about, I dun know. It should not be there.
DefragSysoc.exe only look for sysoc.in_ in SOURCESS\i386 to process. If you have more than 1 copy of sysoc.in? in SOURCE\i386, then maybe DefragSysoc.exe process the wrong sysoc.in_ (Not tested)

Remove all other duplicated sysoc.in? in SOURCE\i386 folder if any.

Then test again in VM or let me know what is the error message generated by DefragSysoc.exe

I created HFSLIP_POST_DefragSysoc.cmd (contains only the line below)
"%~dp0DefragSysoc.exe"
I left the double-quotes in place as shown in the example in the article linked to below, please advise if they should be removed.

The double quote should not be removed unless the file full path to DefragSysoc.exe does not contain space.

Hope that helps,
Kinds regards

#4
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05

The backup file created by DefragSysoc (SOURCESS\I386\SYSOCBAK.IN_) does not exist because in SOURCE\i386 folder, sysoc.in_ is still having 2 [Components] sections.
(SYSOC_2source_after.inf)

You should only have 1 edited sysoc.in_ in your SOURCE\i386 folder.
(SYSOC_1sourceEDITED_before.inf is preferred, just rename to sysoc.inf & compressed it to sysoc.in_)

How SYSOC_2source_after.inf comes about, I dun know. It should not be there.
DefragSysoc.exe only look for sysoc.in_ in SOURCESS\i386 to process. If you have more than 1 copy of sysoc.in? in SOURCE\i386, then maybe DefragSysoc.exe process the wrong sysoc.in_ (Not tested)

Remove all other duplicated sysoc.in? in SOURCE\i386 folder if any.

Then test again in VM or let me know what is the error message generated by DefragSysoc.exe



I created HFSLIP_POST_DefragSysoc.cmd (contains only the line below)
"%~dp0DefragSysoc.exe"
I left the double-quotes in place as shown in the example in the article linked to below, please advise if they should be removed.

The double quote should not be removed unless the file full path to DefragSysoc.exe does not contain space.

Hope that helps,
Kinds regards


I know this is kind of hard to follow, but I did exactly as you instructed above and in your original post.

The problem seems to be with hfslip-1.7.10_beta_G.cmd. When I run it, it changes the edited version of \SOURCE\SYSOC.IN_ (that contains .INF) I put there (before running HFSLIP) so that it AGAIN has two components sections.

Is it perhaps a problem with beta G, is it changing \SOURCE\SYSOC.IN_ when it should be changing \SOURCESS\SYSOC.IN_ ? Have you tested using hfslip-1.7.10_beta_G.cmd?

Lilla

Edited by Lilla, 19 February 2010 - 09:45 PM.


#5
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
I have tested with hfslip-1.7.10_beta_G.cmd, works okay on my side. (But I will check more on my SOURCE\I386 when I get home.)
Let me know what is the error message generated by defragsysoc.exe when run with HFSLIP.

Also I notice in HFTOOLS folder, you have HFANSWER.INF. I have it as HFANSWER.INI (Nav to Guidelines->Extra; item2)
I dun know if there is any different. You might want to rename this.

#6
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05

I have tested with hfslip-1.7.10_beta_G.cmd, works okay on my side. (But I will check more on my SOURCE\I386 when I get home.)
Let me know what is the error message generated by defragsysoc.exe when run with HFSLIP.

Where would this error message appear? There is nothing in HFSLIP.LOG (see SYSOC.ZIP in my earlier post). As stated above, after running HFSLIP...cmd to prepare the .iso, the \SOURCESS\I386 folder does not contain the backup file created by defragsysoc.exe, so it doesn't appear that it runs.

Due to the above, I did not create a CD and install from it. But, I will do so if you think this would provide any additional information to work with. Please advise.

Also I notice in HFTOOLS folder, you have HFANSWER.INF. I have it as HFANSWER.INI (Nav to Guidelines->Extra; item2)
I dun know if there is any different. You might want to rename this.

Done. I changed HFANSWER.INF to HFANSWER.INI - Thanks for letting me know.

Thank you for trying to help figure out what is happening (or not happening) here.

Lilla

#7
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
The error would only appear when DefragSysoc.exe is ran. It doesn't write to any log file.

Here is a way to manually simulate it.

Assuming on C:\ root, create a dummy folder call Dummy (i.e C:\Dummy)
In C:\Dummy, create HFTOOLS, SOURCE\I386 & SOURCESS\I368 folders
Put your Edited sysoc.IN_ in C:\Dummy\SOURCE\I386
Put DefragSysoc.exe in C:\Dummy\HFTOOLS
(You may wish to run a quick check in HFTOOLS. Just open in console box and run this command, DefragSysoc /check)

Put SYSOC_3sourcess_after.inf in C:\Dummy\SOURCESS\I368
Make sure SYSOC_3sourcess_after.inf is rename to SYSOC.inf. Then manually merge this line
[Components]
msnexplr=ocmsn.dll,OcEntry,msnmsn.inf,,7
to the main [Components]. Remove this [Components] string. So now you have 2 [Components] section.
Makecab to SYSOC.IN_. Then delete SYSOC.INF

Double click on DefragSysoc.exe to let it process.

After run, check the content of SYSOC.INF in your SOURCESS. You should be able to see SYSOCBAK.IN_ as well.

Normally When I run HFSLIP, I would let it create the iso as well. Ususally all these are unattended.
I still have no clue why HFSLIP is modifying your SOURCE. It doesn't modify mine in my case. Sorry to say that.

===== update DefragSysoc.exe to include quick check on SOURCE\I386\SYSOC.IN_
See 1st post for detail. Thanks

#8
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05
Geej,

When I run HFSLIP I get the error message shown in the attachment. This is consistent with what I have been saying, that after running HFSLIP, the \SOURCE\SYSOC.IN_ file that I created (I combined the 2 components sections into 1) has been changed by HFSLIP to one with again 2 component sections. Thus, \SOURCESS\SYSOC.IN_ winds up having 3 components sections.

I didn't see this message earlier because I wasn't watching the screen. Perhaps it would be better if this message didn't clear automatically.

Since HFSLIP changes the \SOURCE\SYSOC.IN_ file on my system, I will have to give up on using DefragSysoc.exe, at least until/unless this can be resolved.

Thank you for your help,
Lilla

Attached Files


Edited by Lilla, 21 February 2010 - 06:23 PM.


#9
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
Hi Lilla
I have re-script to suit your situation. It's Defrag2Sysoc.exe. (The number 2 here means defrag with 2 [Components] sections in SOURCE.)
Script towards your given SYSOC_3sourcess_after.inf, meaning SYSOC.INF should have the following orders in your SOURCE:
[Version]
[Components]
[Global]
[Components] <--Location must be right after [Global] and before [Strings] sections
[Strings]

Hope that solve the problem.

Defrag2Sysoc.exe still support /check switch
- Add /nobackup switch if you want SYSOCBAK.IN_ to be deleted after run.
- Has also modify code to check SOURCE\I386 but still need user to visual inspect/edit the file.
Script will expand to inspect numbers of [Components] section,
Ask if user wish to open sysoc.inf using default notepad for viewing/editing
If yes, open file. After user save/modify/no modify the file, user close the file,
the script will makecab it to SYSOC.IN_ . Then finally delete sysoc.inf and exit script)
BTW, if there is any error, error message will not timeout.

Hence any user is able to use this alternative script if their SOURCE matches the above requrirement listed in the codebox.

Just modify HFSLIP_POST_Defrag2Sysoc.cmd to below code (or DL this simple cmd attachment to HFTOOLS folder)
"%~dp0Defrag2Sysoc.exe"
or
"%~dp0Defrag2Sysoc.exe" /nobackup

Edit 30-Apr-2010: Alternatve script removed as main script able to handles multiple [Components] sections

Edited by Geej, 30 April 2010 - 12:35 AM.


#10
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05

Hi Lilla
I have re-script to suit your situation. It's Defrag2Sysoc.exe. (The number 2 here means defrag with 2 [Components] sections in SOURCE.)
Script towards your given SYSOC_3sourcess_after.inf, meaning SYSOC.INF should have the following orders in your SOURCE:

[Version]
[Components]
[Global]
[Components] <--Location must be right after [Global] and before [Strings] sections
[Strings]
Hope that solve the problem.

Good work! It solved the problem. It worked and it was so easy. All I had to do was to put Defrag2Sysoc.exe and HFSLIP_POST_Defrag2Sysoc.cmd in \TOOLS folder, and run HFSLIP (1.7.10 beta g)

Defrag2Sysoc.exe still support /check switch
- Has also modify code to check SOURCE\I386 but still need user to visual inspect/edit the file. Script will expand to inspect numbers of [Components] section, Ask if user wish to open sysoc.inf using default notepad for viewing/editing If yes, open file. After user save/modify/no modify the file, user close the file, the script will makecab it to SYSOC.IN_ . Then finally delete sysoc.inf and exit script) BTW, if there is any error, error message will not timeout.

As I understand it, the above would only happen if I used the /check switch, which I didn't do. I of course had already confirmed that I met the requirements (2 components sections; section names and order matching that given in first quote in this post). I did not edit anything. It didn't ask me anything, nothing opened up, no error message. All appears to have worked perfectly!

Hence any user is able to use this alternative script if their SOURCE matches the above requriement listed in the codebox.

Just modify HFSLIP_POST_DefragSysoc.cmd to

"%~dp0Defrag2Sysoc.exe"
Defrag2Sysoc.exe
Size: 305.74 Kb (313,073 bytes)
MD5: 396874C19549BAF007F8838B6F9FA3B6

I used the name HFSLIP_POST_Defrag2Sysoc.cmd (with the 2 in it for consistency with the name of the .exe).

FYI. Defrag2Sysoc.exe and HFSLIP_POST_Defrag2Sysoc.cmd are not detected as threats by...
- Microsoft Security Essentials (MSE) - antivirus +
- Spybot Search & Destroy
- MalwareBytes AntiMalware

I attached some files in case you (or others) want to check what happened here.
A summary of the files attached:

0 SYSOC.INF (in \SOURCE\SYSOC.IN_) before HFSLIP+Defrag2Sysoc.exe
Contents: 27 entries in 2 [Components] sections

1 SYSOC.INF (in \SOURCES\SYSOC.IN_) after HFSLIP+Defrag2Sysoc.exe
Contents: 32 entries in 2 [Components] sections

2 SYSOC.INF (in \SOURCESS\SYSOCBAK.IN_) after HFSLIP+Defrag2Sysoc.exe
A backup copy of SOURCESS\SYSOC.IN_ made by Defrag2Sysoc.exe before it makes any changes.
Contents: 35 entries in 3 [Components] sections.

2 SYSOC.INF (in \SOURCESS\SYSOC.IN_) after HFSLIP+Defrag2Sysoc.exe
This file contains the result of Defrag2Sysoc.exe, i.e. it defrags the components section.
Contents: 35 entries in 1 [Components] section; the components sections is defragged.

HFSLIP.LOG

---

Thank you so very much for getting this to work for me. I hope others will try it too.

Lilla

Attached Files


Edited by Lilla, 24 February 2010 - 08:08 PM.


#11
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
Update the 2 scripts (in Post #1 & #9)

- Now writes from line 2 and add a blank line at end of file
B'cause it will look neater if there is a 'delete entry' operation to sysoc.inf such as program uninstall.
[Components] section will be moved down automatically by XP once there is a delete operation.
- Tidy up internal codes
- Add a switch /nobackup if you want SYSOCBAK.IN_ to be deleted in SOURCESS\I386 after run.
It will only be deleted if defragsysoc.exe or defrag2sysoc.exe completed successfully.
A small log (defragsysoc.log or defrag2sysoc.log) will be created in HFTOOLS, indicating it's status.
- To run with /nobackup, HFSLIP_POST_DefragSysoc.cmd or HFSLIP_POST_Defrag2Sysoc.cmd need to change to
"%~dp0DefragSysoc.exe" /nobackup
or
"%~dp0Defrag2Sysoc.exe" /nobackup
:)

#12
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05

Update the 2 scripts (in Post #1 & #9)

- Now writes from line 2 and add a blank line at end of file
B'cause it will look neater if there is a 'delete entry' operation to sysoc.inf such as program uninstall.
[Components] section will be moved down automatically by XP once there is a delete operation.
- Tidy up internal codes
- Add a switch /nobackup if you want SYSOCBAK.IN_ to be deleted in SOURCESS\I386 after run.
It will only be deleted if defragsysoc.exe or defrag2sysoc.exe completed successfully.
A small log (defragsysoc.log or defrag2sysoc.log) will be created in HFTOOLS, indicating it's status.
- To run with /nobackup, HFSLIP_POST_DefragSysoc.cmd or HFSLIP_POST_Defrag2Sysoc.cmd need to change to

"%~dp0DefragSysoc.exe" /nobackup
or
"%~dp0Defrag2Sysoc.exe" /nobackup
:)


Very nice!

I think this is a subtle problem that most are not aware of. It is amazing that you understand it and developed a solution. It would be a shame if your valuable work gets lost by rolling to the back pages of this forum. To preserve your work, it would be helpful to the HFSLIP community, if this issue and your solution could be documented on tommyp's HFSLIP.org page, and included on mimo's update list with perhaps a link to this thread.
Lilla

Edited by Lilla, 22 March 2010 - 11:52 AM.


#13
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,873 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag
Should this functionality be included in HFSLIP itself and always run, or do I not understand the purpose and usefulness of this script? Could anything bad happen if this is always run after every use of HFSLIP? Why would you not want to run it and defrag sysoc.inf?

Cheers and Regards

Posted Image


#14
Mim0

Mim0

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 768 posts
  • Joined 23-September 08

Should this functionality be included in HFSLIP itself and always run, or do I not understand the purpose and usefulness of this script? Could anything bad happen if this is always run after every use of HFSLIP? Why would you not want to run it and defrag sysoc.inf?

Yes, that's what I'm asking me also. Sorry Posted Image

I support Lilla's idea to put a link it to the XP-list. It sounds interesting but when reading there are so much "if this.. if that... ensure this... check that...". Posted Image For a "normal user" who is not editing inf's manually (like me Posted Image ), is there an easy way? Like "just download it"? Any disadvantages?

Appears the problem of a fragmented file only for deinstalling windows-components which are installed by default?

Edited by Mim0, 22 March 2010 - 01:43 PM.


#15
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05


Should this functionality be included in HFSLIP itself and always run, or do I not understand the purpose and usefulness of this script? Could anything bad happen if this is always run after every use of HFSLIP? Why would you not want to run it and defrag sysoc.inf?

Yes, that's what I'm asking me also. Sorry Posted Image

I support Lilla's idea to put a link it to the XP-list. It sounds interesting but when reading there are so much "if this.. if that... ensure this... check that...". Posted Image For a "normal user" who is not editing inf's manually (like me Posted Image ), is there an easy way? Like "just download it"? Any disadvantages?

Appears the problem of a fragmented file only for deinstalling windows-components which are installed by default?


Geej, regarding an easy way, some thoughts/questions...

Consider, as part of the "easy way" perhaps you could...
o add HFSLIP_POST_DefragSysoc.cmd (with the one line command in it) to post #1
o add HFSLIP_POST_Defrag2Sysoc.cmd (with the one line command in it) to post #9
While it's easy to make these .cmd files, it's not as easy as clicking a download link. Also, a novice user could make a mistake when creating this file.

Now, in thinking about a possible "easy way", as I understand it...
o DefragSysoc.exe will abort if Sysoc.ini (in Source\Sysoc.in_) contains more or less than 1 components section, or if sections are not in expected order.
o Defrag2Sysoc.exe will abort if Sysoc.ini (in Source\Sysoc.in_) contains more or less than than 2 components, or if sections are not in expected order.

Which makes me wonder if something like this would work.
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. Then users would only have to download two files (.exe and .cmd file). Just a thought.

Lilla

Edited by Lilla, 22 March 2010 - 03:01 PM.


#16
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,873 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag

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, 22 March 2010 - 09:42 PM.

Posted Image


#17
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
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

#18
Mim0

Mim0

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 768 posts
  • Joined 23-September 08
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, 23 March 2010 - 01:00 PM.


#19
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
It will be nice if HFSLIP can address it directly, w/o needing 3rd party tool :)

#20
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,873 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag
No comments by fdv or tommyp?

Cheers and Regards

Posted Image


#21
Lilla

Lilla

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 11-May 05
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.

Attached Files


Edited by Lilla, 25 March 2010 - 03:20 PM.


#22
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,873 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag
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

Posted Image


#23
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
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 ; http://www.msfn.org/...ected-url-1010/
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 ; http://www.msfn.org/...changer-for-xp/

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 =====

Posted Image

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.

#24
Mim0

Mim0

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 768 posts
  • Joined 23-September 08

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?

#25
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • Joined 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag
@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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users