UnRAR is the official library from RARLabs for extracting WinRAR archives. This project implements UnRAR bindings for RealStudio and Xojo Win32 applications. Creating archives is not supported by the library.
The project consists of a module containing three classes: Iterator, IteratorEx, and ArchiveEntry.
The Iterator class implements the basic, older UnRAR interface. It does not support Unicode filenames, archives with encrypted headers, or extracting into memory. For almost all archives you should prefer the IteratorEx class.
DimarchiveAsFolderItem' assume a valid RAR archiveDimoutputdirAsFolderItem' assume a valid directoryDimrarAsNewUnRAR.IteratorEx(archive)DoIfNotrar.MoveNext(UnRAR.RAR_EXTRACT,outputdir)ThenExitDoLooprar.Close- Download the RB-RAR project either in ZIP archive format or by cloning the repository with your Git client.
- Open the RB-RAR project in REALstudio or Xojo. Open your project in a separate window.
- Copy the UnRAR module into your project and save.
You will need to ship the UnRAR.dll file with your application and install it into the same directory as your app. A pre-built Win32 DLL is available here, or you can build it yourself from source.
DimindexAsInteger=2' the third file in the archiveDimarchiveAsFolderItem' assume a valid RAR archiveDimoutputfileAsFolderItem' assume a valid, non-existing fileDimrarAsNewUnRAR.IteratorEx(archive)rar.Reset(index)' move to the indexCallrar.MoveNext(UnRAR.RAR_EXTRACT,outputfile)rar.CloseDimarchiveAsFolderItem' assume a valid RAR archiveDimrarAsNewUnRAR.IteratorEx(archive)DoIfNotrar.MoveNext(UnRAR.RAR_TEST)ThenExitDoLoopIfrar.LastError<>UnRAR.ErrorEndArchiveThenMsgBox("Test failed!")EndIfrar.CloseDimindexAsInteger=2' the third file in the archiveDimarchiveAsFolderItem' assume a valid RAR archiveDimrarAsNewUnRAR.IteratorEx(archive)rar.Reset(index)' move to the index IfNotrar.MoveNext(UnRAR.RAR_TEST)Andrar.LastError<>UnRAR.ErrorEndArchiveThenMsgBox("Test failed!")EndIfrar.Close