Archive: working with dll exported functions ...


working with dll exported functions ...
  Hi all.

i have some questions about this, please any help:

First, i need use System.dll to call unrar.dll ?, so i put down some functions of this plugin but i need some functions, not all really?, to extract contents of RAR file.

- unrar::RARCloseArchive
- unrar::RARGetDllVersion
- unrar::RAROpenArchive
- unrar::RAROpenArchiveEx
- unrar::RARProcessFile
- unrar::RARProcessFileW
- unrar::RARReadHeader
- unrar::RARReadHeaderEx
- unrar::RARSetCallback
- unrar::RARSetChangeVolProc
- unrar::RARSetPassword
- unrar::RARSetProcessDataProc
- unrar::___CPPdebugHook

I read about the plugin http://nsis.sourceforge.net/Calling_...tem.dll_plugin

But i confused about how to put first in the script... :s


working with dll exported functions ...
  Hi.

I was starting to write some script to use some exported functions from "unrar.dll" and the objective of all of this is to extract some rar files to target dir installation like "$INSTALLDIR".

First i put this:


# Installer sections


>Section -Base SEC0000

SetPluginUnload alwaysoff
SetOutPath"$PLUGINSDIR" ; create temp directory
File"${NSISDIR}\Plugins\unrar.dll" ; copy dll there
CallInstDLL"$PLUGINSDIR\unrar.dll" unrar::RAROpenArchive
SetPluginUnload manual
#System::Free 0
#WriteRegStr HKLM "${REGKEY}\Components" Base 1

>SectionEnd
>
how i can continue?

You're not really using System to call your DLL here.
CallInstDLL is the old way of calling NSIS plugins.

You should use System::Call to call unrar.dll function. It will requires you to specify the prototype of the function using System specific syntax (see System plugin help file)


Download this file:
http://www.rarlab.com/rar/UnRARDLL.exe
And extract it using WinRAR, read unrardll.txt. It shows you the structrue and functions of unrar.dll, and the constants are defined in unrar.h.


OK thanks...

So it's more easy with unrar.exe, but progress bar jumps when you use it with nsExecToLog.

Is there anyway to set a proper progress bar with this compressor, for example when the compressor is extracting a file?


No.

Note: Even when NSIS is extracting a file by itself, the progress bar is not moving (only a percentage of the progress is displayed)