TXA. Kho gói phần mềmPackage index

Tích hợp TXA vào ứng dụng của bạnIntegrating TXA into your application

Trang này đọc trực tiếp từ thư mục docs của kho nên luôn khớp với bản trên GitHub.This page is read straight from the repository's docs folder, so it always matches what is on GitHub. Sửa trên GitHubEdit on GitHub

Ứng dụng phát hành qua kho TXA có thể tự nhận ra mình được cài bằng txapm, và khi có bản mới thì gọi txapm cập nhật thay vì dùng bộ cập nhật riêng.

English: app-integration.en.md

Biết mình có được cài bằng TXA không

txapm which TXAVL.TDrop --json

Lệnh luôn thoát với mã 0 và in một dòng JSON:

{"managed": true, "id": "TXAVL.TDrop", "version": "0.3.2", "newest": "0.3.3", "update_available": true, "pinned": false, "dir": null, "source": "txa"}
TrườngÝ nghĩa
managedtrue nếu gói có trong danh sách cài của txapm
version / newestbản đang cài / bản mới nhất trong đúng kho gói được cài từ đó
update_availablecó bản mới hay không
pinnedngười dùng đã ghim phiên bản (txapm pin add)
dirthư mục cài (chỉ có với gói portable)
sourcekho mà gói được cài từ đó

Gói không được cài bằng TXA thì managed là false và các trường còn lại là null / false.

Cập nhật

Khi update_available là true và pinned là false, ứng dụng tự gọi lệnh dưới đây rồi thoát để bộ cài ghi đè file:

txapm upgrade TXAVL.TDrop

Chọn phiên bản khi cài

--version nhận số đầy đủ hoặc đầu số, và lấy bản mới nhất khớp:

txapm install dotnet-sdk-8 --version 8        # bản 8.x.y mới nhất trong kho
txapm install vs2022 --version 17.10          # bản 17.10.x mới nhất
txapm install vs2022 --version 17.10.5        # đúng bản này

Không truyền --version thì luôn lấy bản mới nhất.

Phím tắt ngoài desktop

Gói có thể khai báo shortcut (name, exe) trong card build. txapm không tự tạo shortcut; nó dùng exe để kiểm tra chương trình có tồn tại sau khi cài và cài lại một lần nếu bộ gỡ cũ xoá mất. Xem manifest-schema.md.

An app released through the TXA repository can detect that it was installed with txapm and, when a new version exists, call txapm to update instead of using its own updater.

Tiếng Việt: app-integration.md

Detecting whether you were installed by TXA

txapm which TXAVL.TDrop --json

The command always exits with code 0 and prints one line of JSON:

{"managed": true, "id": "TXAVL.TDrop", "version": "0.3.2", "newest": "0.3.3", "update_available": true, "pinned": false, "dir": null, "source": "txa"}
FieldMeaning
managedtrue if the package is in txapm's install list
version / newestinstalled version / newest version in the source the package was installed from
update_availablewhether a newer version exists
pinnedthe user pinned the version (txapm pin add)
dirinstall folder (portable packages only)
sourcethe source the package was installed from

For a package not installed by TXA, managed is false and the other fields are null / false.

Updating

When update_available is true and pinned is false, the app runs the command below and exits so the installer can overwrite its files:

txapm upgrade TXAVL.TDrop

Choosing a version

--version accepts a full number or a prefix and takes the newest match:

txapm install dotnet-sdk-8 --version 8        # newest 8.x.y in the repository
txapm install vs2022 --version 17.10          # newest 17.10.x
txapm install vs2022 --version 17.10.5        # exactly this one

Without --version the newest version is always used.

Desktop shortcut

A package can declare shortcut (name, exe) in its build card. txapm does not create the shortcut; it uses exe to check that the program exists after the install and installs once more if an old uninstaller removed it. See manifest-schema.en.md.