xJayr's Mod installer for mac
#1
Posted 14 November 2010 - 08:13 PM
nwTjSY9urzM
How To Use:
-Place mods in mods folder (class files)
-Run the Script
Keep In Mind:
-After you run the Script it will automatically close
-for MAC ONLY
-The Installer doen't really install the mods, The installer places the class files in the minecraft.jar
-Doesn't work with 1.5 I think...
DOWNLOAD
MCInstall : Terminal based
Download
works same way as Modinstaller does it just opens terminal then installs
use this if Modinstaller doesn't work for you.(I have no idea why it wouldn't work)
PLEASE NOTE: I'm a beginner at coding
#2
Posted 14 November 2010 - 08:23 PM
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#3
Posted 14 November 2010 - 08:27 PM
tali said:
Then I took a look at Zan's minimap installer.
My original commands before looking at Zan's Installer made it so you needed to place the mods into a Jar which wasnt that easy IMO.
#4
Posted 14 November 2010 - 08:30 PM
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#5
Posted 14 November 2010 - 08:32 PM
tali said:
before I made the command I tried using the applescript editor to do terminal commands O_o
#6
Posted 14 November 2010 - 08:47 PM
I use other tricks when I want to talk about something being in a relative location to where the script lives, but let's wait on that until after you see how to make a basic shell command into an applescript call.
This is a wrapper I used to use to maintain my texture pack and to unlink and relink worlds. It is retired, and this is an old version, but it may give some insight into how to write a rather complex hybrid script.
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#7
Posted 14 November 2010 - 08:57 PM
opens the bin folder
does some kind of backup
deletes the meta inf
my question: how does it open the jar?
#8
Posted 14 November 2010 - 09:00 PM
creates the temporary folder named minecraft (and if successful) goes there (and if successful) uses jar to extract.
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#9
Posted 14 November 2010 - 09:04 PM
tali said:
creates the temporary folder named minecraft (and if successful) goes there (and if successful) uses jar to extract.
cp ~/Documents/MCPatches/* . ; does this open up the folder we needed to place the mods in?
Im pretty sure it does. now how does it take all the stuff in mcpatches and puts it in the new folder it made
#10
Posted 14 November 2010 - 09:07 PM
xjayr said:
tali said:
creates the temporary folder named minecraft (and if successful) goes there (and if successful) uses jar to extract.
cp ~/Documents/MCPatches/* . ; does this open up the folder we needed to place the mods in?
Im pretty sure it does. now how does it take all the stuff in mcpatches and puts it in the new folder it made
hmm that was stupid. im guessing cp means to extract everything in that location to the current one
#11
Posted 14 November 2010 - 09:09 PM
xjayr said:
tali said:
creates the temporary folder named minecraft (and if successful) goes there (and if successful) uses jar to extract.
cp ~/Documents/MCPatches/* . ; does this open up the folder we needed to place the mods in?
Im pretty sure it does. now how does it take all the stuff in mcpatches and puts it in the new folder it made
Actually, not quite, cp is short for copy and it copies from "~/Documents/MCPatches/*" to ".", in Unix parlance "." is the name of the current working directory. Which was set in the line quoted above. "cd" stands for "change directory".
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#12
Posted 14 November 2010 - 09:21 PM
#13
Posted 14 November 2010 - 09:28 PM
do shell script ¬ "cd ~/Library/Application\\ Support/minecraft/bin ; mkdir Temporary && cd Temporary && jar xf ../minecraft.jar ; rm -r meta-inf || rm -r META-INF; cp ~/Desktop/Mods/* .; jar cMf ../minecraft.jar ./ && cd .. ; rm -rf Temporary"
Thats what im using for the code.
if possible how would i make it so that the mods folder has to be in the same directory as the script app?
#14
Posted 14 November 2010 - 09:37 PM
Application bundles are secretly folders, something you can find out by right clicking an app and selecting "Show Package Contents" this is important, because when you ask applescript to give you your current location it will be the location of the script itself.
set myPath to POSIX path of (path to me)will place the path of the application bundle(if it is one) as the variable myPath. Or if it is not an application bundle the path to the script.
Assuming you are writing it as an app bundle remember that the folder indicated by that variable is the bundle itself, NOT it's containing folder.
As a shell command is just a string (prefaced with "do shell script") you can use & to concatenate. Full examples of this sort of complex manipulation of shell and applescript are available in that other package I linked you to. Happy to answer any questions you have. The more expert mac users we have the better.
EDIT: BTW ¬ is generated by pressing
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#15
Posted 14 November 2010 - 09:57 PM
so after placing the code in
set myPath to POSIX path of (path to me) do shell script ¬ "cd ~/Library/Application\\ Support/minecraft/bin ; mkdir Temporary && cd Temporary && jar xf ../minecraft.jar ; rm -r meta-inf || rm -r META-INF; cp ~/Desktop/Mods/* .; jar cMf ../minecraft.jar ./ && cd .. ; rm -rf Temporary"what do i do now?
#16
Posted 14 November 2010 - 09:59 PM
set myPath to POSIX path of (path to me) do shell script ¬ "cd ~/Library/Application\\ Support/minecraft/bin ; mkdir Temporary && cd Temporary && jar xf ../minecraft.jar ; rm -r meta-inf || rm -r META-INF; cp " & myPath & "/Mods/* .; jar cMf ../minecraft.jar ./ && cd .. ; rm -rf Temporary"fix'd
I think.
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#17
Posted 14 November 2010 - 10:09 PM
#18
Posted 14 November 2010 - 10:29 PM
#19
Posted 14 November 2010 - 10:54 PM
set myPath to POSIX path of (path to me) do shell script ¬ "cd ~/Library/Application\\ Support/minecraft/bin ; mkdir Temporary && cd Temporary && jar xf ../minecraft.jar ; rm -r meta-inf || rm -r META-INF; cp \"" & myPath & "../Mods/\"* .; jar cMf ../minecraft.jar ./ && cd .. ; rm -rf Temporary"minor mistake
I told you that was going to happen but i forgot it myself.
.. stands for directory below me, which since modinstaller.app is one level too high this is the solution.
the \" are to avoid escaping spaces.
Just add a folder name “MCPatches” to your ~/Documents/ folder.
Open inside AppleScript Editor for gritty details.
#20
Posted 15 November 2010 - 07:17 AM








