Jump to content

Strange bug in HFSLIP related to short 8.3 names


tomasz86

Recommended Posts

I found a very strange bug and don't really know why it occurs. I do know how to fix it though.

  1. In the HFSLIP's script you can find the following lines:
    ECHO.&ECHO Locating compressed files in I386 subfolders
    SET BASEDIR=%~dp0SOURCESS\I386\
    DIR/B/AD SOURCESS\I386>WORK\SSSI386SUB0.TXT
    FINDSTR/VBI "SVCPACK" WORK\SSSI386SUB0.TXT>WORK\SSSI386SUB.TXT
    FOR /F "DELIMS=" %%Z IN (WORK\SSSI386SUB.TXT) DO DIR/B/S/A-D/ON "SOURCESS\I386\%%Z">>WORK\SSSI386SUBALL.TXT


  2. Add a PAUSE at the end of it:
    ECHO.&ECHO Locating compressed files in I386 subfolders
    SET BASEDIR=%~dp0SOURCESS\I386\
    DIR/B/AD SOURCESS\I386>WORK\SSSI386SUB0.TXT
    FINDSTR/VBI "SVCPACK" WORK\SSSI386SUB0.TXT>WORK\SSSI386SUB.TXT
    FOR /F "DELIMS=" %%Z IN (WORK\SSSI386SUB.TXT) DO DIR/B/S/A-D/ON "SOURCESS\I386\%%Z">>WORK\SSSI386SUBALL.TXT
    PAUSE


  3. Now run the script. After it has paused, open the "WORK\SSSI386SUBALL.TXT" file. It will look like this:
    R:\HFSLIP_test1\SOURCESS\I386\COMPDATA\3COM.HTM
    R:\HFSLIP_test1\SOURCESS\I386\COMPDATA\3COM.TXT
    R:\HFSLIP_test1\SOURCESS\I386\COMPDATA\AACRAID.HTM
    R:\HFSLIP_test1\SOURCESS\I386\COMPDATA\AACRAID.TXT
    R:\HFSLIP_test1\SOURCESS\I386\COMPDATA\ACCELPRO.HTM
    etc.


  4. Download one of the OnePiece's .NET Framework addons, ex. Onepiece's Microsoft .NET Framework 1.1 SP1 for Windows 2000 with GDR updates TRUE Addon and place it in HFAAO (you may need to rename it to something shorter, ex. "NETFX20.CAB").
  5. Run the script again and wait until it has paused.
  6. Check "WORK\SSSI386SUBALL.TXT" again. It will look like this:
    R:\HFSLIP~1\SOURCESS\I386\COMPDATA\3COM.HTM
    R:\HFSLIP~1\SOURCESS\I386\COMPDATA\3COM.TXT
    R:\HFSLIP~1\SOURCESS\I386\COMPDATA\AACRAID.HTM
    R:\HFSLIP~1\SOURCESS\I386\COMPDATA\AACRAID.TXT
    R:\HFSLIP~1\SOURCESS\I386\COMPDATA\ACCELPRO.HTM
    etc.


    For some reason the short names are used and I can't figure out why (the switched used is just a standard "DIR/B/S/ON").

Now the real problem is that this completely breaks updating files from the I386\UNIPROC folder which happens later. The files located in in I386\UNIPROC are the following ones (in Win2k):

KERNEL32.DL_
MP2UP.CAT
MP2UP.INF
NTDLL.DLL
WIN32K.SY_
WINSRV.DL_

Normally HFSLIP should just update them with the newer versions. Now when the problem from 6) occurs they are not updated. After the script finishes the folder looks like this:

KERNEL32.DLL
KERNEL32.DL_
MP2UP.CAT
MP2UP.INF
NTDLL.DLL
WIN32K.SYS
WIN32K.SY_
WINSRV.DLL
WINSRV.DL_

The first KERNEL32.DLL is the newly added file while KERNEL32.DL_ is the original one. Unfortunately Windows setup installs the latter which means that the new version is not installed.

I don't know why such a strange bug occurs but I do know how to fix it. The following line:

FOR /F "DELIMS=" %%Z IN (WORK\SSSI386SUB.TXT) DO DIR/B/S/A-D/ON "SOURCESS\I386\%%Z">>WORK\SSSI386SUBALL.TXT

must be changed to:

FOR /F "DELIMS=" %%Z IN (WORK\SSSI386SUB.TXT) DO DIR/B/S/A-D/ON "%~dp0SOURCESS\I386\%%Z">>WORK\SSSI386SUBALL.TXT

I would call this bug critical and want to ask for a quick fix (Mim0?) because this completely breaks Win2k installation.

Link to comment
Share on other sites


  • 8 months later...

I've finally managed to find the culprit!

Using "extract.exe" causes to unpack CAB addons causes the CMD window to use short names. "Extract.exe" is used by HFSLIP only once which is when unpacking CAB addons:

This is the full code

FOR /F "DELIMS=" %%I IN ('DIR/B/A-D/ON HFAAO') DO (
IF /I "%%~xI"==".rar" IF EXIST HFTOOLS\RAR.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\RAR e "HFAAO\%%I" * "%PREP%TEMP\AAO\" >NUL&&CALL :PROCESS_AAO
IF /I "%%~xI"==".cab" IF EXIST HFTOOLS\EXTRACT.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\EXTRACT /E /L TEMP\AAO "HFAAO\%%I" >NUL&&CALL :PROCESS_AAO
IF /I NOT "%%~xI"==".rar" IF /I NOT "%%~xI"==".cab" (
IF EXIST HFTOOLS\7ZA.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\7ZA x "HFAAO\%%I" -o"%PREP%TEMP\AAO" -r >NUL&&CALL :PROCESS_AAO
)
)

After removing parts not related to CAB addons:

FOR /F "DELIMS=" %%I IN ('DIR/B/A-D/ON HFAAO') DO (
IF /I "%%~xI"==".cab" IF EXIST HFTOOLS\EXTRACT.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\EXTRACT /E /L TEMP\AAO "HFAAO\%%I" >NUL&&CALL :PROCESS_AAO
)

The problem lies here:

HFTOOLS\EXTRACT /E /L TEMP\AAO "HFAAO\%%I"

I did a simple test doing:

DIR/B/S HFAAO

before and after extracting a CAB addon. The result was:

1. Before:

D:\HFSLIP\TEMP\HFSLIP_test\HFAAO\NETFX11.cab

2. After:

D:\HFSLIP\TEMP\HFSLIP~2\HFAAO\NETFX11.cab

"HFSLIP_test" got changed into "HFSLIP~2" and this causes all the issues which I described in this topic above.

The solution to this problem is very simple. Remove this line all together:

IF /I "%%~xI"==".cab" IF EXIST HFTOOLS\EXTRACT.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\EXTRACT /E /L TEMP\AAO "HFAAO\%%I" >NUL&&CALL :PROCESS_AAO

and change the next one from

IF /I NOT "%%~xI"==".rar" IF /I NOT "%%~xI"==".cab" (

to

IF /I NOT "%%~xI"==".rar" (

so that the result should be

FOR /F "DELIMS=" %%I IN ('DIR/B/A-D/ON HFAAO') DO (
IF /I "%%~xI"==".rar" IF EXIST HFTOOLS\RAR.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\RAR e "HFAAO\%%I" * "%PREP%TEMP\AAO\" >NUL&&CALL :PROCESS_AAO
IF /I NOT "%%~xI"==".rar" (
IF EXIST HFTOOLS\7ZA.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\7ZA x "HFAAO\%%I" -o"%PREP%TEMP\AAO" -r >NUL&&CALL :PROCESS_AAO
)
)

7-Zip is capable of unpacking CABs so there's no need to use the outdated "extract.exe". In fact, at this point I'd suggest removing the RAR part too, leaving just

FOR /F "DELIMS=" %%I IN ('DIR/B/A-D/ON HFAAO') DO (
IF EXIST HFTOOLS\7ZA.EXE ECHO.&&ECHO Processing %%I&&HFTOOLS\7ZA x "HFAAO\%%I" -o"%PREP%TEMP\AAO" -r >NUL&&CALL :PROCESS_AAO
)

since 7-Zip can process RAR too.

Edited by tomasz86
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...