應用程式安裝程式檔案概觀App Installer file overview

通常,您會需要與許多使用者共用應用程式。Often, you need to share your app with many users. 之後您會需要更新應用程式,而且必須確定您可以為沒有技術背景的使用者輕鬆且順利地更新應用程式。Later you need to update the app and you want to make sure you can do that in a way that is seamless even for your non-technical users, and easy for you.

為了協助您達成此目的,我們引進了應用程式安裝程式檔案。To help you achieve this, we introduced the App Installer file. 這是一個 XML 檔案,您可以自行建立或使用 Visual Studio 建立此檔案 (請參閱此處的 Visual Studio 指示)。This is an XML file that you can create yourself or create using Visual Studio (see Visual Studio instructions here). 應用程式安裝程式檔案會指定您應用程式的所在位置,以及進行更新的方式。The App Installer file specifies where your app is located and how to update it. 如果您選擇使用這種應用程式散發方式,您必須與使用者共用應用程式安裝程式檔案,而不是共用實際的應用程式容器。If you choose to use this method of app distribution, you must share with your users the App Installer file, instead of the actual app container. 然後,使用者必須按一下應用程式安裝程式檔案。The user must then click on the App Installer file. 此時會出現熟悉的應用程式安裝程式 UI,並引導使用者完成安裝。At this point the familiar App Installer UI will appear and guide the user through the installation. 當使用者使用這些步驟來安裝應用程式後,應用程式就會與應用程式安裝程式檔案相關聯。Once the user has installed the application using these steps, the application is associated with the App Installer file.

之後您要對應用程式進行更新時,只需更新應用程式安裝程式 (.appinstaller) 檔案。Later, when you have an update to the application, you only update the App Installer (.appinstaller) file. 當您更新該檔案時,新版的應用程式就會推送給使用者。When you update the file, the new version of the application is pushed to the user. 這對使用者來說十分有利,因為他們不需要採取任何動作來取得更新。This is especially good for your users because they don’t have to do anything to get the update. 他們只需一如往常地繼續使用應用程式,更新就會傳送給他們。They just keep using the application as usual, and the update will be delivered to them.

以下是示範其運作方式的範例:Here's an example showing how this works:

  1. IT 專業人員 Joe 想要將「人力資源」應用程式發佈到他的公司。IT Pro Joe wants to distribute the Human Resources app to his enterprise.
  2. IT 專業人員 Joe 將「人力資源」應用程式放在共用位置,並建立名為 HumanResources.appinstaller 的應用程式安裝程式檔案。IT Pro Joe puts the Human Resources app on a share and creates an App Installer file named HumanResources.appinstaller. 此應用程式安裝程式檔案會與應用程式相關聯。This App Installer file is associated with the app.
  3. IT 專業人員 Joe 將 HumanResources.appinstaller 放在共用位置。IT Pro Joe puts HumanResources.appinstaller on a share.
  4. IT 專業人員 Joe 會將公司員工導向 HumanResources.appinstaller。IT Pro Joe points the enterprise’s employees to HumanResources.appinstaller.
  5. 經理 Maggie 按一下 HumanResources.appinstaller 並取得應用程式安裝程式 UI,而這會引導她安裝「人力資源」應用程式。Manager Maggie clicks on HumanResources.appinstaller and gets the App Installer UI, which guides her to install the Human Resources application.
  6. 從那刻起,在經理 Maggie 的裝置上,「人力資源」就是另一個應用程式,她可以與該應用程式互動,就如同與任何其他應用程式互動一樣。From that point, on manager Maggie’s device Human Resources is just another app and she interacts with it as she does with any other app. 她可以將其釘選到工作列或開始功能表上,讓其出現在她的應用程式清單等等。She can pin it to the task bar or the start menu, it appears in her apps list etc.
  7. 一週後,IT 專業人員 Joe 更新了「人力資源」應用程式。A week later IT pro Joe gets an update to the Human Resources app. 為了與使用者共用更新,他將 HumanResources.appinstaller 更新為指向新的應用程式版本,並設定他想要的更新類型。To share it with users, he just updates HumanResources.appinstaller to point to the new app version and sets the update type he wants.
  8. 隔天早上,不知道有任何更新的經理 Maggie 啟動了她桌面上的「人力資源」應用程式。The next morning, Manager Maggie, who doesn’t know anything about the update launches the Human Resources application that’s already on her desktop.
  9. 應用程式會偵測到有可用更新,並自動套用更新The application detects that there’s an update and applies the update automatically
  10. 經理 Maggie 很滿意她現在有最新版的應用程式,而且還可以利用新功能。Manager Maggie is happy that she now has the latest version of the application and can take advantage of the new features.

在 Windows 10 Fall Creators Update (1709 版,組建 16299) 和之後的版本中,Windows SDK 還提供了多個 API,讓您透過應用程式安裝程式檔案以程式設計方式修改套件,或從與應用程式安裝程式相關聯的應用程式中擷取資訊。Starting in the Windows 10 Fall Creators Update (version 1709, build 16299) and later releases, the Windows SDK also provides several APIs that you can use to programmatically modify packages via App Installer files or to retrieve information about apps with an App Installer association. 如需詳細資訊,請參閱相關文件For more information, see Related documentation.

應用程式安裝程式檔案的內容Contents of the App Installer file

下圖顯示應用程式安裝程式檔案的範例。The following image shows an example App Installer file. 若要對應用程式安裝程式檔案中的 XML 元素有完整了解,請參閱應用程式安裝程式檔案結構描述參考For full details about the XML elements in the App Installer file, see the App Installer file schema reference. 如需如何在應用程式安裝程式檔案中進行更新設定的詳細資訊,請參閱在應用程式安裝程式檔案中進行更新設定For more information about how to configure update settings in the App Installer file, see Configure update settings in the App Installer file.

具有更新設定的應用程式安裝程式檔案範例