gononono64 Posted August 27, 2011 Posted August 27, 2011 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.
MvGulik Posted August 27, 2011 Posted August 27, 2011 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 ...
gononono64 Posted August 28, 2011 Author Posted August 28, 2011 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.
MvGulik Posted August 28, 2011 Posted August 28, 2011 (edited) Try this one.Run('"' & @ScriptDir & '\rar.exe" x "' & @AppDataDir & '" \.minecraft\bin\minecraft.jar *.*','"' & @ScriptDir & '\TEMP"',@SW_HIDE) (e: forgot to quote one.) Edited August 28, 2011 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 ...
KaFu Posted August 28, 2011 Posted August 28, 2011 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 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
gononono64 Posted August 28, 2011 Author Posted August 28, 2011 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
Rogue5099 Posted August 28, 2011 Posted August 28, 2011 7zip UDF With a simple search you can find the files.7zip works a lot better than winrar in my opinion. My projects: Inventory / Mp3 Inventory, Computer Stats
MvGulik Posted August 28, 2011 Posted August 28, 2011 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 ...
rcmaehl Posted August 29, 2011 Posted August 29, 2011 (edited) Let me guess... you're trying to make an automated mod installer for minecraft. 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 August 29, 2011 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF
gononono64 Posted August 29, 2011 Author Posted August 29, 2011 Let me guess... you're trying to make an automated mod installer for minecraft. 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 7zip3. Open Minecraft.jar in 7zipI 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
rcmaehl Posted August 29, 2011 Posted August 29, 2011 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF
BoonPek Posted August 29, 2011 Posted August 29, 2011 (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 August 29, 2011 by BoonPek
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now