Sign in to follow this  
Followers 0
gononono64

[Help] Trying to extract a jar file

12 posts in this topic

Hey,

As the title suggests I'm im trying to extract a jar file to a specific location. I can do it without it going to anyone location but i need it to go to a specific file. This is what i have (I'm trying to make a mod loader for minecraft):

Run("jar.exe xf " & @AppDataDir & "\.minecraft\bin\minecraft.jar -C C:\Users\Devon\Desktop\idk\TEMP")

Ive also tried to open it with rar.exe but that did not work.

I will also need to re-jar the file. Any suggestions for that would also be greatly appreciated.

Thanks in advance for everything.

Share this post


Link to post
Share on other sites



Why did using winrar on your *.jar file failed ? (error message/reason) Jar just being a normal zip file (with some additional special jar related files in it)

Might be a protected zip file. (although those should still open with winrar.)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

This is what i have to extract the .jar with rar.exe:

Run(@ScriptDir & "\rar.exe x " & @AppDataDir & "\.minecraft\bin\minecraft.jar *.*",@ScriptDir&"\TEMP",@SW_HIDE)

But it simply wont extract it. Like i run the code and it doesnt do anything.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this one.

Run('"' & @ScriptDir & '\rar.exe" x "' & @AppDataDir & '" \.minecraft\bin\minecraft.jar *.*','"' & @ScriptDir & '\TEMP"',@SW_HIDE)

(e: forgot to quote one.)

Edited by iEvKI3gv9Wrkd41u

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

I used Rasims 7Zip UDF to extract files from a jar file successfully:

Here's a sample of the extraction I used:

$retResult = _7ZIPExtract(0, "c:\file.jar", @ScriptDir & '\extracted\', 0, 0, 1, 0, 0, 'locale\browser\browser.dtd') ; where 'locale\browser\browser.dtd' is the file to be extracted

Share this post


Link to post
Share on other sites

Try this one.

Run('"' & @ScriptDir & '\rar.exe" x "' & @AppDataDir & '" \.minecraft\bin\minecraft.jar *.*','"' & @ScriptDir & '\TEMP"',@SW_HIDE)

(e: forgot to quote one.)

Doesn't work

I used Rasims 7Zip UDF to extract files from a jar file successfully:

Here's a sample of the extraction I used:

[ autoIt ] ( Popup )

$retResult = _7ZIPExtract(0, "c:\file.jar", @ScriptDir & '\extracted\', 0, 0, 1, 0, 0, 'locale\browser\browser.dtd') ; where 'locale\browser\b

I'm trying to avoid adding more .exes also the 2 files in the 7zip.zip are urls and they send me to not valid sites

Share this post


Link to post
Share on other sites

7zip UDF With a simple search you can find the files.

7zip works a lot better than winrar in my opinion.

Lets see where this will go.

- Expected OP answer. "not working" (by approximation)

- Expected OP additional info. "" (infinity small)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Let me guess... you're trying to make an automated mod installer for minecraft. :mellow: I'm still working on this myself however I'm doing it the easier/more educational way.

1. Download and install 7zip for user (winrar sucks)

2. Open Downloaded mod in 7zip

3. Open Minecraft.jar in 7zip

I think you see where I'm going with this.

However, If you REALLY want to do it the hard way of extracting the jar and re-compressing the jar let me know and I'll see what I can do. :)

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites

Let me guess... you're trying to make an automated mod installer for minecraft. :mellow: I'm still working on this myself however I'm doing it the easier/more educational way.

1. Download and install 7zip for user (winrar sucks)

2. Open Downloaded mod in 7zip

3. Open Minecraft.jar in 7zip

I think you see where I'm going with this.

However, If you REALLY want to do it the hard way of extracting the jar and re-compressing the jar let me know and I'll see what I can do. :)

How would there be anyother way to do it?... can you simply move the modded files over to the archive?... like i dun get it.

How would u simply just open a .jar file with autoit... since (as far as i know) there isnt a runwith/openwith function.

And i also do not know much about the run cmds.

Thanks for help in anycase

Share this post


Link to post
Share on other sites

Currently I'm screwing around with my own script to just import the files into the jar without extracting the jar. If I can get it to work I'll post my script. Ok?


My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

This is what I use for my custom minecraft launcher/mod installer. You can use a native Window's DLL, it's something like ZIP UDF in pure AutoIt, but that doesn't guarantee reliability. Some users don't have the DLL or they don't have it registered so your best bet would be to use an external exe and place it into a temporary directory to have it deleted after use:

GUICtrlSetData($uCtrl[2], "Decompressing packages")
RunWait($bcDir & "\7za.exe x minecraft.jar -ospouttemp", $tmpDir, @SW_HIDE)
RunWait($bcDir & "\7za.exe x spoutcraft.zip -y -ospouttemp", $tmpDir, @SW_HIDE)
DirRemove($tmpDir & "\spouttemp\META-INF", 1)

GUICtrlSetData($uCtrl[2], "Compiling SpoutCraft")
 RunWait($bcDir & "\7za.exe a -tzip -mx9 spoutcraft.jar *.* -r", $tmpDir & "\spouttemp", @SW_HIDE)
FileMove($tmpDir & "\spouttemp\spoutcraft.jar", $tmpDir & "\minecraft.jar", 9)

GUICtrlSetData($uCtrl[2], "Patching SpoutCraft")
FileDelete($tmpDir & "\spoutcraft.zip")
DirRemove($tmpDir & "\spouttemp", 1)
DirMove($tmpDir, $scDir & "\bin", 1)
Edited by BoonPek

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0