Jump to content

Repacing sp2.cab & driver.cab


Recommended Posts

Hello!

I have a Windows XP CD with integrated SP2. As i recently browsed through the differnet CABs I found out, that there are many files in sp2.cab hat already exist in the i386 folder and in the driver.cab.

So I tried to replace the old files with the files in sp2.cab.

I wrote a little script:

mkdir i386\DRIVER\
mkdir i386\sp2\
expand -F:* i386\DRIVER.CAB i386\DRIVER\
expand -F:* i386\sp2.cab i386\SP2\
for /f %%i in ('dir /b i386\sp2') do ( if exist i386\driver\%%i move i386\sp2\%%i i386\driver\%%i )
for /f %%i in ('dir /b i386\sp2') do (
makecab i386\sp2\%%i /L i386\sp2\
del i386\sp2\%%i
)
for /f %%i in ('dir /b i386\sp2') do ( if exist i386\%%i move i386\sp2\%%i i386\%%i )

@echo off

del i386\driver.cab
del i386\sp2.cab

move i386\sp2\*.* i386\driver\
rmdir i386\sp2

rem Updating txtsetup.sif
echo sp2.cab>> txtsetup.log
echo sp2.cat>> txtsetup.log
findstr /v /b /i /g:txtsetup.log i386\txtsetup.sif > txtsetup.sif
move txtsetup.sif i386\txtsetup.sif
del txtsetup.log

rem Updating dosnet.inf
echo d1,sp2.cab>> dosnet.log
echo d1,sp2.cat>> dosnet.log
findstr /v /b /i /g:dosnet.log i386\dosnet.inf > dosnet.inf
move dosnet.inf i386\dosnet.inf
del dosnet.log

rem Updating drvindex.inf
del i386\drvindex.inf
echo [Version]>> i386\drvindex.inf
echo Signature="$Windows NT$">> i386\drvindex.inf
echo CabFiles=Driver>> i386\drvindex.inf
echo [Driver]>> i386\drvindex.inf
dir /b i386\driver>> i386\drvindex.inf
echo [Cabs]>> i386\drvindex.inf
echo Driver=driver.cab>> i386\drvindex.inf

rem Compressing driver.cab
echo .Set Cabinet=on>> driver.ddf
echo .Set Compress=on>> driver.ddf
echo .Set CompressionType=LZX>> driver.ddf
echo .Set CompressionMemory=21>> driver.ddf
echo .Set CabinetNameTemplate=driver.cab>> driver.ddf
echo .Set MaxDiskSize=CDROM>> driver.ddf
echo .Set DiskDirectory1=i386>> driver.ddf
for /f %%i in ('dir /b i386\driver') do echo i386\driver\%%i>> driver.ddf
makecab /f driver.ddf
del driver.ddf
del setup.inf
del setup.rpt

rmdir /s /q i386\driver

That batch expands the two CABs driver.cab & sp2.cab and replaces the old files with the sp2-files. After that the batch compresses the actual driver-files and the sp2-files to driver.cab.

But I get an error when trying to install.

The Setup cannont find the files. That's alright, I did not change those entries in txtsetup.sif

But how do i change them? Using

findstr /v /b /i /g:txtsetup.log i386\txtsetup.sif > txtsetup.sif

I can delete several lines from the txtsetup.sif, but I'm not able to replace them. How to do it?

I hope anybody understood what I'm trying to ask and can help me ;)

/PITU

Link to comment
Share on other sites


It's been quite a whle since I've created an unnattend cd, same with slimming down the files. Not sure if I'll be of any help, but hopefully this may help a little bit. I believe you have to delete the entries in the textsetup.inf relating to the files you deleted from the .cab files. If you search around you can find scripts that people have written to remove redundant or uneeded untries. If you haven't already, read the guide at unnatended.msfn.org. There are links to sites that may help you out quite a bit.

Hope I've been at least slighttly helpful. Good luck

Link to comment
Share on other sites

Thank you

But sorry, I think I wasn't able to clearly point out my question. I already read the topic RyanVM posted.

But the mergecabs.cmd and the drivercabfix.exe doesn't solve my problem. The entries for the files are just pointing to a wrong directory (the CAB-file). Maybe it works this way it isn't very clean. I'd like to change the entries. So my simple question is the following:

Is there a way to replace a line in the txtsetup.sif?

I'm able to delete a line using findstr.

/PITU

Link to comment
Share on other sites

What are you trying to change in txtsetup.sif? Do yourself a favor and look at an XP Gold txtsetup.sif and an XP SP2 txtsetup.sif. Wanna know what you'll see? The entries for the files found in driver.cab (and sp2.cab) are the same in both versions. The only way Windows setup knows which cab the latest versions are in is with drvindex.inf.

So, please explain to me what isn't "clean" about my methodology? I'm really curious to know since it's the same one I use with the RyanVM Integrator which has worked fine for everybody who's used it.

Link to comment
Share on other sites

Hello

No offense please...

Maybe I'm not correct if so please help me understand the following line:

100 = %spcdname%,%spcdtagfilei%,,\i386,1

I see something "sp". Doesn't that mean, that the "folder" 100 is referring to Service-Pack-files? But I don't have a seperated sp-archive. The files are just integrated as if they were on the CD when I buyed it.

Maybe I'm wrong, so please correct me. But I don#t want to get in any trouble or something. I just asked a question, for which I don't know the answer...

I just want to slim down the cd. I don't want an "old" version of a file and a new one. i only want the new one on my cd.

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