yW0K5o
yW0K5o

Reputation: 943

Simple example to add files to CAB archive

I read this post about replacement of CABARC utility. Microsoft help is covering a lot of options in here.

I need simple example how to add 2 files to CAB using makecab.exe utility.

Something like this.

makeCAB.exe file1.dll file2.INF result.cab

Upvotes: 4

Views: 8463

Answers (2)

Developer63
Developer63

Reputation: 710

For another option that works well for those with basic Visual Studio and C# knowledge, try the approach in my answer to this question. A summary of that approach follows.

C#/.NET: Creating a CAB and adding files to it without an external library

First, you expand all the files in your CAB file to a folder. Then you add your two files, file1.dll and file2.INF to that folder. Then you run the CabMaker.exe program (Windows GUI), available on GitHub here: https://github.com/sapientcoder/CabMaker I simply got the code from GitHub, opened it with Visual Studio (2019), and compiled and ran it inside Visual Studio.

When run, you get the GUI shown below. Note that the CabMaker program is a front end GUI that builds a command line for the MakeCab program and then runs that command line. IN the process, CabMaker creates the necessary DDF file for you as part of its operation. See my linked answer for further details.

enter image description here

Upvotes: 1

yW0K5o
yW0K5o

Reputation: 943

  1. Create Directive file CABMaker.ddf

    ;*** MAKECAB Directive file .Set Cabinet=on .Set Compress=on file1.dll
    file2.INF

  2. Run C:\WINDOWS\system32\makecab.exe /F CABMaker.ddf

Upvotes: 3

Related Questions