Microsoft Store
Microsoft Store 是 Microsoft 运营的 Windows 应用商店。
¥Microsoft Store is the Windows app store operated by Microsoft.
本指南仅介绍将 Windows 应用直接分发到 Microsoft Store 的详细信息。有关更多信息,请参阅 Windows 安装程序指南,有关使用插件权限的信息,请参阅 。
¥This guide only covers details for distributing Windows Apps directly to the Microsoft Store. See the Windows Installer guide for more information on Windows installer distribution options and configurations.
要求
¥Requirements
要在 Microsoft Store 上发布应用,你必须拥有 Microsoft 账户和 enroll 作为个人或公司开发者。
¥To publish apps on the Microsoft Store you must have a Microsoft account and enroll as a developer either as an individual or as a company.
更改应用图标
¥Changing App Icon
Tauri CLI 可以生成你的应用所需的所有图标,包括 Microsoft Store 图标。使用 tauri icon
命令从单个 PNG 或 SVG 源生成应用图标:
¥The Tauri CLI can generate all icons your app needs, including Microsoft Store icons.
Use the tauri icon
command to generate app icons from a single PNG or SVG source:
npm run tauri icon /path/to/app-icon.png
yarn tauri icon /path/to/app-icon.png
pnpm tauri icon /path/to/app-icon.png
deno task tauri icon /path/to/app-icon.png
cargo tauri icon /path/to/app-icon.png
设置
¥Setting up
使用 Microsoft 账户注册为开发者后,你需要在 应用和游戏 页面中注册你的应用。单击 New Product
,选择 EXE or MSI app
并为你的应用保留一个唯一的名称。
¥After you have enrolled as a developer with your Microsoft account you need to register your app in the Apps and Games page.
Click New Product
, select EXE or MSI app
and reserve a unique name for your app.
构建和上传
¥Build and upload
目前 Tauri 仅生成 EXE 和 MSI 安装程序,因此你必须创建仅链接到解压后应用的 Microsoft Store 应用。Microsoft Installer 中链接的安装程序必须处于离线状态,处理自动更新 和 代码签名。
¥Currently Tauri only generates EXE and MSI installers, so you must create a Microsoft Store application that only links to the unpacked application. The installer linked in the Microsoft Installer must be offline, handle auto-updates and be code signed.
有关更多信息,请参阅 官方发布文档。
¥See the official publish documentation for more information.
离线安装程序
¥Offline Installer
通过 Microsoft Store 分发的 Windows 安装程序必须使用 离线安装程序 Webview2 安装选项。
¥The Windows installer distributed through the Microsoft Store must use the Offline Installer Webview2 installation option.
要仅在为 Microsoft Store 打包时应用此安装程序配置,你可以定义单独的 Tauri 配置文件:
¥To only apply this installer configuration when bundling for Microsoft Store, you can define a separate Tauri configuration file:
{ "bundle": { "windows": { "webviewInstallMode": { "type": "offlineInstaller" } } }}
然后在为 Microsoft Store 打包 Tauri 应用时将该配置文件与主文件合并:
¥Then merge that config file with the main one when bundling your Tauri app for Microsoft Store:
npm run tauri build -- --no-bundlenpm run tauri bundle -- --config src-tauri/tauri.microsoftstore.conf.json
yarn tauri build --no-bundleyarn tauri bundle --config src-tauri/tauri.microsoftstore.conf.json
pnpm tauri build --no-bundlepnpm tauri bundle --config src-tauri/tauri.microsoftstore.conf.json
deno task tauri build --no-bundledeno task tauri bundle --config src-tauri/tauri.microsoftstore.conf.json
cargo tauri build --no-bundlecargo tauri bundle --config src-tauri/tauri.microsoftstore.conf.json
这在设置 CI/CD 以将你的应用上传到 Microsoft Store 时特别有用,同时为你在应用商店之外分发的 Windows 安装程序进行单独的配置。
¥This is particularly useful when setting up your CI/CD to upload your app to the Microsoft Store while having a separate configuration for the Windows installer you distribute outside the app store.
发布者
¥Publisher
你的应用 publisher 名称不能与应用产品名称匹配。
¥Your application publisher name cannot match the application product name.
如果未设置发布者配置值,Tauri 将从你的打包标识符的第二部分中得出它。由于发布者名称无法与产品名称匹配,因此以下配置无效:
¥If the publisher configuration value is not set, Tauri derives it from the second part of your bundle identifier. Since the publisher name cannot match the product name, the following configuration is invalid:
{ "productName": "Example", "identifier": "com.example.app"}
在这种情况下,你可以单独定义 publisher 值来解决此冲突:
¥In this case you can define the publisher value separately to fix this conflict:
{ "productName": "Example", "identifier": "com.example.app", "bundle": { "publisher": "Example Inc." }}
上传
¥Upload
为 Microsoft Store 构建 Windows 安装程序后,你可以将其上传到你选择的分发服务,并将其链接到 Microsoft Store 网站中的应用页面。
¥After building the Windows installer for Microsoft Store, you can upload it to the distribution service of your choice and link it in your application page in the Microsoft Store website.
Tauri 中文网 - 粤ICP备13048890号