Jump to content

[help] Problem with makecab directives


Camarade_Tux

Recommended Posts

Hi everybody,

I'm trying to make a slipstreamer for Vista Icon Pack and I've nearly done it.

File are found, extracted, modified but I can't compress them.

I want to do that with makecab and directive file to avoid having 60 black boxes appearing and disappearing on my screen.

This is the beginning of my directive file:

.Set Compress=ON
.Set Cabinet=OFF
.Set CompressionType=LZX
.Set CompressionMemory=21
.Set SourceDir=d:\temp\WORK
.Set DiskDirectoryTemplate=D:\VIP
accwiz.exe
ahui.exe
appwiz.cpl
...

And I get this:

D:\Scratch\Download\VIPv2_SP>makecab /F d:\temp\work\directives.ddf
Microsoft (R) Cabinet Maker - Version 5.1.2600.0
Copyright (c) Microsoft Corporation. All rights reserved..

26,381,312 bytes in 58 files
0.00% - accwiz.exe (1 of 58)
d:\temp\work\directives.ddf(10): ERROR: NOT IMPLEMENTED YET: compressing single
files: accwiz.exe
d:\temp\work\directives.ddf(10): ERROR: MakeCAB aborted.

If I change ".Set Cabinet=OFF" to ".Set Cabinet=ON", it works normally.

Does anyone know how I could get this to work ?

Thanks.

Link to comment
Share on other sites


[DELETED]

In fact directives are much more efficient. They require less time to complete since makecab doesn't have to be run again and again.

Did you benchmarked that ?

I'm pretty sure that the executable remains in the disk cache between runs ?

Edited by Delprat
Link to comment
Share on other sites

Look for the simple answer ...

A directive file (or DDF, Diamond Directive FIle) is not intended to compress individual files. Your stated goal is not to see the DOS box flash. Simply direct MAKECAB output to NUL ... The following code compresses everything in DIR1 into DIR2 discretly:

FOR /F "USEBACKQ" %%I IN (`DIR /A-D /B DIR1\*.* 2^>NUL`) DO (
MAKECAB /D CompressionMemory=21 /D CompressionType=LZX /L DIR2 DIR1\%%I > NUL
)

Or to see what is happening:

FOR /F "USEBACKQ" %%I IN (`DIR /A-D /B DIR1\*.* 2^>NUL`) DO (
ECHO Compressing %%I
MAKECAB /D CompressionMemory=21 /D CompressionType=LZX /L DIR2 DIR1\%%I > NUL
)

Link to comment
Share on other sites

I've searched in hfslip code and it uses DDFs only to create cabinets.

If you look in makecab.doc around your screenshot, you'll see example showing how to compress like you want : in each one there's at least one file not compressed :

.Set Compress=OFF
.Set Cabinet=OFF
setup.exe
setup.inf
.Set Compress=ON
.Set Cabinet=OFF
.Set CompressionType=LZX
.Set CompressionMemory=21
.Set SourceDir=d:\temp\WORK
.Set DiskDirectoryTemplate=D:\VIP
accwiz.exe
ahui.exe
appwiz.cpl
...

Also, hfslip uses DiskDirectory1 instead of DiskDirectoryTemplate, and no SourceDir but a relative path on each file.

++

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