Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Updating CHD with chdman  (Read 9272 times)

0 Members and 1 Guest are viewing this topic.

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Updating CHD with chdman
« on: September 17, 2009, 04:55:11 pm »
I know how to use this program, and it works great, but I have just acquired every .chd known in existence.  I used chdman to update my older kinst.chd and kinst2.chd and now they work with mame 0.134, but I have 318 files in 303 folders that I'll need to make the transition to 0.134. I've tried using clrmamepro to do this and I don't think it worked for those 2 files, so I doubt it'd work with all the others. How can I update all of them in one swoop, rather than adding the chdman.exe to each .chd directory, updating, erasing the old .chd and renaming the new back to its correct name? doing this over 300 times would be ridiculous manually.

mr_doles

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:November 13, 2014, 06:53:45 pm
  • nuff said
Re: Updating CHD with chdman
« Reply #1 on: September 17, 2009, 05:23:44 pm »
I think this post may help you out.

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Re: Updating CHD with chdman
« Reply #2 on: September 17, 2009, 05:36:38 pm »
You may have won, I'll try and see what happens when they're all transferred to my mame pc.

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Re: Updating CHD with chdman
« Reply #3 on: September 17, 2009, 08:29:24 pm »
Well, its trying but it can't find the sources. I have edited it to fit what is on my system. My roms are in C:\mamesrc\roms , my .chd's in their filename/folders that need to be updated are in C:\mamesrc\roms , and chdman is in the main folder of C:\mamesrc . I don't have a list.txt, I guess that could be fouling things up, I don't know how to make it or where to get it.

mr_doles

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:November 13, 2014, 06:53:45 pm
  • nuff said
Re: Updating CHD with chdman
« Reply #4 on: September 17, 2009, 11:09:08 pm »
First off I did not write this so I am working backwards on this.  I see 2 problems here.
Do you have spaces in your chd folder names?  Look at your list.txt if the folders that contains the chd has any spaces in it that will cause the problem.

EX.  c:\mamesrc\rom\Killer Instinct
  dir /s /b %%A\*.chd >filelist.txt
would translate to
  dir /s /b c:\mamesrc\rom\Killer\*.chd >filelist.txt
NOT
   dir /s /b c:\mamesrc\rom\Killer Instinct\*.chd >filelist.txt
To fix this you need to change "tokens=1" to "delims='' tokens=1" (Note that is 2 single quotes with no spacing after delims= and not a double quote)
The second issue is after it writes to filelist.txt on the first loop it can not write to it again for all the rest of the loops.  I just get file not found each time.  Not sure how to fix that one.  May require some research but not tonight.  You could PM MKChamp and as him to read this and put in his 2 cents.

mr_doles

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:November 13, 2014, 06:53:45 pm
  • nuff said
Re: Updating CHD with chdman
« Reply #5 on: September 17, 2009, 11:56:42 pm »
OK disregard the 2nd problem because it was not a problem just messed up my testing environment.  ::)
Try this (note the delims='' (2 single quotes) is added in case you do have spaces. 
The paths should match your environment from what you said you have.  Your paths should be in bold.

dir /b /s /A:D C:\mamesrc\roms >list.txt
FOR /F "delims='' tokens=1" %%A IN (list.txt) do (
   dir /s /b "%%A\*.chd" >filelist.txt
   FOR /F "delims='' tokens=1" %%f IN (filelist.txt)   do (
      C:\mamesrc\chdman -update %%f %%f_n
      del %%f
      move %%f_n %%f
   )
)

This assumes your folder structure to be like:
C:\mamesrc
     chdman.exe
     roms\
        kinst\kinst.chd
        kinst2\kinst2.chd
        sfii\sf3000.chd
        .
        .

FYI – I DID THIS IN A TEST ENVIROnMENT.  I RECREAED YOUR STRUCTURE AND RAN THIS AND IT WORKED.  I ADVISE YOU TEST THIS BEFORE RUNNING ON YOUR REAL FOLDERS.   

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Re: Updating CHD with chdman
« Reply #6 on: September 18, 2009, 12:56:51 am »
Well I appreciate it. I'll try it when I'm home and report back. I'll run it full blast and if it fouls up I'll jiust retransfer the .chd collection back over from the other pc. Thanks!

Finchbyrd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:November 08, 2009, 06:03:22 pm
Re: Updating CHD with chdman
« Reply #7 on: September 18, 2009, 08:32:09 pm »
Your last post did the trick. I found two scripts, the first I ran did nothing but move the ones I need to update to a backup folder, then tried to update nothing. It was much more work than its worth trying to move each individual .chd to their respective folders, then take off the .old after .chd, so I just deleted them all and copied them back to the pc again. After a few hours of transfering, I ran your second posted script, and its currently doing it right now. I can't thank you enough.

mr_doles

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:November 13, 2014, 06:53:45 pm
  • nuff said
Re: Updating CHD with chdman
« Reply #8 on: September 19, 2009, 07:25:05 am »
Can't take the credit since I did not write the batch file but I am glad I was able to get it working for you.