TechnicSolder icon indicating copy to clipboard operation
TechnicSolder copied to clipboard

Bulk import option

Open SethAten opened this issue 10 years ago • 18 comments

So I spent last night making a new pack. That's long hours of putting each mod in it's own properly formatted zip file with perfect naming convention and versioning...Now, I'm not afraid of script, so I get 90% of that done via batch file. What I was then left doing by hand was adding each mod, typing out the name, then more clicks to add a version, find out what that was and type it in.

I request a bulk import option on adding mods, and since mods require an exact modslug and version naming convention I think this could actually be easy. I could just amend my assembly script to create a text file of every mod I package, like so:

ModName-2.1.1 otherMod-0.2.2a

I would then push my mods to my repo, go to Solder and feed it this text file, where for each line it would check if ModName exists, if not create it with generic info e.g ModName, slug modname If modname exists, but version 2.1.1 does not, add version 2.1.1 and gen MD5. And so forth

For large imports, you could create a load manager database and check a couple per page load until done..of course with a big red Still Generating bar on the page.

SethAten avatar Jan 25 '15 20:01 SethAten

Cool idea. At a certain point, solder will have to change its mod uploading system.

fcpwiz avatar Jan 25 '15 21:01 fcpwiz

It should rather first implement some kind of mod uploading system, from the web interface.

ghost avatar Jan 25 '15 22:01 ghost

+SethAten would you be willing to share the batch file you use to pack each mod into a solder frieldly zip? i have a pack with 200+ mods that i want to move to solder and i dont really want to have to work my way through all 200 creating zips manually...

JamiePhonic avatar Feb 01 '15 18:02 JamiePhonic

+JamiePhonic Not sure my batch can help you with 200+ mods...I test my packs one mod at a time, therefore just step this right into that workflow, one at a time. But I will share it, maybe you can use it for a later pack or maybe it will help someone else.

https://gist.github.com/SethAten/2b5db5ff17632d90179e Note that this will require an installation of 7-zip archiver( http://7-zip.org ) and to use it, you put all jar files required for a mod into the folder next to it, run it, give name and version when asked. Though this does require manual intervention, putting each mod next to it, typing out names and versions, I find it to save me tons of time making and formatting folders, creating zip files, putting those in proper folders etc, etc. Then just upload the contents of the "deploy" folder to your repo, and begin the tedious process in Solder I'm trying to solve with the above request.

Though for your pack specifically, I recommend looking into something called TechnicSolderHelper. I heard about it yesterday on IRC, looks like it may be of help to you, but I have not tried it yet...the webrun stuff isn't working out for me and they offer no local binaries. https://github.com/zlepper/TechnicSolderHelper

SethAten avatar Feb 02 '15 05:02 SethAten

+SethAten there is a compiled version. its right there on the page: "A compiled version of this can be found at: http://zlepper.dk/solderhelper/publish.htm"

JamiePhonic avatar Feb 02 '15 15:02 JamiePhonic

+JamiePhonic Yeah, that got me too. It's a ClickOnce web program, not an EXE that I can put where I like.

SethAten avatar Feb 02 '15 19:02 SethAten

True, but you can put the clickonce thing anywhere, even though it might have been nice to have a flash drive mode

Arzte avatar Feb 03 '15 15:02 Arzte

@JamiePhonic I took @SethAten script and expanded it to cover an entire directory. I've attempted to cover all possible naming collisions but you will need to verify that it matches up with what you get in your Solder Panel. Hope it helps. https://gist.github.com/Drethic/5ac899e7c45545067832

Usage is simply copying the bat file into the directory with your mods and running it. It will create a new directory called modpack in the parent folder. e.g. if I run the script in .minecraft/mods it will create .minecraft/modpack which will contain all the zips I need.

Drethic avatar Apr 27 '15 02:04 Drethic

That works awesome! The script doesn't support normal 64bit 7 zip locations I figured it out though, so no matter.

Razorskills avatar Apr 27 '15 05:04 Razorskills

@Razorskills Let me know what needed to be modified so I can update my local and the gist.

Drethic avatar Apr 27 '15 07:04 Drethic

All I did was changed the locations of 7 zip in your batch file from: "C:\Program Files\7-Zip\7z.exe" to: "C:\Program Files (x86)\7-Zip\7z.exe"

Maybe if it doesn't find the first one, it could then search for the other, then say 7 Zip not found.

I also noticed, sometimes after the script finishes it doesn't delete the modpacktmp folder. weird.. I will have to play around with it.

It would also be nice if it could also place the zip files in their own named folder. But I can do it manually for now. It would be a nice thing to be able to comment in and out from the script if you are not wanting to use it.

I also added: set file=!file:-mc1.7=! for the Better foliage mod

Razorskills avatar Apr 28 '15 04:04 Razorskills

I can update it for the x86 location if the first isn't found then have it fail out.

I'll test within the x86 to see if I can find why the tmp directory isn't nuking.

For their own named folder you want a structure like this?

modpack
-moda
--moda.zip
---mods
----moda.jar
-modb
--modb.zip
---mods
----modb.jar

If so that shouldn't be hard to do. Once I hear back about the structure changes I'll take updating for all 3 issues.

Drethic avatar Apr 28 '15 04:04 Drethic

Yup. That is what I am manually doing right now lol, gonna be here for a while haha (The ability to put them in the folders would make uploading to solder via sftp almost a double click, then drag and drop. Might have a couple needing to be adjusted)

also, not sure if this helps, but maybe this is why its not clearing the temp folder: ..\modpacktmp\BIBLIO~1.3\mods - The directory is not empty. (although after its all done its empty. maybe it tried deleting it while it was moving it, or just needs a delete recursive or something)

Razorskills avatar Apr 28 '15 05:04 Razorskills

I've updated the gist to check for 7-Zip in C:\Program Files\7-Zip or C:\Program Files (x86)\7-Zip. If it can't find it in either one it will crash out.

I swapped out how I was removing the folders to a command that will kill read-only files as well. However, one possible explanation I found about it not deleting a folder was because it was open when it tried to delete it.

As for the change to directory structure you'll just need to un-comment line 78 by removing the leading :: Then putting the :: in front of the next line so it goes from

::"%7z%" a -tzip "%pack%\!file!\!file!.zip" "%packtmp%\!file!\*" -mx0>nul:
"%7z%" a -tzip "%pack%\!file!.zip" "%packtmp%\!file!\*" -mx0>nul:

to this

"%7z%" a -tzip "%pack%\!file!\!file!.zip" "%packtmp%\!file!\*" -mx0>nul:
::"%7z%" a -tzip "%pack%\!file!.zip" "%packtmp%\!file!\*" -mx0>nul:

Drethic avatar Apr 28 '15 05:04 Drethic

Ok Revision 5 seems to work fine now. I will test it completely.

Also this should conversation should probably be moved out of the TechnicSolder Issues..

Razorskills avatar Apr 28 '15 05:04 Razorskills

Probably should have tested it a bit better :)

It now goes through either path as expected. I changed from using the :: to rem in front of the 7-zip lines.

Drethic avatar Apr 28 '15 05:04 Drethic

Awesome, it works great! Thank you! This has already beaten me from making all the folders and putting the zips inside them. This can save you hours of just zipping and moving files.

Razorskills avatar Apr 28 '15 05:04 Razorskills

You may noticed a modpack.csv file in the modpack directory. This is being generated, mostly for me, because of the pull request I put in related to this issue: https://github.com/TechnicPack/TechnicSolder/pull/386

It provides a base for importing what is zipped up into the Mod List. It's not a perfect slug so needs to be reviewed but it does save a lot of typing.

Drethic avatar Apr 28 '15 05:04 Drethic