Jump to content

new hotfixes.cmd


Recommended Posts

  • 4 weeks later...

@webmedic

Can you point me to the thread it's in or is there a download? I'd like to see it as I was hoping someone would improve it. I'm not after credit, It would just be nice to see how it's been bettered and to use it myself.

Thanks.

Link to comment
Share on other sites

sure here you go. I kind ofrked toghter a bunch of stuff with it and alos to note it ebuilds from scratch right now. I wanted it to be cmpletely working first before I make it so that you con add only the latest hotfixes to it.

I also have anewer version i=of it thatn the one posted in that thread I think.

http://board.MSFN.org/index.php?showtopic=8363

here it is

Link to comment
Share on other sites

Thanks, Royalbox. Credit where credit's due: I'd been meaning to try that slipstream for a while, but could not make the first step. Following is my modified version of WebMedics version. I simplified certain parts (only do fix type 1 and 2, no MDAC), and made others more complicated (each file extracted to it's own directory, XCOPY instead of COPY for selective date based copies), and changed the directory structure (after about 5 beers, I can no longer keep track of single digit variables / directories). For what it is worth, here it is. You need the fixes in either directory HFTYPE1 or HFTYPE2, the expanded SP1.CAB in directory SP1CAB, and the files COMPRESS.EXE, CABARC.EXE, HOTKILL.INI in the root of your chosen directory. It is path indepedant, and works (for me ...) with long file names. But I guess I do not need to walk you through it: the code is fairly readable.

@echo off
setlocal enableextensions

REM - Shamelessly copied from others posted work ...

REM ---------- Initialization ----------
ECHO Find out where we are ...
SET PREPDIR=
FOR /F "delims=" %%i IN ('cd') DO SET PREPDIR=%%i
ECHO We are at %PREPDIR%.

REM ---------- CleanUp & Preparation ----------
ECHO Cleaning up first.
if exist WORKDIR RMDIR "WORKDIR" /S /Q > NUL
if exist SAVEDIR RMDIR "SAVEDIR" /S /Q > NUL
if exist EXTRACT RMDIR "EXTRACT" /S /Q > NUL
MKDIR WORKDIR
MKDIR SAVEDIR
MKDIR SAVEDIR\SVCPACK
MKDIR EXTRACT
if exist HFTYPE1.cmd del /q HFTYPE1.cmd > NUL
if exist HFTYPE2.cmd del /q HFTYPE2.cmd > NUL

REM ---------- Extract Type 1 HotFixes ----------
ECHO Extracting Type 1 Fixes ...
for /f "usebackq delims==" %%i in (`dir /b HFTYPE1\*.exe`) do (
echo HFTYPE1\%%~ni.exe /q /x:EXTRACT\%%~ni >> HFTYPE1.cmd
echo xcopy /d /h /y /s EXTRACT\%%~ni\*.* WORKDIR >> HFTYPE1.cmd
echo if exist EXTRACT\%%~ni\SP2 xcopy /d /h /y /s EXTRACT\%%~ni\SP2\*.* WORKDIR >> HFTYPE1.CMD
)
if exist HFTYPE1.cmd call HFTYPE1.cmd

REM ---------- Extract Type 2 HotFixes ----------
ECHO Extracting Type 2 Fixes ...
for /f "usebackq delims==" %%i in (`dir /b HFTYPE2\*.exe`) do (
echo HFTYPE2\%%~ni.exe /Q /T:%PREPDIR%\EXTRACT\%%~ni /C >> HFTYPE2.cmd
echo xcopy /d /h /y /s EXTRACT\%%~ni\*.* WORKDIR >> HFTYPE2.cmd
echo if exist EXTRACT\%%~ni\SP2 xcopy /d /h /y /s EXTRACT\%%~ni\SP2\*.* WORKDIR >> HFTYPE2.CMD
)
if exist HFTYPE2.cmd call HFTYPE2.cmd

if not exist WORKDIR\* goto _end

REM ---------- Save the files to be copied to the distribution ----------
ECHO Copy Fixes to SVCPACK
copy /y HFTYPE1\*.exe SAVEDIR\SVCPACK > NUL
copy /y HFTYPE2\*.exe SAVEDIR\SVCPACK > NUL

REM ---------- Save off the .cat files.
ECHO Move the .cat Files.
for %%i in (WORKDIR\*.cat WORKDIR\UPDATE\*.cat) do move /y %%i SAVEDIR\SVCPACK

REM ---------- Clean up some ----------
if exist WORKDIR\SYMBOLS RMDIR "WORKDIR\SYMBOLS" /S /Q > NUL
if exist WORKDIR\UPDATE RMDIR "WORKDIR\UPDATE" /S /Q > NUL
if exist WORKDIR\COMMON RMDIR "WORKDIR\COMMON" /S /Q > NUL
if exist WORKDIR\SP1 RMDIR "WORKDIR\SP1" /S /Q > NUL
if exist WORKDIR\SP2 RMDIR "WORKDIR\SP2" /S /Q > NUL
for /f %%i in (hotkill.ini) do del /f /q /s WORKDIR\%%i > NUL

REM ---------- Update any files that are also in the SP1.CAB ----------
ECHO Merge the 2 packs.
xcopy /d /h /u /y WORKDIR\*.* SP1CAB

ECHO Make SP1.cab
cabarc.exe N SAVEDIR\sp1.cab SP1CAB\*.*

REM ---------- Compress to MS format ----------
ECHO Compress all the files
compress.exe -d -r -zx21 WORKDIR\* SAVEDIR

REM ---------- Generate the .inf file -----------
ECHO Create the .inf file.
echo [Version] > svcpack.inf
echo Signature="$Windows NT$" >> svcpack.inf
echo MajorVersion=5 >> svcpack.inf
echo MinorVersion=1 >> svcpack.inf
echo BuildNumber=2600 >> svcpack.inf
echo. >> svcpack.inf
echo [SetupData] >> svcpack.inf
echo CatalogSubDir="\i386\svcpack" >> svcpack.inf
echo. >> svcpack.inf
echo [SetupHotfixesToRun] >> svcpack.inf

for /f "usebackq delims==" %%i in (`dir /b HFTYPE1\*.exe`) do echo %%~ni.exe /n /q /u /z >> svcpack.inf
for /f "usebackq delims==" %%i in (`dir /b HFTYPE2\*.exe`) do echo %%~ni.exe /Q:A /R:N >> svcpack.inf
echo. >> svcpack.inf
echo [ProductCatalogsToInstall] >> svcpack.inf
for /f "usebackq delims==" %%i in (`dir /b SAVEDIR\SVCPACK\*.cat`) do echo %%~ni.cat >> svcpack.inf

REM ---------- compress svcpack.inf ----------
ECHO Compress the .inf File.
compress.exe -d -r -zx21 svcpack.inf SAVEDIR

REM ---------- copy new system files to output folder ----------
ECHO Copy any Additional Files.
if exist SYS\*.* xcopy /y SYS\*.* SAVEDIR

:_end

(I hate those long posts with too much code to read ... sorry!)

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