Batch File ExtractingMoving

Post » Mon May 07, 2012 5:29 am

Hello guys!

I'm currently writing a compilation that instead of packaging all mods together at distribution, simply packages metadata and installation data. The end-user is still required to download the mods from their sites. The benefit of this is that I don't have to ask for distribution permissions from the author. I'm using a program called http://www.fallout3nexus.com/downloads/file.php?id=640 to determine whether or not a user has the correct archives. If the user does not have the correct archive, then a download link will be displayed. If the user does have the correct archive, than the archive will be extracted and portions of its contents will go into one folder, and the other portions elsewhere.

I have to insert a fake exe in the oblivion directory to make sure FOMM recognizes Oblivion. but even then I find it silly I'm forcing players to download a mod manager when all it did was extract/mod files... I hope to use the BAIN wizard script installation sinces the scripting languages in FOMM is too complex for me.

I've been told that I can accomplish the same thing with batch files through a (apparently) simple process.

Here is a sample .xml snippet to show you what FOMM does. This snippet only moves around the patches of the compilation.

Spoiler
																  	  																																																																																																																																						

It allows me to extract the stuff I want from an archive and move it around as I wish. But again, I'm forcing users to download a mod manager for another game to simply do this for them... so it's a bit clunky and unprofessional. I would like to declare 4 things
a) what directory the source archives can be found
B) if a archive cannot be found, then where to find it
c) Where contents are extracted too
d) Extraction installations. i don't want to move all the contents in an archive to the same folder. Sometimes there is junk. For example,

                        

I could have just written

      

But there were a few junk files in the data directory of that archive.

Basically, I would like to do something like this.

If Archive Exists __________ then Installation Instructions and move to _______. Else, link to missing archive __________.

Is it possible to do this via batch file? And if so, could someone write a small template and/or direct me to a series of links and tutorials? I have very little batch experience... but I'm willing to learn. If there is another somewhat standalone method of doing this, please tell me.

Thank you very much for the help. :)

As for the project, Oblivion Community Metadata (OCM) I could go the following ways...

  • Full FOMM use (but requires me to learn FOMM xml @_@)
  • Hybrid FOMM and Wyre Bash (Kind of svcks that I have to do this, but this us currently what I do).
  • Batch File (or something else) and Wyre Bash (preferred)

OCM is sort of a giant compilation... that does not distribute the mods itself, you still download them through a link list. The benefit of this is that
  • I don't have to handle distribution issues with the author. This is the hardest part! And clearly, the BEST perk.
  • When a user downloads OCM and installs it he also gets the "latest version" of other mods. In other compilations, when a individual mod updates (and you don't know about it), you would have to wait for the compilation to update. This is not true with OCM, as long as the OCM creator keeps up with meta data, which isn't too hard... the end-user gets updates fairly frequently.
  • Very modular thanks to BAIN wizard scripting.

Bad:
  • You still have to download the mods (but I provide a link list, and FOMM tells you if you are missing something).
  • Current setup (hybrid) forces a user to move around files a bit @_@
  • If the file author changes archive name or archive directory structure... metadata has to account for that. The latter does not happen often, but some authors put a version number on their archive... that changes with each upload -.- It would be nice if modders just use the version number via tesnexus rather than the version number in the archive. This is the hardest to overcome.
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Mon May 07, 2012 10:17 am

I would say you could do this with things like:
- Use an commandline download tool. I've seen this before, but can't seem to find a link to it, usually it's called 'download.exe'. Watch out for malware of course
- Use the 7z commandline to extract the needed files.

You could do all the parsing, etc with a batch file, it'd be pretty messy though, and would probably be a very long batch file with lots of GOTO's and such. It might be easier to whip up a small program in your favorite scripting language (python, vbasic, etc) then make an exe out of it.
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am

Post » Sun May 06, 2012 11:37 pm

I don't know for sure that there's a Windows port, but the standard Unix tool for command line downloads is called wget. If there's a Windows port it should be rock solid and safe.
User avatar
BRAD MONTGOMERY
 
Posts: 3354
Joined: Mon Nov 19, 2007 10:43 pm

Post » Mon May 07, 2012 3:26 am

Hi there, this looks like a nice concept, but I see a problem on my side. Maybe its just me but I usually don’t like the names modders give to there .esp / .esm files. They usually are incorrect or missing file number information. I always change there file names so I can monitor all the mod much better. That way I can check with one blink of my eye which mod it is and what version is running.
User avatar
Joe Alvarado
 
Posts: 3467
Joined: Sat Nov 24, 2007 11:13 pm

Post » Mon May 07, 2012 9:40 am

I don't touch .esp names, I just change directories into a BAIN archive and offer a wizard script. Most modders don't change their .esp name at updates due to BOSS sorting. In the OP, i was refering to the name of the archive itself... which really makes my job a little bit harder but meh. If anything, you should have a readme with the version number as a name (rename it!).

Also, FOMM has a feature that allows you to see if a mod you are using has been updated... I'm not sure how it works though @_@
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Sun May 06, 2012 11:56 pm

I am fairly certain it reads the spot under the nexus site that says version. That is how OBMM Extended does it. It is simply a detect of text in HTML.
User avatar
ijohnnny
 
Posts: 3412
Joined: Sun Oct 22, 2006 12:15 am

Post » Mon May 07, 2012 11:12 am

Renaming ESPs/ESMs is something that would be nice to be able to do, but causes all kinds of problems. Breaking BOSS is the most obvious, but if you really wanted to you could maintain a complex userlist to sort all your new filenames right next to the original filenames. Fixing all the broken masters would be more of a pain - you'd have to go in and fix broken masters on tons of files to begin with, and more every time you update things.

All things considered, it's not worth the bother. I instead rename my BAIN archives to include version numbers and keep track from there. It's the more sensible place too since BAIN can quickly open the original download page on TESNexus for you if you make sure to keep the ID number in a certain format at the end of the name.
User avatar
JD bernal
 
Posts: 3450
Joined: Sun Sep 02, 2007 8:10 am

Post » Mon May 07, 2012 1:44 am

I don't know for sure that there's a Windows port, but the standard Unix tool for command line downloads is called wget. If there's a Windows port it should be rock solid and safe.

There is, and I've been using it since always. http://gnuwin32.sourceforge.net/packages/wget.htm

Don't know how it handles the Nexus downloading scheme, though. Its popup might be a hard obstacle to overcome.
User avatar
Latisha Fry
 
Posts: 3399
Joined: Sat Jun 24, 2006 6:42 am

Post » Mon May 07, 2012 1:56 am

Bearing in mind the nexus download system is being "overhauled" according to DarkOne for the new nexus design. So I'd wait for that incase there are significant changes.
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Mon May 07, 2012 1:54 am

I *hope* that the nexus doesn't change the file naming system... that is the only thing that would break this project... along with every Fallout PFP (sort of like premade omod conversion data),

Currently, the file naming system is already kind of blah.

Oblivion_-_PyFFI_Optimization_Kit_v2-37463.7z

Under-slashes when there are spaces and insertion of downloadID (different from fileID) at the end. Also, newer files have extra numbers inserted at the end,

Oblivion_-_PyFFI_Optimization_Kit_v7-37463-7.7z
DLL_v332-37904-3-3-2.zip

If a user used nexus's version number system, they get the version number inserted. Not all files with version numbers do however... so I'm guessing it's up to a certain date... also makes OCM harder @_@ So scratch my earlier comment about how modders should just use the version number for texnexus :P

The new site design however, will probably break the version number tracker on FOMM and OBMMEx (thank you for the mention!)
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Mon May 07, 2012 6:22 am

Just to hammer another nail into the renaming plugins column, I recall reading that savegame data relating to mods is in some way dependent on the plugin filenames, so if you change the name then you effectively invalidate all saved data for that mod. That makes sense to me, since going by plugin name explains how load order can change OK most of the time, but I could be wrong.
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am

Post » Mon May 07, 2012 3:38 am

Just to hammer another nail into the renaming plugins column, I recall reading that savegame data relating to mods is in some way dependent on the plugin filenames, so if you change the name then you effectively invalidate all saved data for that mod. That makes sense to me, since going by plugin name explains how load order can change OK most of the time, but I could be wrong.
That's correct. Renaming the files and the game treats it like a new mod, breaking existing save content that relies on said mod.
User avatar
Nikki Hype
 
Posts: 3429
Joined: Mon Jan 01, 2007 12:38 pm


Return to IV - Oblivion