Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

create a cab file

262 views
Skip to first unread message

Crisler Moor

unread,
Jul 15, 2002, 9:35:22 PM7/15/02
to
I'm looking to see if anyone could point me to an example of creating a CAB
file from JScript.


thanks in advance

crisler


Torgeir Bakken

unread,
Jul 16, 2002, 10:53:35 PM7/16/02
to
Crisler Moor wrote:

> I'm looking to see if anyone could point me to an example of creating a CAB
> file from JScript.

You can e.g. use the cabarc.exe from the Microsoft Cabinet SDK or
EclipseCabinet99 (free 3.rd party component):

1)
MS command line utilities that you can start from a script:

Microsoft Cabinet SDK:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

2)
Using 3. party components.

A free ActiveX component from Green Eclipse Software
(http://www.greeneclipsesoftware.com) can be used. It is a part of EclipseUI
that can be installed or downloaded (for installation later) from this site.

Note: The help files are generated on the fly first time you _run_ the controls!

Here is a VBScript example using EclipseCabinet99:

Set oCompress = CreateObject("EclipseCabinet99.ecCompress")
Set oExtract = CreateObject("EclipseCabinet99.ecExtract")

' Cabfile to create
sCabFile = "C:\test\Sample.cab"
' All files in this folder will be added
sSourceFolder = "C:\test\MyCAB"
' This file will be added
sSourceFile1 = "C:\another\test.inf"
' This file will also be added
sSourceFile2 = "C:\another\_NPAD.EXE"

oCompress.Filename = sCabFile
oCompress.Files.AddFolder sSourceFolder
oCompress.Files.Add sSourceFile1
oCompress.Files.Add sSourceFile2
oCompress.Compress
Set oCompress = Nothing

MsgBox "Compress finished"

' over to extracting
oExtract.Filename = sCabFile

For Each MyFile In oExtract.Files
With MyFile
If LCase(Right(.Filename, 4)) = ".inf" Then .Selected = True
End With
Next

' Extract all inf-files to separate folder
sTargetFolderInf = "C:\test\MyExtractInf"
oExtract.Extract sTargetFolderInf

' Extract all files to another folder:
sTargetFolder = "C:\test\MyExtract"
oExtract.ExtractAll sTargetFolder

MsgBox "Extract finished"


--
torgeir


0 new messages