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!

Sun Dec 30, 2018 1:28 pm

just had an idea :idea:

could the problem be related to the system32/cmd.exe privileges.
with win 10 blocking gamebase from running it.
thinking it was a threat or something.

also i could recompile the gemus.dll with any command-line based file extractor with command-line switches of your choice.
http://infozip.sourceforge.net/

it won't work for all archive types like 7z., but might be a temporary fix for win10 and ZIP files.
the offer is there is you want it.

the current gemus example...

Code: Select all

    'Run 7z.exe.
    With sInfo
        .cbReserved2 = 0
        .lpReserved2 = vbNull
        .dwFlags = STARTF_USESHOWWINDOW
        .wShowWindow = SW_HIDE
        .cb = Len(sInfo)
    End With
    '  a    add to archive
    ' -r    recursive
    ' -y    answer yes on all queries
    ' (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 & " a """ & strDestArchivePathFile_in & """ * -r -y"
    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)

    strDefaultError = " [" & strDestArchivePathFile_in & "] " & _
                        GetINIMessage("Running Games", "SevenZipRepackCommandFrom", "7-Zip repack command from") & _
                        " [" & strRepackFolder & "]:" & vbCrLf & vbCrLf & strCommandLine

    'if the dest folder is there, it might have worked
    If Not m_xobjFunc.FileExists(strDestArchivePathFile_in, False, "GEMUS") Then
        strError_out = GetINIMessage("", "UnableToCreateArchive", "Unable to create archive") & strDefaultError
        Call PopLogFileTrace
        Exit Function
    End If

    'get a list file so the contents of the created archive can be compared to those that should have been added
    strError_out = SevenZipList(strDestArchivePathFile_in, strRepackFolderWBS & "__gemus_repack_check.txt", lngNumFiles, a_strFiles)
    If strError_out <> "" Then
        strError_out = GetINIMessage("Running Games", "UnableToGetListOfArchiveContents", "Unable to get list of contents for repacked archive") & strDefaultError & vbCrLf & vbCrLf & strError_out
        Call PopLogFileTrace
        Exit Function
    End If

    'make sure all added files are in the archive
    Call StoreRecursiveUnpackedFilesSnapshot(strRepackFolder)
    For lngRecursiveIdx = 0 To m_lngTotalRecursiveUnpackedFilesSnapshot - 1
        strItem = UCase$(ma_strRecursiveUnpackedFilesSnapshot(lngRecursiveIdx))
        blnFound = False
        For lngAddedIdx = 0 To lngNumFiles - 1
            If UCase$(a_strFiles(lngAddedIdx)) = strItem Then
                blnFound = True
                Exit For
            End If
        Next lngAddedIdx
        If Not blnFound Then
            strError_out = GetINIMessage("Running Games", "RepackAbortedMissingFiles", "Repack aborted. Did not find all required files in the destination archive") & " " & strDefaultError
            Call PopLogFileTrace
            Exit Function
        End If
    Next lngRecursiveIdx

    'successfully repacked
    SevenZipRepackFolder = True
    Call PopLogFileTrace

End Function

Public Sub StorePreUnpackedFilesSnapshot(strFolder_in As String)

    Dim lngIdx As Long
    Dim lngLen As Long

    ReDim ma_udtPreUnpackedFilesSnapshot(0)
    m_lngTotalPreUnpackedFilesSnapshot = 0

    If strFolder_in = "" Then Exit Sub

    Set m_xobjFuncPre = New GBFuncs.clsFunctions
    Call m_xobjFuncPre.FindFiles(strFolder_in, "*.*") 'calls callback function
    Set m_xobjFuncPre = Nothing

    lngLen = Len(strFolder_in)
    For lngIdx = 0 To m_lngTotalPreUnpackedFilesSnapshot - 1
        With ma_udtPreUnpackedFilesSnapshot(lngIdx)
            .strRelativePathFile = Right$(.strRelativePathFile, Len(.strRelativePathFile) - lngLen)
            .strUCaseRelativePathFile = UCase$(.strRelativePathFile)
        End With
    Next lngIdx

End Sub

Public Sub StorePostUnpackedFilesSnapshot(strFolder_in As String)

    Dim lngIdx As Long
    Dim lngLen As Long

    ReDim ma_udtPostUnpackedFilesSnapshot(0)
    m_lngTotalPostUnpackedFilesSnapshot = 0
    
    If strFolder_in = "" Then Exit Sub
    
    Set m_xobjFuncPost = New GBFuncs.clsFunctions
    Call m_xobjFuncPost.FindFiles(strFolder_in, "*.*") 'calls callback function
    Set m_xobjFuncPost = Nothing

    lngLen = Len(strFolder_in)
    For lngIdx = 0 To m_lngTotalPostUnpackedFilesSnapshot - 1
        With ma_udtPostUnpackedFilesSnapshot(lngIdx)
            .strRelativePathFile = Right$(.strRelativePathFile, Len(.strRelativePathFile) - lngLen)
            .strUCaseRelativePathFile = UCase$(.strRelativePathFile)
        End With
    Next lngIdx

End Sub
Public Sub StoreRecursiveUnpackedFilesSnapshot(strFolder_in As String)

    Dim lngIdx As Long
    Dim lngLen As Long
    Dim strPathFile As String

    ReDim ma_strRecursiveUnpackedFilesSnapshot(0)
    m_lngTotalRecursiveUnpackedFilesSnapshot = 0
    
    If strFolder_in = "" Then Exit Sub
    
    Set m_xobjFuncRecursive = New GBFuncs.clsFunctions
    Call m_xobjFuncRecursive.FindFiles(strFolder_in, "*.*") 'calls callback function
    Set m_xobjFuncRecursive = Nothing

    lngLen = Len(strFolder_in)
    For lngIdx = 0 To m_lngTotalRecursiveUnpackedFilesSnapshot - 1
        strPathFile = ma_strRecursiveUnpackedFilesSnapshot(lngIdx)
        ma_strRecursiveUnpackedFilesSnapshot(lngIdx) = Right$(strPathFile, Len(strPathFile) - lngLen)
    Next lngIdx

End Sub
Public Function IsFileASupportedArchiveFileType(strFile As String) As Boolean

    IsFileASupportedArchiveFileType = IsFileMatchingFileTypes(strFile, ma_strUnpackableFileTypes)

End Function
Public Function IsFileARepackableArchiveFileType(strFile As String) As Boolean

    IsFileARepackableArchiveFileType = IsFileMatchingFileTypes(strFile, ma_strRepackableFileTypes)

End Function


Public Function SevenZipUnpack(strExtractorPath_in As String, strPath_in As String, strFile_in As String, _
                                strDestPath_in As String) As Boolean

    Dim sNull As String
    Dim sInfo As STARTUPINFO
    Dim pInfo As PROCESS_INFORMATION
    Dim lngRetVal As Long
    Dim strCommandLine As String

    Call PushLogFileTrace("clsUnpack.SevenListUnpack")

    'change to drive/directory containing archive
    ChDrive strPath_in
    ChDir strPath_in
    
    Call LogStatus("Changed Directory to [" & strPath_in & "]")

    'Run 7z.exe.
    With sInfo
        .cbReserved2 = 0
        .lpReserved2 = vbNull
        .dwFlags = STARTF_USESHOWWINDOW
        .wShowWindow = SW_HIDE
        .cb = Len(sInfo)
    End With
    '  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)

    'if the dest folder is there, assume it worked
    SevenZipUnpack = m_xobjFunc.DirExists(strDestPath_in)
    
    Call PopLogFileTrace

End Function
User avatar
Anach
New Member
Posts: 10
Joined: Sat Dec 29, 2018 3:15 am

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

Mon Dec 31, 2018 5:28 am

It might be worth adding some more debug messages, to try to narrow down the actual problem, because as I said, it gives the same error if I delete the 7z.exe, so either the error log is too generic, or it's not finding 7z.exe. Possibly updating the 7z version in case there's an issue with the two-year-old version. The certificate issue was apparently fixed in 1603, but that doesn't mean it's compatible with the latest builds of Win10. It doesn't really worry me what archiver is used, as it's a portable version, so it doesn't make any changes to system. Unless you want to add a check for system path or program files installed versions of 7zip prior to using the included version. I wont' have a chance to do any more testing for a couple days, but when I get back I'll move it back to C:, so I know there's not compounded issues.
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!

Mon Dec 31, 2018 11:01 am

Just to be clear.
I did not program GameBase, that is the wonderful work of James (Jimbo) Burrows.
i have vb6 installed on my system so i can edit and recompile it.
If you can supply any bug fixed code. i will add it for you.
but i do not know how to write new code and fix what is working for me.

The original 7z version that came with the gamebase install was from 2009.
it used different /bad switches (without a space between each switch option).
with the new gemus.dll (2016) you can add the very latest version.

just copy the 7z.exe and 7z.dll from one of the first two EXE downloads, to the gamebase folder.
https://www.7-zip.org/download.html

to 100% make sure that 7z or unpacking is the root of the problem.
unpack a game zip file, and re-link the D64 or T64 as the 'selected' game file from gamebase.
if that fails it's probably an old vb6 dll being blocked or the cmd.exe not running as admin.
Attachments
link.PNG
link.PNG (30.54 KiB) Viewed 110817 times
User avatar
Anach
New Member
Posts: 10
Joined: Sat Dec 29, 2018 3:15 am

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

Mon Dec 31, 2018 11:12 am

No worries, I'll see how I go over the next couple days. I'll be busy with NY celebrations for the next 24 hours. If I'm not too hung-over, I'll play around with it after that, as I don't have time to reinstall it all right now. I did have a chance to test the extracted game file though, and it runs fine if I change it in Game Selector. However, I can't go back to the zip file after that, as it says "7-zip failed to unpack archive" in the runnable file window.
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!

Mon Dec 31, 2018 4:46 pm

i think i found the problem.

when testing with unzip.exe it fails to unpack to the coded rezip path "C:\GBGame\0\".
removing the final slash from the code "\" passes the unpacking from command-line.

just need someone to test this batch file using latest 7z.exe and 7z.dll on win10.
with and without the final slash.

Code: Select all

C:\Windows\system32\cmd.exe /c C:\GameBase\7z.exe x "c:\gamebase\gb64_v15\games\0\000WHITE_26153_01.zip" -y -r -o"C:\GBGame\0"

Code: Select all

C:\Windows\system32\cmd.exe /c C:\GameBase\7z.exe x "c:\gamebase\gb64_v15\games\0\000WHITE_26153_01.zip" -y -r -o"C:\GBGame\0\"
User avatar
Anach
New Member
Posts: 10
Joined: Sat Dec 29, 2018 3:15 am

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

Mon Dec 31, 2018 11:03 pm

Both work on Win10. In one of my above posts, I repeated it manually and it worked there too.

So here's the log from gemus. I noticed that in the second part it has the backslash and doesn't show the full path to the zip, where as the first and third part of the log have no backslash and show the full path.

Code: Select all

        -----------------clsUnpack.Unpack-----------------
        Repacking is possible
        7-Zip Path: [D:\GAMETO~1\GameBase\7z.exe]
        Unpacking [D:\Game Tools\GameBase\GBC_v15\Games\i\IMPMIS1_03731_04.zip] to folder [D:\Game Tools\GameBase\Temp\0]
            -----------------clsUnpack.SevenListUnpack-----------------
            Changed Directory to [D:\Game Tools\GameBase\GBC_v15\Games\i]
            Running 7-Zip [C:\WINDOWS\system32\cmd.exe /c D:\GAMETO~1\GameBase\7z.exe x "IMPMIS1_03731_04.zip" -y -r -o"D:\Game Tools\GameBase\Temp\0\"]
            -----------------------------------------------------------
        --------------------------------------------------
    Unpacker failed with error [7-Zip failed to unpack archive D:\Game Tools\GameBase\GBC_v15\Games\i\IMPMIS1_03731_04.zip to D:\Game Tools\GameBase\Temp\0]
Bye!
orsa99
New Member
Posts: 12
Joined: Sun Feb 12, 2012 12:14 am

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

Tue Jan 01, 2019 2:12 am

I have solved!

I noticed that neither cmd.exe go in windows...neither as administrator in the root windows/system32/cmd.exe the prompt msdos not run! I understood then that the two problems were related. I have unlocked cmd.exe with this solution:

Run regedit
Go to HKLM\Software\Microsoft\Command Processor\ or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\ or HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\
For some reason there was AUTORUN key with "EXIT" inside.
Remove the AutoRun key and everything should went back to normal.
CMD.exe should start to work again.

And now gamebase64 dezip without problems!!!!!

Happy New Year
User avatar
Anach
New Member
Posts: 10
Joined: Sat Dec 29, 2018 3:15 am

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

Tue Jan 01, 2019 3:53 am

orsa99 wrote:
Tue Jan 01, 2019 2:12 am
I have solved!

I noticed that neither cmd.exe go in windows...neither as administrator in the root windows/system32/cmd.exe the prompt msdos not run! I understood then that the two problems were related. I have unlocked cmd.exe with this solution:

Run regedit
Go to HKLM\Software\Microsoft\Command Processor\ or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\ or HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\
For some reason there was AUTORUN key with "EXIT" inside.
Remove the AutoRun key and everything should went back to normal.
CMD.exe should start to work again.

And now gamebase64 dezip without problems!!!!!

Happy New Year
Champion! That has fixed the issue, even in my non-default installation path.

Happy new year!
Seiya
Commended Member
Commended Member
Posts: 1126
Joined: Sat Aug 02, 2008 2:08 am

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

Sun Feb 10, 2019 11:11 am

me too i have the same problems and it is born when i reinstalled Windows after changing my computer with new one.
Every database is ok (it always worked before i reinstalled windows), but strangely now, 7zip is unable to decompress file in gbgame/0/.

And me too, i have cmd problem. now i follow your way. maybe it works also for me.

PS:
now it works.
the autorun key in command processor was the cause of this problem. But now i woud like to know how this problme is born. Why this autorun tab is generated?
I153_Chaika
New Member
Posts: 3
Joined: Sun Apr 21, 2019 1:33 pm

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

Tue Apr 23, 2019 6:04 pm

Thanks for that thread, I joined this forum because of this exact issue. It works on Windows 8.1 for me, if that can help anyone!
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!

Fri Apr 26, 2019 1:03 pm

Hello C64 fans!

I just joined this forum to say that I still get this 7zip error. I used GameBase64 for more that 10 years, flawlessly. GameBase was working great with Windows 10 since a couple of moths ago, everything was configured and worked correctly. Then, without touching anything, after one of the latest Windows 10 updates (v1809) I began to get this damn error (7z was unable to unpack...).

I've read the entire thread and already tried all the suggested solutions.

- 7z.exe can operate correctly from command line, even without administrator rights (both old and new version provided by .mad).
- I do NOT have any Autorun key in registry in every suggested location. Command prompt can be opened and operate correctly.

I don't know what to do now. Any suggestion please?
Thank you in advance.
Agent 4125
New Member
Posts: 1
Joined: Wed May 01, 2019 10:35 am

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

Wed May 01, 2019 10:47 am

I've encountered the same thing. Here are the tests that I have done (that don't work):

Copied installation from a working machine
Install 7Zip and copy files over
Reinstall GameBase
Take ownership of folder and add Everyone: Full control
Run from a remote desktop session as a different user
Change temp file location
Run as Administrator
Add to AV exclusions
Delete GameBase folder and copy across from working machine
Export GB64.reg from working machines and import
Run from the command line:
"D:\Emulation\Front Ends\GameBase\GBLauncher.exe" db="GBC_v15" fn="1942!_00015_03"
Same as above “As admin”
Set 7zip compatibility to Windows XP/7
Set Gamebase compatibility to Windows XP/7
Replace gemus.dll and 7zip with a new versions
Clean Reinstall of GameBase and GB64 database

It's odd that I have three machines that I can test it on, two of which work (running Windows 10 v1809) and one that it doesn't work on (running v1803). I find it interesting that GameBase Amiga on the same machine has no problems with 7zip.
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!

Thu May 09, 2019 3:56 pm

Agent 4125 wrote:
Wed May 01, 2019 10:47 am
It's odd that I have three machines that I can test it on, two of which work (running Windows 10 v1809) and one that it doesn't work on (running v1803). I find it interesting that GameBase Amiga on the same machine has no problems with 7zip.

I't even odder that the working machines for you are running 1809, while the one with 1803 does not. In my case instead, I have 1809 and it does not work (although it worked sine a couple of months ago, I'm sure)....
Last edited by AlphaUMi on Tue Jun 11, 2019 6:23 pm, edited 1 time in total.
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 11, 2019 6:22 pm

For those who are still having this problem (like me), despite having tried and checked all the suggestions posted in this thread, I would like to add that there is a workaround... well, a sort of.

Now I just use jGameBase (https://jgamebase.sourceforge.io/), which is a java port of GameBase. Obviously it requires Java installed on the system, but apart of this, it's the same as GameBase, only written in java. With jBameBase I have no issues at all.

Cheers,
Alpha.
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!

Sat Jun 22, 2019 9:18 pm

i am tinkering with the GB code at the moment.
i do not have win10 or any desire to update to it.

But if someone want's to tell me the working command line and path (in win10) to run 7z from the cmd shell?.
i will add it.

i found this info, maybe it helps with gamebase??? - [scroll down page].
https://www.easeus.com/partition-master ... ws-10.html

as gamebase currently calls this path to run it.
C:\WINDOWS\system32\cmd.exe
maybe it could be forced to open from the gamebase directory with a shortcut or batch file as a win10 work-a-round. :idea:

as for the autorun reg edit solution posted above.
if that works everytime it stops working (after win10 update)?
That switch can hardcoded into the gamebase command to disable it.

cmd.exe /D - Ignore registry AutoRun commands
HKLM | HKCU \Software\Microsoft\Command Processor\AutoRun

beta tester required!!! :wink:

Return to “GB64 Help!”

Who is online

Users browsing this forum: No registered users and 11 guests