EMULAB Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The new forum is online, hope you enjoy it!

Pages: [1]   Go Down

Author Topic: clrmamepro on Linux with WINE 7zip not removing file contents  (Read 10334 times)

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 144.0 Firefox 144.0
    • View Profile

I've been running clrmamepro on Linux with WINE for around a year or so now.  Everything works well (slowly, but well) except for removing the contents of a 7zip archive.  Adding files to a 7zip archive works just fine, but if clrmamepro attemps to remove a file from within a 7zip archive it fails with the "not fixed" error in the scan log.  Has anyone been able to get this working, or is it a known limitation of some sort?  It definitely worked when I was using clrmamepro on Windows 10.
Logged


Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 121
  • Offline Offline
  • Posts: 3640
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 142.0.0.0 Chrome 142.0.0.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #1 on: 05 November 2025, 07:32 »

Actually I wonder that 7z compression does work. In old clrmamepro, an external 7z executable is required for doing write operations on 7z files, i.e. adding or removing files. Since you're in a mixed Linux/WINE world, I thought that calling the (Linux) 7z already fails when compressing files. Since this is working, you may want to double check if the remove operation is correct. Settings->Compressor->7z shows how the 7z executable is called for adding and for removing files. Surely there also might be accessrights involved on your system....

You better switch to the new clrmame which does not require an external 7z binary.
Logged

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 144.0 Firefox 144.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #2 on: 05 November 2025, 17:42 »

In all instances clrmamepro actually calls the "Windows" version of 7zip and not the Linux version.  I used winetricks to install the Windows variant of 7zip, but you can also just run the 7zip installer using wine.  As long as the wineprefix for either option is set to the same wineprefix that clrmamepro is in (and 7z.exe is in the PATH) it'll just work.  Anyway, I ran a few tests:

1. I added a dummy JPEG to a 7zip archive and ran a scan and clrmamepro correctly identified the misplaced JPEG (note that it wouldn't even be able to do this if 7z.exe weren't functioning properly).  However, the misplaced file was not removed from the archive when requested and as expected.
2. I then extracted the rom file from another 7zip archive and added the former to the rebuilder folder I have setup for that romset.  I also deleted the original 7zip archive.  When I ran the rebuilder, it successfully compressed the rom file into a 7zip archive using 7z.exe.
3. I added the same dummy JPEG to the romset's folder with the other 7zip archives and ran a scan and clrmamepro successfully identified and removed the dummy JPEG file.  This indicates that ACLs/permissions are not a problem, but it could be a 7zip specific thing I'm not sure.

Maybe there are some debug settings I can enable to see what clrmamepro is doing and maybe it's interacting with the 7z_64.dll file in its folder in unexpected ways (I'm not sure why that's present if it's just calling the 7z.exe file)?  I don't think I've changed the defaults, but here are my 7z settings in clrmamepro:
```
Executable: 7z.exe
Compress: a -y -r -ms=off -mx9 %1 %2
Delete: d -y -ms=off -mx9 %1 %2
```
« Last Edit: 05 November 2025, 17:44 by funkmata »
Logged

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 144.0 Firefox 144.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #3 on: 05 November 2025, 17:56 »

Yeah, there's gotta be some weird thing that clrmamepro is doing when it runs the 7z remove command.  I ran another test and added my dummy JPEG to a 7zip archive in the same romset directory and ran the following command from wineconsole (which is essentially cmd.exe):

Z:\home\username> "C:\Program Files\7-Zip\7z.exe" d -ms=off -mx9 "Z:\mnt\fileserver\username\archive name.7z" "single_player.jpg"

This successfully removed the dummy JPEG "single_player.jpg" from the "archive name.7z", so 7zip is working fine and it's definitely not a permissions issue.  Or maybe the setting to allow clrmamepro to remove files from archives is not "sticking" hence the "not fixed" error?
« Last Edit: 05 November 2025, 18:00 by funkmata »
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 121
  • Offline Offline
  • Posts: 3640
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 142.0.0.0 Chrome 142.0.0.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #4 on: 05 November 2025, 18:31 »

if more than one file within a 7z file needs to be removed, clrmamepro builds a temporary file in its temp folder called "_filelist.txt" which is a textfile holding the single file names.
It then calls 7z with "d -y -ms=off -mx9 E:\Temp\roms6\roadblst2.7z @E:\ClrMamePro\temp\_filelist.txt"

If it's just 1 file it calls 7z with
"d -y -ms=off -mx9 E:\Temp\archive.7z filexy.bin"  (where archive.7z is your 7z archive and filexy.bin is the file which needs to get removed

maybe Linux/Wine doesn't like the filelist usage....

...use the new clrmame it does not need an external 7z binary...
Logged

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 144.0 Firefox 144.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #5 on: 11 November 2025, 18:18 »

Good catch.  I somehow missed that clrmamepro is able to remove a single file from an archive just fine.  However, if there are multiple files to be removed then it fails; so that's my problem.  I ran the command manually to remove multiple files and it worked just fine, so something is messed up when clrmamepro (via wine) tries to do it: "C:\Program Files\7-Zip\7z.exe" d -y -ms=off -mx9 "Z:\mnt\archive.7z" @"C:\Program Files\clrmamepro\temp\_filelist.txt"

Unfortunately, I haven't cottoned on to what the contents of _filelist.txt (which appears to be created according to debug statements) are nor the exact command clrmamepro is running under wine when it fails, so I'll have to dig into the debug statements a little deeper.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 121
  • Offline Offline
  • Posts: 3640
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 142.0.0.0 Chrome 142.0.0.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #6 on: 11 November 2025, 18:30 »

...or you simply switch to use the new clrmame ;-)
Logged

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 144.0 Firefox 144.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #7 on: 11 November 2025, 18:52 »

Sorry.  Until there's profiler support in the new clrmame I'm not interested in switching to it.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 121
  • Offline Offline
  • Posts: 3640
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 142.0.0.0 Chrome 142.0.0.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #8 on: 11 November 2025, 18:56 »

if you only use MAME and all MAME software lists (>700) and a handful other dats, you can use it :)
If you need more profiles...well...then you may need to wait (or use the commandline version via scripts)
Logged

funkmata

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 145.0 Firefox 145.0
    • View Profile
Re: clrmamepro on Linux with WINE 7zip not removing file contents
« Reply #9 on: 19 November 2025, 19:43 »

OK, I spent some time today and figured it out.  When clrmamepro is executing the call to 7-zip in order to remove multiple files using _filelist.txt, it's not surrounding the full path to _filelist.txt in quotes.  From WINE debug:

Code: [Select]
"C:\\Program Files\\7-Zip\\7z.exe d -y -ms=off -mx9 \"Z:\\mnt\\some archive.7z\" @C:\\Program Files\\clrmamepro\\temp\\_filelist.txt"
Because Program Files has a space in it, 7z.exe bombs out.  What I would expect to see is escaped quotes after the @ symbol:

Code: [Select]
"C:\\Program Files\\7-Zip\\7z.exe d -y -ms=off -mx9 \"Z:\\mnt\\some archive.7z\" @\"C:\\Program Files\\clrmamepro\\temp\\_filelist.txt\""
As a workaround I changed the temp directory in cmpro.ini to C:\temp and removing multiple files now works.  Up to you, Roman, if you think this warrants a fix.  If not, no biggie.  Hopefully others using wine that run into this issue find this thread.  I think the "official" clrmamepro install using Lutris throws clrmamepro into C:\clrmamepro which makes this all a moot point   ;D

edit: For the record this worked fine in Windows with clrmamepro installed in "C:\Program Files", so it may be a WINE problem and not a clrmamepro problem.
« Last Edit: 19 November 2025, 19:51 by funkmata »
Logged
Pages: [1]   Go Up
 

Page created in 0.132 seconds with 21 queries.