Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   working with dll exported functions ... (http://forums.winamp.com/showthread.php?t=322157)

thanatos83 1st September 2010 19:47

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

thanatos83 2nd September 2010 15:25

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:

PHP Code:

# 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?

Wizou 3rd September 2010 15:23

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)

jiake 5th September 2010 04:50

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.

thanatos83 5th September 2010 11:03

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?

Wizou 5th September 2010 18:22

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)


All times are GMT. The time now is 17:27.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.