Welcome to the Gamebase 64 forums.                 An attempt to document ALL Commodore 64 gameware before it's too late!

Gamebase 1.3: 7-zip failed to unpack archive!

Are you having problems setting up GB64 on your machine? Ask your questions in here!

Moderator: Jimbo

User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Tue Jun 25, 2019 2:42 pm

my final thoughts on this...

the problem could be the 7z.dll with Win10

7zr.exe unpacks without the need for the dll file.
but only unpacks 7z archives (not ZIP). :cry:

to test it...
Create and link a few .7z files to a gamebase

download - lzma1900.7z Any / x86 / x64 LZMA SDK: (C, C++, C#, Java)
https://www.7-zip.org/download.html

rename 7zr.exe to 7z.exe and put it in the gamebase directory.
run the 7z game from gamebase.
this has been tested, and does work on Win7 and XP.
AlphaUMi
New Member
Location: 127.0.0.1
Posts: 16
Joined: Fri Apr 26, 2019 12:49 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Tue Jun 25, 2019 3:34 pm

.mad, sorry to say that it does not work in Windows 10. I'm sure I've done what needed carefully: modified database to point to a couple of games renamed and recompressed in 7z format, replaced 7z.exe with 7zr.exe and renamed it (I tried both x32 and x64 versions).

From the GameBase interface, in fact, at the bottom left corner in the status bar, I could see that my modifications were actually there. But no luck. Sorry. :cry: :cry:
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Tue Jun 25, 2019 4:50 pm

i guess you did use the NEW GEMUS.DLL with the correct command-line -y -r -o
not the old one with -yro.

please forgive me, i just need to make sure. ;)

if that didn't even find and run the 7zr.exe. i have no idea how to open the CMD window for any other unzip tool in win10.
AlphaUMi
New Member
Location: 127.0.0.1
Posts: 16
Joined: Fri Apr 26, 2019 12:49 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Tue Jun 25, 2019 6:33 pm

Yes, .mad, I did use the latest Gemus.dll you provided. And GameBase finds 7zr (renamed 7z.exe), it just cannot execute it, just in the same way the regular 7z. :cry:
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Wed Jun 26, 2019 9:07 am

well it must be the way Visual Basic 6 calls the shell that win10 doesn't like.
maybe shell32.dll is the key???

any of these lines in the unpacking code could be the problem...

Private m_strCommandCom As String

Set m_xobjFunc = New GBFuncs.clsFunctions
m_strCommandCom = m_xobjFunc.Long2Short(Environ$("COMSPEC")) & " /c "

Dim strCommandLine As String

Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long

' x extract with full paths
' -y answer yes on all queries
' -r recurse directories
' -o output folder
' (7-zip help file recommends using long filenames, as short [8.3] ones may not work 100% of the time)
strCommandLine = m_strCommandCom & strExtractorPath_in & " x """ & strFile_in & """ -y -r -o""" & strDestPath_in & "\"""
Call LogStatus("Running 7-Zip [" & strCommandLine & "]")
lngRetVal = CreateProcess(sNull, strCommandLine, ByVal 0&, ByVal 0&, 1&, NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo, pInfo)
lngRetVal = WaitForSingleObject(pInfo.hProcess, INFINITE)

-------------------
searching online i found possible new command-line code that might work in win10.

You can use the Shell command. To execute internal DOS command (Dir, Copy,
etc. as well as redirection of screen output), the command processor must be
specified (using the Environ$ function and "comspec" as its argument returns
the correct command processor path on NT and non-NT systems) . Specifying
the command processor is safe & generic and will work with non-internal
commands also. That syntax, using an XCopy command as an example is:

Shell Environ$("comspec") & " /c xcopy """ & _
Source & """ """ & Destination & """ " & Option, vbHide


Shell Environ("comspec") _
& " /k " & Chr(34) & myFileName & Chr(34) & " " & myparms, vbNormalFocus


Use /c says to close that (hidden!) window when it's done.
The /k to see the command window (/k = keep open).


--------------------
Re: vb6 and the shell command.

Code:

Option Explicit '<-- ENABLE THIS ALWAYS!!! See What is Option Explicit, and why should I use it?

Private Sub Command1_Click()
Dim sCmdLine As String 'See Understanding the Scope of Variables
Dim sExeDir As String

sExeDir = """" & App.Path & "\mailsend\"

sCmdLine = sExeDir & "mailsend.exe""" & _
" -f " & sExeDir & "attach.txt""" & _
" -from bcenterprises@thicomm.com" & _
" -smtp smtp.1and1.com" & _
" -port 587" & _
" -auth LOGIN bcenterprises@thicomm.com •••••••••••" & _
" -to matt@thicomm.com" & _
" -msg ""test 123"""

MsgBox sExeDir & vbNewLine & vbNewLine & sCmdLine, vbInformation

Shell sCmdLine, vbNormalFocus
End Sub
-------------------------
Notice how quotation marks are embedded in the string by adding another quotation mark.




are there any coders out there that can confirm it works with vb6? :mrgreen:
Anselm1
New Member
Posts: 12
Joined: Mon Jan 15, 2018 10:05 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Thu Jun 27, 2019 7:48 pm

AlphaUMi wrote:
Tue Jun 25, 2019 6:33 pm
Yes, .mad, I did use the latest Gemus.dll you provided. And GameBase finds 7zr (renamed 7z.exe), it just cannot execute it, just in the same way the regular 7z. :cry:
AlphaUMi, you can try to use the following program to analyse what is going wrong:
Process Monitor - Windows Sysinternals | Microsoft Docs
https://docs.microsoft.com/en-us/sysint ... ds/procmon
AlphaUMi
New Member
Location: 127.0.0.1
Posts: 16
Joined: Fri Apr 26, 2019 12:49 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sat Jun 29, 2019 4:20 pm

Hello Anselm, hello mad (you are still tuned, right?)

I completely forgot about Process Monitor, although I am familiar with it since the XP era. OK, I've attached a procmon log with the error occurring. I've closed as many programs as I can. New Gemus.dll and 7z.exe and 7z.dll were running during the test. If you search in the log for 7z, you'll find some interesting errors. I hope you can make use of the log to make some improvements, or resolve the issue!

Note that GameBase in itself does not report any errors during the filesystem operations. But, as mad suggested, the issue must reside in the way GameBase code calls cmd, since there are no errors if you try to decompress the game through cmd directly.

Here is my log:
http://s000.tinyupload.com/index.php?fi ... 7220783202

Let me know something!

Cheers!
Alpha.
Anselm1
New Member
Posts: 12
Joined: Mon Jan 15, 2018 10:05 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sat Jun 29, 2019 6:14 pm

AlphaUMi wrote:
Sat Jun 29, 2019 4:20 pm
If you search in the log for 7z, you'll find some interesting errors.
Yes, it says "Invalid name."

It looks like the parameters are added to the name of the executable. But they should be recognized as parameters.

@Mad, i do not have experience with VB, can you see something in the API to deal with the parameters?
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 9:11 am

Hi Anselm, ;)

i definitley see a space in the command after the exe.
7z.exe x "R-TUJK_06141_01.zip" -y -r -o

but not the drive and folder path of the ZIP file in the process log.
7z.exe x "c:\gamespath\R-TUJK_06141_01.zip" -y -r -o

the output folder looks correct though, but i cannot see a final quote"
"C:\Users\AlphaUMi\AppData\Local\Temp\0\"

@AlphaUMi,
i wonder...
if you copy "R-TUJK_06141_01.zip" to the same path as the 7z.exe in the GameBase dir.
the run the "R-TUJK_06141_01.zip" gamefile as normal from gamebase.
does it find and unpack the 2nd copy? :idea:

still very strange???
as it works in WinXP and Win7 as it is.
Anselm1
New Member
Posts: 12
Joined: Mon Jan 15, 2018 10:05 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 10:35 am

Hi Mad,

Atypical communication environment for us :wink:

There is a space in the PATH:

F:\EMULATORS\COMMODORE 64\GameBase\7z.exe

Did you put quotation marks arround it?
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 12:50 pm

Anselm1 wrote:
Sun Jun 30, 2019 10:35 am
There is a space in the PATH:

F:\EMULATORS\COMMODORE 64\GameBase\7z.exe

Did you put quotation marks arround it?
yes, i just re-compiled gemus.dll with full path to the game zip in quotes, and tested that on Win7.
it still works but now shows the full path in the log.

-----------------clsUnpack.SevenListUnpack-----------------
Changed Directory to [C:\GameBase\GBC_v15\Games\m2]
Running 7-Zip [C:\Windows\system32\cmd.exe /c C:\GameBase\7z.exe x "C:\GameBase\GBC_v15\Games\m2\MERCENE0_04740_05.zip" -y -r -o"C:\GBGame\0\"]
-----------------------------------------------------------

do you mean i need quotes in the 7z.exe path as well?
"C:\GameBase\7z.exe" x "C:\GameBase\GBC_v15\Games\m2\MERCENE0_04740_05.zip" -y -r -o"C:\GBGame\0\"

and what about the cmd path?.
"C:\Windows\system32\cmd.exe"


I just need a Win10 guinea pig.
Anselm1
New Member
Posts: 12
Joined: Mon Jan 15, 2018 10:05 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 1:30 pm

.mad. wrote:
Sun Jun 30, 2019 12:50 pm
Anselm1 wrote:
Sun Jun 30, 2019 10:35 am
There is a space in the PATH:

F:\EMULATORS\COMMODORE 64\GameBase\7z.exe

Did you put quotation marks arround it?
do you mean i need quotes in the 7z.exe path as well?
"C:\GameBase\7z.exe" x "C:\GameBase\GBC_v15\Games\m2\MERCENE0_04740_05.zip" -y -r -o"C:\GBGame\0\"

and what about the cmd path?.
"C:\Windows\system32\cmd.exe"
You always need quotes, if you have a space in the path.

If someone puts the gamebase to another location, as it happens in this case, you should be aware there can be space inside.

So, yes, you need quotes around "F:\EMULATORS\COMMODORE 64\GameBase\7z.exe"

Typically there is no space inside the path of the cmd.exe. But theoretically someone can change it with the ComSpec environment variable. So you should also put quotes arround it.

So this is not a windows 10 problem.
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 2:21 pm

i mentioned the "space" at the start... :P

but if gamebase is installed at c:\gamebase\ the new gemus.dll should now unpack and load games from all external drives at any path...
Anselm1
New Member
Posts: 12
Joined: Mon Jan 15, 2018 10:05 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 2:44 pm

.mad. wrote:
Sun Jun 30, 2019 2:21 pm
i mentioned the "space" at the start... :P
:D
.mad. wrote:
Sun Jun 30, 2019 2:21 pm
but if gamebase is installed at c:\gamebase\ the new gemus.dll should now unpack and load games from all external drives at any path...
I think AlphaUMi did not install it at c:\gamebase
but at F:\EMULATORS\COMMODORE 64\GameBase\
User avatar
.mad.
Honoured Member
Honoured Member
Location: Lancashire
Posts: 2256
Joined: Sun Jun 19, 2005 3:30 pm

Re: Gamebase 1.3: 7-zip failed to unpack archive!

Sun Jun 30, 2019 8:26 pm

@AlphaUMi
check download in your PM.

:idea:
i have coded the path for 7z to use it's own folder.
c:\7z\7z.exe
c:\7z\7z.dll

so it no longer uses your gamebase install path with spaces.
maybe it works?.

Return to “GB64 Help!”

Who is online

Users browsing this forum: No registered users and 8 guests