Old 29th January 2008, 21:08   #1
Vercoln
Junior Member
 
Join Date: Jan 2008
Posts: 4
Error Code 87 with CABSetup plugin

I am attempting to make a small NSIS script that will help me in the creation/extraction of cab files. Currently, I am playing around with the CABSetup sample files to learn more about how to use the plugin.

I was successful in creating the cab file. Now, I wish to extract from the cab file. However, I get an error code 87 before anything happens. I'm wondering if anyone is able to help me figure out what's going on?

A lot of the code is just copied from the sample, but here it is anyhow:

code:
Section ExtractCab
CABSetup::Extract "C:\Installer\Test\MasterCab\Disk1\MASTER1.CAB" "/TARGET=C:\Installer\Test2" \
/ALL "/reportfile=C:\Installer\Test\MasterCab\MASTER.RPT" \
"/showrate" "/resume"
Pop $R0

; Quit if the extraction completed without error.
${IfThen} $R0 = 0 ${|} Goto Done ${|}

; Handle case where extraction was cancelled.
${If} $R0 = 995
DetailPrint "Extract process was cancelled"
SetDetailsPrint None
Goto Done
${EndIf}

DetailPrint "Extract failed with error code $R0"
Done:

DetailPrint 'Dumping install details log...'
DumpLog::DumpLog 'test.log' .r0
SectionEnd



And here is the log output:
code:
Extract failed with error code 87
Dumping install details log...



If anyone has any ideas, let me know! I could use the help. I have never worked with cab files before.

Thanks!
Vercoln is offline   Reply With Quote
Old 30th January 2008, 12:39   #2
Vercoln
Junior Member
 
Join Date: Jan 2008
Posts: 4
Awww, dang. I just figured out why it didn't work...

code:
CABSetup::Extract "C:\Installer\Test\MasterCab\Disk1\MASTER1.CAB" "/TARGET=C:\Installer\Test2" \
/ALL "/reportfile=C:\Installer\Test\MasterCab\MASTER.RPT" \
"/showrate" "/resume"



is wrong and it SHOULD be

code:
CABSetup::Extract "/SOURCE=C:\Installer\Test\MasterCab\Disk1\MASTER1.CAB" "/TARGET=C:\Installer\Test2" \
/ALL "/reportfile=C:\Installer\Test\MasterCab\MASTER.RPT" \
"/showrate" "/resume"

Vercoln is offline   Reply With Quote
Old 31st January 2008, 13:12   #3
Mr Inches
Member
 
Join Date: Jan 2006
Location: Canberra, Australia
Posts: 76
Any positive non-zero return code from the CABSetup functions will be a value that could be returned from the GetLastError Windows API function. The value -1 is returned if the normal error code could not be returned and should only happen if the system is extremely low on memory i.e. there is less than the length of an NSIS string free.

Error 87 is as follows (from MSDN):

ERROR_INVALID_PARAMETER
87
0x57

The parameter is incorrect.

As you correctly noticed, one of the parameters passed to the function was incorrect - trying to extract files without a valid source cabinet or target path currently counts as specifying invalid parameters for Extract.

Sounds like it might be an idea to add 87 and its meaning to the commonly returned error codes for each function in CABSetup.txt; I will do this for the next update.

Duncan
Mr Inches is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump