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

How to merge two text files?

- - - - -

  • Please log in to reply
237 replies to this topic

#51
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
By doing the steps described in #3 I get sth like this

1) two updates.infs

[IE6.System32.Files]
 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 
 [IE6.Cache.Files]
 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
&
 [IE6.System32.Files]
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL
 
 [IE6.Cache.Files]
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL

2) copy *.inf update.inf

[IE6.System32.Files]
 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 
 [IE6.Cache.Files]
 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 
 [IE6.System32.Files]
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL
 
 [IE6.Cache.Files]
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL


2) After your script:

[IE6.System32.Files]

 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL


[IE6.Cache.Files]

 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL


[IE6.System32.Files]

 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL


[IE6.Cache.Files]

 BROWSEUI.DLL, xpsp2_binarydrop\BROWSEUI.DLL
 CDFVIEW.DLL, xpsp2_binarydrop\CDFVIEW.DLL
 DANIM.DLL, xpsp2_binarydrop\DANIM.DLL
 DXTMSFT.DLL, xpsp2_binarydrop\DXTMSFT.DLL

If you remove the second duplicated [IE6.System32.Files] & [IE6.Cache.Files] (and use Notepad++'s sorting if necessary) the file will be merged. Of course there may be some other work necessary if the file is complicated but still it works for me :) I can save time by using your script even now.


How to remove advertisement from MSFN

#52
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

If you remove the second duplicated [IE6.System32.Files] & [IE6.Cache.Files] (and use Notepad++'s sorting if necessary) the file will be merged. Of course there may be some other work necessary if the file is complicated but still it works for me :) I can save time by using your script even now.

Well, you can dedupe the [1ndex] by processing it with FEDIT.

Try the attached join_dedupe_inf.cmd instead of join_inf.cmd, I modified it a little bit to create (hopefully) a deduped [1NDEX] fie (actually called [2NDEX] ;)):
::BEGIN MODIFIED
ECHO [DUMMY_SECTION]>%Split_dir%[2NDEX]%Source%
FOR /F "skip=2 tokens=1 delims= " %%A IN ('FIND "[" %Split_dir%[1NDEX]%Source%') DO (
SET string=%%A
SET string=!string:[=!
SET string=!string:]=!
ECHO Processing %%A....
Fedit -f %Split_dir%[2NDEX]%Source% -add -once -create -l "dummy"  -s "!string!"
Fedit -f %Split_dir%[2NDEX]%Source% -rem -l "dummy"  -s "!string!"
)
Fedit -f %Split_dir%[2NDEX]%Source% -rem -l "[DUMMY_SECTION]"
ECHO.
ECHO.
ECHO TYPE %Split_dir%[2NDEX]%Source%
ECHO.
TYPE %Split_dir%[2NDEX]%Source%
ECHO.
FOR /F %%A in (%Split_dir%[2NDEX]%Source%) DO (
ECHO COPY /B %Work%+%Split_dir%%%A%Source% %Work%
COPY /B %Work%+%Split_dir%%%A%Source% %Work%
)
::END MODIFIED

But the problem I see in "real life" is the order in which you copy together the single .inf files. :unsure:
Wouldn't it be possible that a newer update line is overwritten by an older one (if by chnace a file is copied in the "wrong" order)?

I will add the <= and >= provision. :)



jaclaz

Attached Files



#53
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Of course there's a chance, I highlighted that fact towards the beginning of this Topic.

Even simple things such as this are a problem:

[Version]

Signature = "$Windows NT$"
LanguageType = %LangTypeValue%
NtBuildToUpdate = 2195
NtMajorVersionToUpdate = 5
NtMinorVersionToUpdate = 0
MaxNtBuildToUpdate = 2195
MaxNtMajorVersionToUpdate = 5
MaxNtMinorVersionToUpdate = 0
MinNtServicePackVersion = 1024
MinNtServicePackVersion = 768
MaxNtServicePackVersion = 1024
MaxNtServicePackVersion = 1536
ThisServicePackVersion = 1280
ThisServicePackVersion = 1024
CatalogFile = %SP_CAT_NAME%.cat
CatalogFile = sp4.cat



#54
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
Yzöwl,

but these are simple things I can easily sort manually :)

jaclaz,

fantastic work :thumbup The new split_dedupe_inf only removes the duplicated sections, not duplicates in the same section. Am I right?

"Echo is off." in this file.

Is "==" also in exlusions?

like this one

Operation = CheckFileVer, atapi.sys, ==, 5.0.2195.5762

I'll do more tests tomorrow.

Edited by tomasz86, 15 July 2011 - 10:57 AM.


#55
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Of course there's a chance, I highlighted that fact towards the beginning of this Topic.

Even simple things such as this are a problem:[

Exactly :thumbup

Yzöwl,

but these are simple things I can easily sort manually :)

I may be wrong, but the actual fun in using batches to automate things is to actually automate them. :whistle:

fantastic work :thumbup The new split_dedupe_inf only removes the duplicated sections, not duplicates in the same section. Am I right?

Actually it simply "dedupes" the index of sections, so that each "split" file is only processed once.

"Echo is off." in this file.

I'll check. Checked, they are stoopid [TAB]'s. Will add.

Is "==" also in exlusions?

like this one

Operation = CheckFileVer, atapi.sys, ==, 5.0.2195.5762


Yes:
::Final adjustments to be run ONLY once
::run Once
::Replace "==" with a dummy string "§#§"
CALL :run_gsar :x3d:x3d  :xa7:x23:xa7

jaclaz

Edited by jaclaz, 15 July 2011 - 11:11 AM.


#56
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Yzöwl,

but these are simple things I can easily sort manually :)

No they are not, basically there are lines in each inf which are pertinent only to that inf. Once you merge them into one you are unable to track information between each file. When the inf is run it will use the value last recorded for a particular piece of data. If you run a line which was intended only for minimum service pack version 1024 against a machine at 768 then you can do untold damage to their system.

I'm aware that the exact case above is relatively simple to fix manually but that is only based on the first section at the top of each of the four files you've linked to, what about every other section and every other update.

I'm fairly certain that the work needed to do what you want in a scripting language, (and probably a real programming language), will be greater than simply running the updates in sequence as they are now.

It appears that you wish to not do that so that you can be the champion of a new unofficial service pack project; But at what cost, especially to those who have done all of the donkey work for you!

BTW, I've attached a copy of the resulting file from merging the four samples you provided using my own batch only script. There were errors so the output is incorrect but it was a simple test in order to provide some output for the purposes of this post. I've no real intention of fixing these errors right now. What I'd like from you is an explanation of how you intend to ensure that information from one original file will not overwrite or break that of another section.

Attached Files


Edited by Yzöwl, 15 July 2011 - 01:20 PM.
Attachment and info added


#57
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag

Yzöwl,

but these are simple things I can easily sort manually :)

No they are not, basically there are lines in each inf which are pertinent only to that inf. Once you merge them into one you are unable to track information between each file. When the inf is run it will use the value last recorded for a particular piece of data. If you run a line which was intended only for minimum service pack version 1024 against a machine at 768 then you can do untold damage to their system.

In such case only 1024 must be used to prevent problems. What I do is to check every section manually and see if there is something wrong with it. Once you've got accustomed to them it's relatively easy to know instantly which lines are correct and which ones are not. Also when running the update.exe it checks if the .inf file is correct and reports an error if there are problems.

Also one more info: the order of lines in each section doesn't matter at all. I've already checked that. They can be sorted alphabetically.

It appears that you wish to not do that so that you can be the champion of a new unofficial service pack project; But at what cost, especially to those who have done all of the donkey work for you!

I don't really understand why you're writing something like this... especially considering that I've already made HBR Mini Rollup & IE / OE Mini Rollup (100% manual work by myself) and UR2 for Win2k (107 updates merged; used HFSLIP's script for merging files and manually merged update.infs).

I have enough knowledge about update.infs to merge them myself manually but it requries a lot of time and work which could be simplified using such a script like this one created by jaclaz. I don't know how to write such a script myself so I asked for help here. Is there anything wrong about it? :huh:


jaclaz,

there is one big problem when merging something like this

Spoiler


%(...)% are defined in [Strings]

Spoiler


Almost all Win2k updates use such a structure but if you merge them the data is lost. If I wanted to process updates by your script I would have to change manually each updates' data to sth like before merging them:

Spoiler


Is it even possible to do such a thing automatically or would it require too much work?

Edited by tomasz86, 15 July 2011 - 11:04 PM.


#58
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,078 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I don't really understand why you're writing something like this... especially considering that I've already made HBR Mini Rollup & IE / OE Mini Rollup (100% manual work by myself) and UR2 for Win2k (107 updates merged; used HFSLIP's script for merging files and manually merged update.infs).

I have enough knowledge about update.infs to merge them myself manually but it requries a lot of time and work which could be simplified using such a script like this one created by jaclaz. I don't know how to write such a script myself so I asked for help here. Is there anything wrong about it? :huh:

Of course there is!

The project is basically the script, but you've not done it, someone else has, at the moment it's jaclaz's work

The same as your roll up script which was in the majority a copy of the work done by others on the HFSLIP project.

#59
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
I didn't use any script when making HBR Mini Rollup & IE / OE Mini Rollup.

As for HFSLIP:

You are free
(1) to Share - to copy, distribute and transmit HFSLIP (the work)
(2) to Remix - to adapt the work

Under the following conditions:
(1) Attribution. You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse
you or your use of the work).

(2) Noncommercial. You may not use this work for commercial purposes.
(3) Share Alike. If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same or similar license to
this one.


In the very beginning (in this topic) I stated that the script is a part of the HFSLIP's script. I didn't write anywhere that it was my work.

TO prevent further problems:

Jaclaz, is it O.K to use your script when merging updates in order to make update rollups for Win2k?

#60
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Jaclaz, is it O.K to use your script when merging updates in order to make update rollups for Win2k?

As long as you comply with my Careware License ;), yes, of course :):
http://jaclaz.alterv...s/careware.html
but - as said - at the moment we are very little beyond the "proof of concept" stage.

Can you assemble together a "fake" update .inf file with all the lines that you find needing manual correction (i.e. the ones that result as "different" in the re-joined file?
This way I can have all in one source the "problematic parts" and test the batches more easily....
IN other words, if you could manually assemble a fake "difficult" file, it will be faster for me.

jaclaz

#61
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
Thank you :wub: I know it's still the very alpha stage of your script but if it can be utilised even now then why not? ;)

By using it I can check if I merged everything correctly in Update Rollup 2 for example. It can also be used to remove all the unnecessary spaces and reduce the size of the update.inf file.

I'll try to prepare such a difficult update.inf and upload it for you.

I also have an another question: Is it possible to select sections that I would like to merge?

For example, I want to merge only these sections

[Save.Reg.For.Uninstall]
[Product.Del.Reg]
[Product.Add.Reg]


Nevermind, I got it. You can select them from the SPLIT_XXX folder after doing splitinf.

btw, what are the two pauses in splitinf for?

Your script is quite CPU hungry :lol: It uses both cores of an Athlon II x2 250 at >60%.

Edited by tomasz86, 16 July 2011 - 04:25 AM.


#62
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Hopefully fixed:
  • the "<=" and "=>" issues
  • the [TAB] issue
  • the two PAUSE (leftover from tests)

I don't think the batch is particularly CPU hungry, I presume is the "normal" problem with CMD.EXE (or if you prefer Command Prompt).

On my PC running split_inf.cmd raises cpu's usage to around 40%, with peak at around 55%

The poorman's way for similar problems has been traditionally that of editing the settings in the \Windows\_default.pif, but cannot really say if it affects "pure batch" execution. :unsure: (and anyway it rarely does *much* difference)

You may want to experiment with ;):
http://mion.faireal.net/BES/


jaclaz

Attached Files


Edited by jaclaz, 16 July 2011 - 11:54 AM.


#63
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
"Echo is off." still present ;)

update.inf

#64
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

"Echo is off." still present ;)

update.inf

Not here :w00t: , using on the above file splitinf.cmd dated 16/07/2011, I can find no "ECHO" in any of the files in the "SPLIT_" directory.
Nor, after having used join_dedupe_inf.cmd dated 15/07/2011 in the "JOINED_" .inf.

BUT there was a problem (NOT related to the ECHO) in beautify.cmd (forgot a few x's, my bad :blushing: )

Find atttached the SAME splitinf.cmd and join_dedupe_inf.cmd with a corrected beautify.cmd

Try again.

jaclaz

Attached Files



#65
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
I haven't prepared the update.inf yet but I have some information about deduping sections.

Generally, all [*.files] sections can be deduped without any problems.

[SourceDisksNames] & [SourceDisksFiles] can be also deduped.

As for the strings I wrote about a few days ago it's like this:

The basic structure:
[Save.Reg.For.Uninstall]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP%SERVICE_PACK_NUMBER%\%SP_SHORT_TITLE%

[Product.Add.Reg]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Installed",0x10001,1
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Comments",0,%SP_TITLE%
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Backup Dir",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Fix Description",0,%SP_TITLE%
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Installed By",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Installed On",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Service Pack",0x10001,%SERVICE_PACK_NUMBER%
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Valid",0x10001,1
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%\File 1\,"Flags",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%\File 1\,"New File",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%\File 1\,"New Link Date",0,""
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%\File 1\,"Old Link Date",0,""
    HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%,"ReleaseType",0,Hotfix
    HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%,"RegistryLocation",0,"HKLM\SOFTWARE\Microsoft\Updates\Windows 2000\SP%SERVICE_PACK_NUMBER%\%SP_SHORT_TITLE%"
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP%SERVICE_PACK_NUMBER%\%SP_SHORT_TITLE%,"Description",,%SP_TITLE%
;   Plugin.ocx
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%","DisplayIcon",0x00020000, "%windir%\System32\msiexec.exe"

Without any loss of necessary data it can be reduced to
[Save.Reg.For.Uninstall]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP%SERVICE_PACK_NUMBER%\%SP_SHORT_TITLE%

[Product.Add.Reg]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Installed",0x10001,1

This line
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%","DisplayIcon",0x00020000, "%windir%\System32\msiexec.exe"

should be reduced and go to both [Save.Reg.For.Uninstall] & [Product.Del.Reg].

Final thing should look like this:
[Save.Reg.For.Uninstall]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP%SERVICE_PACK_NUMBER%\%SP_SHORT_TITLE%
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%

[Product.Del.Reg]

    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%SP_SHORT_TITLE%

[Product.Add.Reg]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\%SP_SHORT_TITLE%,"Installed",0x10001,1

Finally, SP%SERVICE_PACK_NUMBER% should be changed to SP5 (all Win2k updates after SP4 are listed as SP5).

So if we add ex. KB123456 it should be
[Save.Reg.For.Uninstall]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB123456
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP5\KB123456
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB123456

[Product.Del.Reg]

    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB123456

[Product.Add.Reg]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB123456,"Installed",0x10001,1

The line
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB123456
in [Product.Del.Reg] is necessary to remove KB123456 from the list of installed updates.

On the other hand,
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB123456,"Installed",0x10001,1
is needed to tell Windows Updates that KB123456 is installed.

Is is also important to note that the basic structure I put above is also needed but in the case of a merged update it will be related to the name of the merged update, not the updates included in it.

I'll give an example. Let's say we merge two updates - KB123456 & KB234567. The merged info should be
[Save.Reg.For.Uninstall]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB123456
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB234567
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP5\KB123456
    HKLM,SOFTWARE\Microsoft\Updates\Windows 2000\SP5\KB234567
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB123456
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB234567

[Product.Del.Reg]

    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB123456
    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB234567

[Product.Add.Reg]

    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB123456,"Installed",0x10001,1
    HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB234567,"Installed",0x10001,1

I hope you understand what I mean. Please tell me if my explanation is unclear or too complicated ;)

Edited by tomasz86, 21 July 2011 - 04:20 AM.


#66
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

I hope you understand what I mean. Please tell me if my explanation is unclear or too complicated ;)

Yes/no. :ph34r:

As I see it it is out of "current scope". :whistle:

All that seems to me like something that may be "post-processed". (and consequently to be tackled later, ONCE we have "basic" functionalities working).

Current scope (as I see it) is to "consolidate" and "merge" whatever is in the "source" files into a "monolithic" file with NO CHANGES to the contents WHATSOEVER (apart removing crazy blank spaces and [TAB]'s).

jaclaz

#67
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
I see ;)

So far I haven't seen any other problems connected with merging. I used your script to merge many update.inf files from Win2k updates and everything seems to work fine unless the update.inf itself has different structure (ex. IE/OE updates or WMP updates are different).

Edited by tomasz86, 21 July 2011 - 06:39 AM.


#68
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
I found a freeware program called CMSort which is able to sort files and remove duplicates from them.

cmsort.exe /D 1.txt 1.sor

The problem is that the file has to be specified, i.e. it doesn't seem possible to use it for multiple files at once.

I wonder if it is possible to modify your script to have it sort all files in %Split_dir% one by one as they are created.

EDIT

Once again I tried to use the HFSLIP string mentioned in the beginning of this topic

@ECHO OFF
IF EXIST SPLIT_update\*.inf (
	MD SPLIT_update\CMSORT
	DIR/B/A-D/OGN/ON SPLIT_update\*.inf>CMSORT.TXT
	SET CMSORT=
	FOR /F %%I IN (CMSORT.TXT) DO (SET CMSORT=%%I&IF DEFINED CMSORT CALL :CMSORT)
	DEL/Q/S CMSORT.TXT
)
IF NOT EXIST SPLIT_update\*.inf (
	EXIT
)

:CMSORT
cmsort /D /H=2 SPLIT_update\%CMSORT% SPLIT_update\CMSORT\%CMSORT%
xcopy/Y SPLIT_update\CMSORT\%CMSORT% SPLIT_update\
ECHO.

IF NOT EXIST CMSORT.TXT (
	RD/Q/S SPLIT_UPDATE\CMSORT
)

The only problem is that [1ndex]update.inf should be excluded from sorting as it contains list of sections in their original order.

EDIT

jaclaz,

there is strange line in KB918118, KB925902, KB926247, KB927891, KB928843, KB935839 for Win2k. In [Strings] the last line is

KODAK_DIR            =       "Windows NT\Accessories\ImageVue"@i:@u: [WatsonManifestMode.Cancel]
Because of this [Strings] & [WatsonManifestMode.Cancel] get mixed when processed by your script.

Edited by tomasz86, 22 July 2011 - 01:01 AM.


#69
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

The only problem is that [1ndex]update.inf should be excluded from sorting as it contains list of sections in their original order.

That is NOT a problem, add:

:CMSORT
IF "%CMSORT%"=="[1ndex]update.inf" GOTO :EOF
cmsort /D /H=2 SPLIT_update\%CMSORT% SPLIT_update\CMSORT\%CMSORT%
xcopy/Y SPLIT_update\CMSORT\%CMSORT% SPLIT_update\
ECHO.

IF NOT EXIST CMSORT.TXT (
RD/Q/S SPLIT_UPDATE\CMSORT
)


Still waiting for the "fake" problematic .inf .... :whistle:

jaclaz

#70
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
Actually I haven't found any other problems except this one

KODAK_DIR            =       "Windows NT\Accessories\ImageVue"@i:@u: [WatsonManifestMode.Cancel]
which I mentioned above :)

#71
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
An emty file "2.53" gets created because of this line:

; These files are installed even if MDAC > 2.53 is present.
It's just an explanatory note I wrote.

This line

HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","Plus! ProductId"
is changed to

HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","Plus ProductId"
"!" is gone.

Also this update.inf has many informative strings starting with ; and it gets messed pretty badly after running your script ;)

Edited by tomasz86, 23 July 2011 - 02:23 AM.


#72
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Also this update.inf has many informative strings starting with ; and it gets messed pretty badly after running your script ;)

Try the attached.

jaclaz

Attached Files



#73
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag
Thank you :) It seems to be OK now.

There is still this problem with [WatsonManifestMode.Cancel] which causes lines in [Strings] to be divided into two separate sections.

You can see it if you process this update.inf through your script.

BTW, I did this

:CMSORT
TOOLS\cmsort.exe /D /H=2 SPLIT_update\%CMSORT% SPLIT_update\CMSORT\%CMSORT%
IF EXIST SPLIT_update\CMSORT\[1ndex]update.inf DEL/Q SPLIT_update\CMSORT\[1ndex]update.inf 
IF EXIST SPLIT_update\CMSORT\*Add.Reg]update.inf DEL/Q SPLIT_update\CMSORT\*Add.Reg]update.inf
IF EXIST SPLIT_update\CMSORT\*AddReg]update.inf DEL/Q SPLIT_update\CMSORT\*AddReg]update.inf
xcopy/Y SPLIT_update\CMSORT\%CMSORT% SPLIT_update\
ECHO.
instead of

IF "%CMSORT%"=="[1ndex]update.inf" GOTO :EOF

Add.Reg sections also shouldn't be sorted and deduped as newer updates may update the older ones. After using CMSORT their order may be wrong.

Edited by tomasz86, 26 July 2011 - 09:16 AM.


#74
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,997 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Thank you :) It seems to be OK now.

There is still this problem with [WatsonManifestMode.Cancel] which causes lines in [Strings] to be divided into two separate sections.

Try the attached.


Add.Reg sections also shouldn't be sorted and deduped as newer updates may update the older ones. After using CMSORT their order may be wrong.

And still this belongs to the actual merging command ( which is yet to be written).

jaclaz

Attached Files



#75
tomasz86

tomasz86

    http://windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,549 posts
  • Joined 27-November 10
  • OS:Windows 2000 Professional
  • Country: Country Flag

Add.Reg sections also shouldn't be sorted and deduped as newer updates may update the older ones. After using CMSORT their order may be wrong.

And still this belongs to the actual merging command ( which is yet to be written).

I know :) I was to talking in the relation to CMSORT in case someone else will use it to dedupe these sections.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users