2013-07-05 47 views
3

所以我很新的批處理在這裏,我試圖做一個自動安裝程序的一些修改,需要做一個罐子。指定批處理執行的zip文件

當我在拖動文件,但林不知道如何告訴它要執行的文件wihtout超過draggin它拖放

,所以你知道7za應用程序被用來提取和我說,這將執行如果我拖放因爲我想forge.zip解包並注入minecraft.jar

set_source=%APPDATA%\Roaming\.minecraft\bin\forge.zip 
set path="%USERPROFILE%";%path% 
move 7za.exe %USERPROFILE% 
cd %USERPROFILE% 
7za x AppData\Roaming\.minecraft\bin\minecraft.jar -oAppData\Roaming\.minecraft\bin\TempStuff\ 
7za x %* -oAppData\Roaming\.minecraft\bin\TempStuff\ -y 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin\TempStuff\ 
rmdir /S /Q META-INF 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
ren minecraft.jar "minecraft_c.jar" 
cd %USERPROFILE% 
7za a -r minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft  \bin\TempStuff\* -o%USERPROFILE%\AppData\Roaming\.minecraft\bin 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
rmdir /S /Q TempStuff 
cd %USERPROFILE% 
move /y %USERPROFILE%\minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft\bin 
pause 

這是應該覆蓋在一個罐子裏的核心文件,以允許修改那些文件的工作。冒頭的是我沒有看別人的soemone替換代碼,但我想我搞砸了某處... :(

解決方案

set path="%USERPROFILE%";%path% 
move 7za.exe %USERPROFILE% 
cd %USERPROFILE% 
7za x AppData\Roaming\.minecraft\bin\minecraft.jar -oAppData\Roaming\.minecraft\bin\TempStuff\ 
7za x "%USERPROFILE%\AppData\Roaming\.minecraft\JarMods\*.zip" -oAppData\Roaming\.minecraft\bin\TempStuff\ -y 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin\TempStuff\ 
rmdir /S /Q META-INF 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
ren minecraft.jar "minecraft_c.jar" 
cd %USERPROFILE% 
7za a -r minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft\bin\TempStuff\* -o%USERPROFILE%\AppData\Roaming\.minecraft\bin 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
rmdir /S /Q TempStuff 
cd %USERPROFILE% 
move /y %USERPROFILE%\minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft\bin 
cd %APPDATA%\Roaming\.minecraft 
mkdir mods 
move "%USERPROFILE%\<insert ModInstall path here>\OtherMods\"  %USERPROFILE%\AppData\Roaming\.minecraft\mods 
+0

想通了這裏是用7za – user2554653

+4

那麼你應該張貼的溶液,作爲一個答案,標記爲解決新代碼。 – z2s8

回答

1

筆者想出瞭解決方案,但一直沒有回這樣以來,讓他的解決方案現在將被擺在這裏:

set path="%USERPROFILE%";%path% 
move 7za.exe %USERPROFILE% 
cd %USERPROFILE% 
7za x AppData\Roaming\.minecraft\bin\minecraft.jar -oAppData\Roaming\.minecraft\bin\TempStuff\ 
7za x "%USERPROFILE%\AppData\Roaming\.minecraft\JarMods\*.zip" -oAppData\Roaming\.minecraft\bin\TempStuff\ -y 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin\TempStuff\ 
rmdir /S /Q META-INF 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
ren minecraft.jar "minecraft_c.jar" 
cd %USERPROFILE% 
7za a -r minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft\bin\TempStuff\* -o%USERPROFILE%\AppData\Roaming\.minecraft\bin 
cd %USERPROFILE%\AppData\Roaming\.minecraft\bin 
rmdir /S /Q TempStuff 
cd %USERPROFILE% 
move /y %USERPROFILE%\minecraft.jar %USERPROFILE%\AppData\Roaming\.minecraft\bin 
cd %APPDATA%\Roaming\.minecraft 
mkdir mods 
move "%USERPROFILE%\<insert ModInstall path here>\OtherMods\"  %USERPROFILE%\AppData\Roaming\.minecraft\mods