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.
Highly Commended Member
Highly Commended Member
Location: Lancashire
Posts: 1797
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.
Highly Commended Member
Highly Commended Member
Location: Lancashire
Posts: 1797
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.61 KiB) Viewed 4942 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.
Highly Commended Member
Highly Commended Member
Location: Lancashire
Posts: 1797
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: 7
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
Ice Cool Member
Ice Cool Member
Posts: 765
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?
Demobase DOS
Zinc
MS-DOS Goldies
CD32-CDTV Goldies
Macintosh 68k
GB Trilogy
Infocom Collection

---------------
Retro Trailer
http://www.amigapage.it/index.php?pl=intro&modo_intro=1

Return to “GB64 Help!”

Who is online

Users browsing this forum: No registered users and 3 guests