TESArchive的CLI補丁 - CPTA

作者 ikk2·版本 v1.1·更新於 2019-02-03

向官方Skyrim SE Creation Kit中的TESArchive(aka Archive.exe)添加新功能。 通過使TESArchive接受從Windows shell傳遞給它的參數,使構建BSA文件的過程完全自動化。

截圖 共 1 張

模組介紹 作者原文

向官方Skyrim SE Creation Kit中的TESArchive(aka Archive.exe)添加新功能。 通過使TESArchive接受從Windows shell傳遞給它的參數,使構建BSA文件的過程完全自動化。

可以在批處理文件中使用TESArchive,也可以使用命令行參數。

它是一個Windows DLL模塊,需要連接到原始的TESArchive可執行文件。

開源,包含項目的源代碼。

使用DLL修補TESArchive

注意:您自己不需要這樣做。其他人可能會爲您執行此操作,並使用下面列出的所有工具和步驟在其末端修補可執行文件。

所需工具和實用程序:

CFF Explorer VII  - 或其他可以修復Archive.exe以向其導入添加新DLL的程序.CFF Explorer VII是Daniel Pistelli的Explorer Suite的一部分,可以從這裏免費下載。

Archive.exe  - 安裝Creation Kit後位於遊戲的以下子目錄中:“\ Tools \ Archive \ Archive.exe”。此時,使用Creation Kit v1.5.3.0更新於2019-01-29。

cpta_dll.dll  - 使用此項目構建的DLL文件。

腳步:

*將“cpta_dll.dll”複製到“Archive.exe”所在的文件夾/目錄中。

*啓動CFF Explorer VII。

*在主菜單中選擇“文件”,然後選擇“打開”並瀏覽“Archive.exe”。

*從左側列表中選擇“導入加法器”。

*在主窗口的中間。找到並按“添加”按鈕。

*瀏覽並選擇“cpta_dll.dll”。

*在下面的列表中,“導出的功能”列表中的所有按鈕,

選擇它的單個項目 - 如果它尚未被選中。

*按“按名稱導入”按鈕。

*按“重建導入表”按鈕。

*選擇主菜單“文件”,然後選擇“另存爲”並保存

您從“Archive_cpta.exe”開始的目錄。

從現在開始,以舊方式修補“Archive_cpta.exe”,通過單擊其圖標,您將至少獲得以下一種錯誤消息:

1.缺少名爲“cpta_dll.dll”的DLL文件。

2.尚未找到環境變量ASCP_INPUT_DIR。

CPTA DLL配置

一旦修補了TESArchive,或者有人爲您修補了它,您就可以在shell腳本或其他外部實用程序中使用它。以下環境變量由“cpta_dll.dll”使用。

ASCP_INPUT_DIR  - 將創建BSA存檔的輸入目錄名稱內容。此路徑應指向名爲“Data”的目錄。最初,在未修補版本中,這是“編輯” - “添加目錄”選項。

ASCP_OUTPUT_BSA  - 輸出BSA文件名。必須以'.bsa'擴展名結尾。

ASCP_CONF  - 可選配置。分號分隔(“;”)鍵值對以預先配置主TESArchive GUI窗口。請參閱選項名稱的批處理文件示例。

通常,在使用批處理腳本(.BAT)時,使用“SET”命令分配上述環境變量。

批處理腳本示例

@echo關閉

SET ASCP_INPUT_DIR = C:\ bsa_data \ Data

SET ASCP_OUTPUT_BSA = C:\ bsa_data \ output.bsa

SET ASCP_CONF = bRemoveBSL = 0; bCLIOnly = 0; bHidden = 0; bNoQuit = 0; types2 = eCompress,eMeshes,eTextures,eMisc

\ Archive_cpta.exe

回聲狀態:%ERRORLEVEL%

SET ASCP_INPUT_DIR =

SET ASCP_OUTPUT_BSA =

SET ASCP_CONF =

暫停

從源代碼編譯CPTA DLL項目

注意:您不需要這樣做。您將在下載部分找到已編譯的版本。

使用的軟件

  • MS Visual C ++編譯器 - 使用Visual Studio 2017(又名MSVC2017)測試,應該與舊版本一起使用
  • Windows SDK  - 使用v7.1測試(通常使用MSVC安裝Windows SDK)
  • Detours軟件包 - 使用v4.0.1進行測試。鏈接

必須爲64位Windows體系結構編譯源代碼。

編譯器選項:/ DDETOURS_TARGET_PROCESSOR = x64

鏈接器選項:/ dll

Detours構建配置

有關Detours軟件包的一些說明。使用提供的配置makefile構建繞道。或者,使用以下編譯器標誌:

/ MT / Gy / Od / DDETOURS_TARGET_PROCESSOR = x64

/ DWIN32_LEAN_AND_MEAN / D_WIN32_WINNT = 0x501

鏈接和參考

我的Github頁面:

Detours軟件包:

CFF Explorer VII和資源管理器套件:

安裝Creation Kit:

Bethesda.net儀表板:

————————————————————————————————————————————————————

Possibility to use TESArchive in Batch files and with command-line like parameters.

It is a Windows DLL module that needs to be attached to the original TESArchive executable.

Open source, with source code of the project available.

Patching TESArchive with the DLL

Note: you don't need to do this yourself. Someone else may do this for you and patch executable on his/her end with all the tools and steps listed below.

Tools and utilities needed:

CFF Explorer VII - or other program that can patch Archive.exe to add new DLL to its imports.CFF Explorer VII is part of Explorer Suite by Daniel Pistelli and can be downloaded for free from here.

Archive.exe - located in your following subdirectory of the game after Creation Kit has been installed: "\Tools\Archive\Archive.exe". At this moment, using Creation Kit v1.5.3.0 updated at 2019-01-29.

cpta_dll.dll - the DLL file build with this project.

Steps:

  • Copy "cpta_dll.dll" to the same folder/directory "Archive.exe" is in.
  • Start CFF Explorer VII.
  • In the main menu select "File", then "Open" and browse for "Archive.exe".
  • From the list on the left, select "Import Adder".
  • Int the middle of the main window. find and press the "Add" button.
  • Browse and select "cpta_dll.dll".
  • In the list below all the buttons, in the "Exported Functions" list,

select its single item - if it's not selected already.

  • Press "Import By Name" button.
  • Press "Rebuild Import Table" button.
  • Select main menu "File" then "Save As" and save in the same

directory you started from as "Archive_cpta.exe".

From now on when you start patched "Archive_cpta.exe" the old way, by clicking on its icon, you will get at least one type of the following error messages:

  • that the DLL file named "cpta_dll.dll" is missing.
  • that environment variable AS …

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 這類遊戲沒有通用的模組管理器:有的模組直接替換遊戲檔案、有的放進遊戲專屬的 Mods 資料夾、有的要先裝遊戲對應的社群載入器或工具,以包內說明為準。
  3. 嚴格按說明放置檔案;標註「前置依賴」的模組需要把依賴一併裝好。
  4. 啟動遊戲確認載入成功;部分遊戲需要在設定或模組選單裡手動啟用。

不同遊戲、不同模組的安裝位置差異很大,包內說明是最可靠的依據。

檔案與校驗

檔案名稱
TESArchive的CLI补丁 - CPTA
檔案大小
101.0 KiB