WinGetCreate 實用工具安裝及清單創建選項,還有 YAMLCreate.ps1 腳本助力
winget install wingetcreate
WinGetCreate真的很棒!它能幫助你把電腦里所有軟件的信息歸納好放在Windows的應用商店里。是不是感覺有些繞?其實就是說,用了它以后找軟件信息就更方便啦~
"對頭!選'是',WinGetCreate就能幫你在Windows應用商店上發個PR。這樣一來,大家都能看見你的軟件,下載也更容易了哦~"
YAMLCreate.ps1腳本的作用
別怕,Windows自帶了個叫YAMLCreate.ps1的好用PowerShell工具。在應用商店就能找到這個小助手,它能幫你快速管理清單文件~
這個真的很棒!直接用它復制電腦就行了。就在"工具"那個文件夾里找到它就能用。就是給大家找了個方便的幫手。
YAML格式的優勢
你問我為什么要用YAML來創建程序包清單?那是因為它簡單易懂,和微軟的其他開發工具也很搭!這樣不管是開發人員還是普通用戶都能輕松看懂清單文件。
雖然Windows的糊軟管家里還沒塞滿YAML的功能,但是已經有不少實用的安裝項目可供選擇了,大大簡化了我們裝軟件的過程,真的挺好用的。感覺就像是有個小助手在旁邊教你怎么做,特別得心應手。
清單文件的規范
PackageIdentifier: # Publisher.package format.
PackageVersion: # Version numbering format.
PackageLocale: # BCP 47 format (e.g. en-US)
Publisher: # The name of the publisher.
PackageName: # The name of the application.
License: # The license of the application.
ShortDescription: # The description of the application.
Installers:
- Architecture: # Enumeration of supported architectures.
InstallerType: # Enumeration of supported installer types (exe, msi, msix, inno, wix, nullsoft, appx).
InstallerUrl: # Path to download installation file.
InstallerSha256: # SHA256 calculated from installer.
ManifestType: # The manifest file type
ManifestVersion: 1.6.0
表格里別忘了用大寫字母,也別重復!這樣才能讓清單清晰明了,大家都能按這個規則來操作和查看。
PackageIdentifier: Microsoft.WindowsTerminal
PackageVersion: 1.6.10571.0
PackageLocale: en-US
Publisher: Microsoft
PackageName: Windows Terminal
License: MIT
ShortDescription: The new Windows Terminal, a tabbed command line experience for Windows.
Installers:
- Architecture: x64
InstallerType: msix
InstallerUrl: https://github.com/microsoft/terminal/releases/download/v1.6.10571.0/Microsoft.WindowsTerminal_1.6.10571.0_8wekyb3d8bbwe.msixbundle
InstallerSha256: 092aa89b1881e058d31b1a8d88f31bb298b5810afbba25c5cb341cfa4904d843
SignatureSha256: e53f48473621390c8243ada6345826af7c713cf1f4bbbf0d030599d1e4c175ee
ManifestType: singleton
ManifestVersion: 1.6.0
想一口氣看完所有清單?那就去瞧瞧Windows應用商店的清單規則!就像有個老師手把手教你完成任務,每個步驟都講得清清楚楚。
單一實例格式與多文件格式
PackageIdentifier: "Microsoft.WindowsTerminal"
PackageVersion: "1.6.10571.0"
DefaultLocale: "en-US"
ManifestType: "version"
ManifestVersion: "1.6.0"
軟件只要按一次,換個地兒就能搞定的話,用個安裝包,就選單一實例格式。不過,如果你得裝好幾個版本或者改好幾個地方,那就得用上N多YAML文件和那個框架咯。
這樣一來,我們是不是就可以把軟件和本地化資料分頭處理?這不就是你平時整理文件也會看實際需求!
PackageIdentifier: "Microsoft.WindowsTerminal"
PackageVersion: "1.6.10571.0"
PackageLocale: "en-US"
Publisher: "Microsoft"
PublisherUrl: "https://www.microsoft.com/"
PrivacyUrl: "https://privacy.microsoft.com/"
PackageName: "Windows Terminal"
PackageUrl: "https://learn.microsoft.com/windows/terminal/"
License: "MIT"
LicenseUrl: "https://github.com/microsoft/terminal/blob/master/LICENSE"
ShortDescription: "The new Windows Terminal, a tabbed command line experience for Windows."
Tags:
- "Console"
- "Command-Line"
- "Shell"
- "Command-Prompt"
- "PowerShell"
- "WSL"
- "Developer-Tools"
- "Utilities"
- "cli"
- "cmd"
- "ps"
- "terminal"
ManifestType: "defaultLocale"
ManifestVersion: "1.6.0"
show命令與默認區域設置
PackageIdentifier: "Microsoft.WindowsTerminal"
PackageVersion: "1.6.10571.0"
PackageLocale: "fr-FR"
Publisher: "Microsoft"
ShortDescription: "Le nouveau terminal Windows, une expérience de ligne de commande à onglets pour Windows."
ManifestType: "locale"
ManifestVersion: "1.6.0"
顯示提示時,其他地方沒設必填項的話,就用默認值哈。這樣大家看軟件資料時能大概知道啥意思了!
PackageIdentifier: "Microsoft.WindowsTerminal"
PackageVersion: "1.6.10571.0"
Platform:
- "Windows.Desktop"
MinimumOSVersion: "10.0.18362.0"
InstallerType: "msix"
InstallModes:
- "silent"
PackageFamilyName: "Microsoft.WindowsTerminal_8wekyb3d8bbwe"
Installers:
- Architecture: "x64"
InstallerUrl: "https://github.com/microsoft/terminal/releases/download/v1.6.10571.0/Microsoft.WindowsTerminal_1.6.10571.0_8wekyb3d8bbwe.msixbundle"
InstallerSha256: 092aa89b1881e058d31b1a8d88f31bb298b5810afbba25c5cb341cfa4904d843
SignatureSha256: e53f48473621390c8243ada6345826af7c713cf1f4bbbf0d030599d1e4c175ee
- Architecture: "arm64"
InstallerUrl: "https://github.com/microsoft/terminal/releases/download/v1.6.10571.0/Microsoft.WindowsTerminal_1.6.10571.0_8wekyb3d8bbwe.msixbundle"
InstallerSha256: 092aa89b1881e058d31b1a8d88f31bb298b5810afbba25c5cb341cfa4904d843
SignatureSha256: e53f48473621390c8243ada6345826af7c713cf1f4bbbf0d030599d1e4c175ee
- Architecture: "x86"
InstallerUrl: "https://github.com/microsoft/terminal/releases/download/v1.6.10571.0/Microsoft.WindowsTerminal_1.6.10571.0_8wekyb3d8bbwe.msixbundle"
InstallerSha256: 092aa89b1881e058d31b1a8d88f31bb298b5810afbba25c5cb341cfa4904d843
SignatureSha256: e53f48473621390c8243ada6345826af7c713cf1f4bbbf0d030599d1e4c175ee
ManifestType: "installer"
ManifestVersion: "1.6.0"
只要你是用Nullsoft或Inno做的EXE安裝程序,那就簡單,直接把選項設成'無'就好。這樣用戶在安裝時就能自動選擇'無'了。
作者:小藍
鏈接:http://m.huanchou.cn/content/354.html
本站部分內容和圖片來源網絡,不代表本站觀點,如有侵權,可聯系我方刪除。