Looking for the latest CABARC file.

Discussion in 'Scripting' started by Outbreaker, Mar 23, 2020.

  1. Outbreaker

    Outbreaker MDL Member

    Jan 20, 2018
    109
    17
    10
    Hi,
    I'm looking for the latest cabarc.exe file. [​IMG]
    If anyone has IEAK 10 on their computer or has an newer cabarc.exe file version than 6.1.7601.16978 then please share it. [​IMG]
    Strangely though, IEAK 11 has cabarc.exe version 5.0.2147.1, while IEAK 10 has version 6.2.9200.16521. :rolleyes:

    I also did some testing and i couldn't find out way RVM can get the cab file smaller than CABARC. :confused:
    MAKECAB = 88MB
    CABARC = 61MB
    RVM Integrator = 58MB
     
  2. i think cabarc is to create Cab archives froma directory of files vice versa.
     
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,435
    49,883
    340
    Latest is not always better

    did you used LZX:21 compression in your testing?

    i just made a test with all cabarc.exe versions i have + makecab.exe
    all created cab file with same size (except the oldest version)
    Code:
    Total files:             90
    Bytes before:    24,701,295
    Bytes after:      3,535,292
    After/Before:            14.31% compression
    
    3,550,106 1.00.0601-sdk_4.71.410.0.cab
    3,543,900 5.0.2147.1.cab
    3,543,900 5.2.3790.0.cab
    3,543,900 6.0.5730.13.cab
    3,543,900 6.0.6001.18702.cab
    3,543,900 6.1.7601.16978.cab
    3,543,900 6.2.9200.16521.cab
    3,543,900 makecab.cab
    
    result may differ if the file contain folders or variable compressable files
     
  4. Outbreaker

    Outbreaker MDL Member

    Jan 20, 2018
    109
    17
    10
    #4 Outbreaker, Mar 23, 2020
    Last edited: Mar 23, 2020
    (OP)
    I did use LZX:21 on all test runs. ;) And how did you got the makecab.exe to compress the cab file the same sizes as the cabarc.exe with multiple files (I have a folder with over 4000 files)? :confused:

    EDIT:
    The tool "HeleCABCompresor" can even make cab files 5% smaller than cabarc, with the option "Extension grouping" which i think RVM is also using. But "HeleCABCompresor" can not be using in a Batch file. :(
    https://www.sac.sk/download/pack/cabcomp.exe
     
  5. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,435
    49,883
    340
    it depend on creating the appropiate directives file (no very long paths or spaces)

    you can use this batch script (drag and drop the folder on the script)
    Code:
    @echo off
    rem original: http://www.dostips.com/forum/viewtopic.php?t=1977#p8751
    
    if "%~1"=="" goto :eof
    set "sourceFolder=%~1"
    set "cabFolder=%~dp0"
    set "cabFolder=%cabFolder:~0,-1%"
    set "cabName=%~n1.cab"
    
    call :mkCab "%sourceFolder%" "%cabFolder%" "%cabName%"
    
    pause
    exit
    
    
    :mkCab
    setlocal EnableDelayedExpansion
    pushd "%temp%"
    (echo .Option Explicit
    echo .Set SourceDir="%~1"
    echo .Set DiskDirectoryTemplate="%~2"
    echo .Set CabinetNameTemplate="%~3"
    echo .Set MaxDiskSize=0
    echo .Set MaxCabinetSize=0
    echo .Set MaxDiskFileCount=0
    echo .Set CabinetFileCountThreshold=0
    echo .Set FolderFileCountThreshold=0
    echo .Set FolderSizeThreshold=0
    echo .Set UniqueFiles=OFF
    echo .Set RptFileName=nul
    echo .Set InfFileName=nul
    echo .Set Cabinet=ON
    echo .Set Compress=ON
    echo .Set CompressionType=LZX
    echo .Set CompressionMemory=21)>directives.ddf
    for /f "tokens=2 delims=:" %%i in ('chcp') do set /a oemcp=%%~ni
    chcp 1252>nul
    for /f "delims=" %%i in ('dir /b /a-d "%~1" 2^>nul') do (
      >>directives.ddf echo "%%i"
    )
    for /d /r "%~1" %%i in (*) do (
      set "subdir=%%i"
      >>directives.ddf echo .Set SourceDir="!subdir!"
      >>directives.ddf echo .Set DestinationDir="!subdir:%~1\=!"
      for /f "delims=" %%j in ('dir /b /a-d "!subdir!" 2^>nul') do (
        >>directives.ddf echo "%%j"
      )
    )
    chcp %oemcp%>nul
    makecab /f directives.ddf
    del directives.ddf
    popd
    endlocal
    goto :eof

    or this powershell function
    https://forums.mydigitallife.net/threads/new-cabinetfile.80344

    or this gui tool
    https://x0.at/mIE.zip
    Code:
    DXTool_BETA_x64.exe /CT SourceFolder
    i don't know what's that "Extension grouping" is
    but i know that WiX Toolset can reduce cab size by compressing duplicate files once (similar to 7z solid archive feature)
    however, it's not easy to accomplish
     
  6. Outbreaker

    Outbreaker MDL Member

    Jan 20, 2018
    109
    17
    10
  7. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,435
    49,883
    340
    I tested the extracted folder with the makecab batch i posted
    the size is identical to cabarc_LZX;21.cab

    how did you created makecab_LZX;21.cab exactly? i see a lot of blocks

    i can't tell how RVM do its thing to reduce the cab size
     
  8. Outbreaker

    Outbreaker MDL Member

    Jan 20, 2018
    109
    17
    10
    With the MAKECAB script you posted i get the same size as with the CABARC now. :bananajoj2:
    I think it has to do that i used the commands below at the CMD itself instead of putting them into the directives.ddf file, :punch:
    Code:
    makecab.exe /D DiskDirectoryTemplate="%~2" /D MaxDiskSize=0 /D MaxCabinetSize=0 /D MaxDiskFileCount=0 /D CabinetFileCountThreshold=0 /D FolderFileCountThreshold=0 /D FolderSizeThreshold=0 /D UniqueFiles=OFF /D RptFileName=nul /D InfFileName=nul /D Cabinet=ON /D Compress=ON /D CompressionType=LZX /D CompressionMemory=21 /D CabinetName1=test1.cab /D DiskDirectoryTemplate=tmp\ /f "files.txt"
    I also suspect that RVM and "HeleCABCompresor" uses a cab funtion called "Extensions grouping" but there is almost no information about this on the internet.:tumbleweed:
    .
     
  9. mukke

    mukke MDL Novice

    May 2, 2014
    8
    5
    0
    I know it's been a while, I just stumbled across this thread now .. fwiw:

    there is RyanVM's thread at msfn on repacking driver.cab


    Extension grouping is/was a 'technique' used to repack driver.cab in old XP times, probably first used by Mr.GreenMachine


    here is a script by idle.newbie
    Code:
    //install to Explorer shell, put it under \windows\system32
    //REG ADD "HKCR\Directory\shell\cabIt\command" /VE /D "WScript \"%SystemRoot%\system32\cabIt.js\" \"%L\"" /F
    var WshShell = WScript.CreateObject("WScript.Shell");
    var fso = WScript.CreateObject("Scripting.FileSystemObject");
    var args = WScript.Arguments.Unnamed;
    
    var fFolder = (args.length > 0) ? args.item(0) : ".";
    try {
        fFolder = fso.getFolder(fFolder);
    } catch (e) {
        WScript.echo('"' + fFolder + '" is not a valid folder name.');
        WScript.Quit(1);
    }
    
    
    var aFiles = new Array();
    traversal(fFolder);
    var ddf = makeDDF(fFolder, aFiles.sort());
    WshShell.run('MakeCAB /V1 /F ' + ddf, 1, true);
    fso.deleteFile(ddf, true);
    
    function traversal(f) {
        var fc = new Enumerator(f.Files);
        for (;!fc.atEnd(); fc.moveNext())    aFiles.push(fc.item());
        fc = new Enumerator(f.SubFolders);
        for (;!fc.atEnd(); fc.moveNext())    traversal(fc.item());
        return;
    }
    
    function makeDDF(f, a) {
        var fn = fso.GetSpecialFolder(2) + '\\' + fso.getTempName();
        var tf = fso.createTextFile(fn, true);
        tf.writeLine('.OPTION EXPLICIT');
        tf.writeLine('.Set InfFileName=NUL');
        tf.writeLine('.Set RptFileName=NUL');
        tf.writeLine('.Set DestinationDir=');
        tf.writeLine('.Set DiskDirectory1="' + f.parentFolder + '"');
        tf.writeLine('.Set MaxDiskSize=CDROM');
        tf.writeLine('.Set UniqueFiles=OFF');
        tf.writeLine('.Set CabinetName1="' + f.name + '.cab"');
        tf.writeLine('.Set Cabinet=ON');
        tf.writeLine('.Set Compress=ON');
        tf.writeLine('.Set CompressionType=LZX');
        tf.writeLine('.Set CompressionMemory=21');
        tf.writeLine('.Set FolderSizeThreshold=2500000');
        tf.writeLine('');
        for (var i = 0; i < a.length; i++) {
            tf.writeLine('"' + a[i] + '" "' + ('' + a[i]).substring(1 + ('' + f).length) + '"');
        }
        tf.close();
        return fn;
    }
    
     
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,435
    49,883
    340
    @mukke

    Thanks for sharing
     
  11. BAU

    BAU MDL Addicted

    Feb 10, 2009
    859
    1,726
    30
    #11 BAU, Nov 29, 2020
    Last edited: Nov 29, 2020
    Compressed2TXT cabonly is better tough in supporting special characters or adding multiple files and folders in one go.
    And I can see where a size difference might come from: long file and folder names; by default those would be repeated, but by constructing the ddf via other layout you can minimize that.
    To actually improve compression ratio on cab above the LZX21, one would need to use microsoft's differential compressor in addition (not published, used for updates)