Office アドインを Microsoft AppSource に発行する
Office アドインを Microsoft AppSource に発行して、顧客や企業が広く利用できるようにします。 Microsoft AppSource は、業界をリードするソフトウェア プロバイダーによって構築された何千ものビジネス アプリケーションとサービスを含むオンライン ストアです。 Microsoft AppSource にアドインを発行する場合は、Office 内の製品内エクスペリエンスでもアドインを使用できるようにします。
発行プロセス
続行する前に、次の手順を実行します。
- パートナー センター アカウントを持っている。
- アドインが該当する AppSource 検証ポリシーに準拠していることを確認します。
- 発行する準備ができていることを確認します。
Microsoft AppSource と Office 内にソリューションを含める準備ができたら、パートナー センターに提出します。 その後、承認と認定プロセスを経ます。 詳細については、「 Microsoft AppSource と Office 内でソリューションを使用できるようにする」を参照してください。
アドインを AppSource で使用できる場合は、さらに 2 つの手順を実行して、より広くインストールできます。
インストール リンクを指定する
Microsoft AppSource に発行した後、インストール リンクを作成して、ユーザーがアドインを検出してインストールできるようにすることができます。 インストール リンクは、"クリックして実行" エクスペリエンスを提供します。 Web サイト、ソーシャル メディア、またはユーザーがアドインを見つけるのに役立つと思う任意の場所にリンクを配置します。 ユーザーがリンクを選択すると、Office アプリケーションが新しいドキュメントで開き、アドインがインストールされ、ユーザーが Microsoft AppSource で検索して手動でインストールする必要はありません。
注:
インストール リンクは、Excel、PowerPoint、Word アドインに対してのみ作成できます。
Office アプリケーションをOffice on the webまたはデスクトップ Office で開くかどうかに応じて、2 つのスタイルのリンクがあります。
注:
リンクのスタイルによって、アドインがインストールされているプラットフォームではなく、開くプラットフォームのみが決まります。 アドインは、マニフェストで指定されているすべての要件セットをサポートするすべてのプラットフォームにインストールされます。 「Office のバージョンと要件セット」を参照してください。
Office on the webで開く
リンクを作成するには、参照として次の URL テンプレートを使用します。
https://go.microsoft.com/fwlink/?linkid={{linkId}}&templateid={{addInId}}&templatetitle={{addInName}}
URL のプレースホルダーを次のように変更します。
linkId: 新しいドキュメントを開くときに使用する Web エンドポイントを指定します。
- Web 上のWordの場合:
2261098
- Excel on the webの場合:
2261819
- PowerPoint on the webの場合:
2261820
- Web 上のWordの場合:
addInId: AppSource に記載されているアドインの ID。
addInName: アドインの完全なタイトル。 これは URL エンコードされている必要があります。
たとえば、Script Labのインストール リンクを次に示します。
Script Labインストール リンクには、次のパラメーター値が使用されます。
-
linkid:
2261819
値は、Excel エンドポイントを指定します。 Script Labでは、Word、Excel、PowerPointがサポートされているため、この値を変更してさまざまなエンドポイントをサポートできます。 -
templateid:
WA104380862
値は、Script Labの Microsoft AppSource ID です。 -
templatetitle:
Script%20Lab,%20a%20Microsoft%20Garage%20project
値は、タイトルの URL でエンコードされた値です。
Windows または Mac の Office で開く
リンクを作成するには、参照として次の URL テンプレートを使用します。
{{appName}}:https://api.addins.store.office.com/addinstemplate/{{language}}/{{correlationID}}/{{addinId}}/none/{{addinName}}.{{fileFormat}}?omexsrctype=1
URL のプレースホルダーを次のように変更します。
appName: このパラメーターは、ユーザーがリンクをクリックしたときに開く Office アプリケーションを指定します。
- Wordの場合:
ms-word
- Excel の場合:
ms-excel
- PowerPoint の場合:
ms-powerpoint
- Wordの場合:
言語: これはアドインの言語です。 たとえば、
de-DE
、ja-JP
、またはzh-CN
。correlationID: 診断目的の GUID。 たとえば、"7bf846ec-905a-5edd-b162-83498f9a8674" です。 GUID 生成ツールを使用します。 複数のユーザーが同じ GUID を持っている場合、診断の目的は破られます。そのため、実行時に生成し、クリックごとに異なるようにすることをお勧めします。
addInId: AppSource に記載されているアドインの ID。 このパラメーターでは、大文字と小文字が区別されます。 大文字を使用します。
addInName: アドインの完全な名前。 これは URL エンコードされている必要があります。
fileFormat: 作成されるファイルの形式を指定します。
- Wordの場合:
docx
- Excel の場合:
xlsx
- PowerPoint の場合:
pptx
- Wordの場合:
たとえば、次に示すインストール リンクは、言語として en-US を使用Word Windows のScript Labです。
ms-word:https://api.addins.store.office.com/addinstemplate/en-US/228a829b-69d7-45f4-a338-c6aba330ec7e/WA104380862/none/Script%20Lab,%20a%20Microsoft%20Garage%20project.docx?omexsrctype=1
Windows アプリまたは COM/VSTO アドインのインストールにアドインを含める
Office Web アドインと機能が重複する Windows アプリまたは COM または VSTO アドインがある場合は、Windows アプリまたは COM/VSTO アドインのインストール (またはアップグレード) に Web アドインを含めることを検討してください。 (このインストール オプションは、Excel、PowerPoint、Word アドインでのみサポートされます)。これを行うプロセスは、認定された Microsoft 365 開発者かどうかによって異なります。 詳細については、「 Microsoft 365 アプリ コンプライアンス プログラム 」と 「Microsoft 365 アプリ コンプライアンス プログラムの概要」を参照してください。
基本的な手順は次のとおりです。
認定プログラムに参加する (推奨)
開発者認定プログラムに参加することをお勧めします。 特に、これにより、インストール プログラムをよりスムーズに実行できます。 詳細については、次の記事を参照してください。
- Microsoft 365、Teams、SaaS、および SharePoint アプリのパートナー センターの概要
- Microsoft 365 アプリ コンプライアンス プログラム
- Microsoft 365 アプリ コンプライアンス プログラムの概要
- Microsoft 365 認定のサンプル証拠ガイドの概要
インストール実行可能ファイルを更新する (必須)
インストール実行可能ファイルを更新する手順を次に示します。
- ユーザーの Office バージョンがアドインをサポートしていることを確認する (推奨)
- AppSource の無効化を確認する (推奨)
- アドインのレジストリ キーを作成する (必須)
- 条件 & 条件にプライバシー条項を含める (認定開発者に必要)
ユーザーの Office バージョンが Web アドインをサポートしていることを確認する (推奨)
インストールチェック、ユーザーに Office アプリケーション (Excel、PowerPoint、またはWord) がインストールされているかどうか、および Office アプリケーションが Windows アプリケーションのインストールに Web アドインを含むサポートするビルドであるかどうかを示します。 Web アドインをサポートしていない古いバージョンの場合、インストール プログラムは残りの手順をすべてスキップする必要があります。 Web アドインを利用できるように、最新バージョンの Microsoft 365 をインストールまたは更新することを推奨するメッセージをユーザーに表示することを検討してください。 インストールまたはアップグレード後にインストールを再実行する必要があります。
必要な正確なコードは、インストール フレームワークと使用しているプログラミング言語によって異なります。 C# を使用してチェックする方法の例を次に示します。
using Microsoft.Win32;
using System;
namespace SampleProject
{
internal class IsBuildSupportedSample
{
/// <summary>
/// This function checks if the build of the Office application supports web add-ins.
/// </summary>
/// <returns> Returns true if the supported build is installed, and false if an old, unsupported build is installed or if the app is not installed at all.</returns>
private bool IsBuildSupported()
{
RegistryKey hklm = Registry.CurrentUser;
string basePath = @"Software\Microsoft\Office";
RegistryKey baseKey = Registry.CurrentUser.OpenSubKey(basePath);
string wxpName = "Word"; // Can be one of "Word", "Powerpoint", or "Excel".
const string buildNumberStr = "BuildNumber";
const int smallBuildNumber = 18227; // This is the minimum build that supports installation of a web add-in in the installation of a Windows app.
const int supportedBuildMajorNumber = 16; // 16 is the lowest major build of Office applications that supports web add-ins.
if (baseKey != null)
{
Version maxVersion = new Version(supportedBuildMajorNumber, 0); // Initial value for the max supported build version
foreach (string subKeyName in baseKey.GetSubKeyNames())
{
if (Version.TryParse(subKeyName, out Version version))
{
if (version > maxVersion)
{
maxVersion = version;
}
}
}
string maxVersionString = maxVersion.ToString();
// The Office application's build number is under this path.
RegistryKey buildNumberKey = hklm.OpenSubKey(String.Format(@"Software\Microsoft\\Office\{0}\\Common\Experiment\{1}", maxVersionString, wxpName));
if (maxVersion.Major >= supportedBuildMajorNumber && buildNumberKey != null)
{
object buildNumberValue = buildNumberKey.GetValue(buildNumberStr);
if (buildNumberValue != null && Version.TryParse(buildNumberValue.ToString(), out Version version))
{
if (version.Major > supportedBuildMajorNumber || (version.Major == supportedBuildMajorNumber && version.Build >= smallBuildNumber))
{
// Build is supported
return true;
}
else
{
// Office is installed, but the build is not supported.
return false;
}
}
else
{
// There is no build number, which is an abnormal case.
return false;
}
}
else
{
// An old version is installed.
return false;
}
}
else
{
// Office is not installed.
return false;
}
}
}
}
AppSource の無効化を確認する (推奨)
ユーザーの Office アプリケーションで AppSource ストアが無効になっているかどうかをチェックインストールすることをお勧めします。 Microsoft 365 管理者は、ストアを無効にすることがあります。 ストアが無効になっている場合、インストール プログラムは残りの手順をすべてスキップする必要があります。 Web アドインについて管理者に連絡することを推奨するメッセージをユーザーに表示することを検討してください。 ストアが有効になった後、インストールを再実行する必要があります。
ストアの無効化をチェックする方法の例を次に示します。
using Microsoft.Win32;
using System;
namespace SampleProject
{
internal class IsStoreEnabledSample
{
/// <summary>
/// This function checks if the store is enabled.
/// </summary>
/// <returns> Returns true if it store is enabled, false if store is disabled.</returns>
private bool IsStoreEnabled()
{
RegistryKey hklm = Registry.CurrentUser;
string basePath = @"Software\Microsoft\Office";
RegistryKey baseKey = Registry.CurrentUser.OpenSubKey(basePath);
const int supportedBuildMajorNumber = 16;
if (baseKey != null)
{
Version maxVersion = new Version(supportedBuildMajorNumber, 0); // Initial value for the maximum supported build version.
foreach (string subKeyName in baseKey.GetSubKeyNames())
{
if (Version.TryParse(subKeyName, out Version version))
{
if (version > maxVersion)
{
maxVersion = version;
}
}
}
string maxVersionString = maxVersion.ToString();
// The StoreDisabled value is under this registry path.
string antoInstallPath = String.Format(@"Software\Microsoft\Office\{0}\Wef\AutoInstallAddins", maxVersionString);
RegistryKey autoInstallPathKey = Registry.CurrentUser.OpenSubKey(autoInstallPath);
if (autoInstallPathKey != null)
{
object storedisableValue = autoInstallPathKey.GetValue("StoreDisabled");
if (storedisableValue != null)
{
int value = (int)storedisableValue;
if (value == 1)
{
// Store is disabled
return false;
}
else
{
// Store is enabled
return true;
}
}
else
{
// No such key exists since the build does not have the value, so the store is enabled.
return true;
}
}
else
{
// The registry path does not exist, so the store is enabled.
return true;
}
}
else
{
// Office is not installed at all.
return false;
}
}
}
}
アドインのレジストリ キーを作成する (必須)
インストール プログラムに、次の例のようなエントリを Windows レジストリに追加する関数を含めます。
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Wef\AutoInstallAddins\{{OfficeApplication}}\{{add-inName}}]
"AssetIds"="{{assetId}}"
プレースホルダーを次のように置き換えます。
{{OfficeApplication}}
アドインをインストールする必要がある Office アプリケーションの名前を指定します。Word
、Excel
、およびPowerPoint
のみがサポートされます。注:
複数の Office アプリケーションをサポートするようにアドインのマニフェストが構成されている場合は、
{{OfficeApplication}}
をサポートされているアプリケーション のいずれかに 置き換えます。 サポートされているアプリケーションごとに個別のレジストリ エントリを作成しないでください。 アドインは、サポートされているすべての Office アプリケーションに対してインストールされます。{{add-inName}}
アドインの名前。たとえば、ContosoAdd-in
。{{assetId}}
アドインの AppSource アセット ID (WA999999999
など) を使用します。
次に例を示します。
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Wef\AutoInstallAddins\Word\ContosoAdd-in]
"AssetIds"="WA999999999"
正確なコードは、インストール フレームワークとプログラミング言語によって異なります。 C# の例を次に示します。
using Microsoft.Win32;
using System;
namespace SampleProject
{
internal class WriteRegisterKeysSample
{
/// <summary>
/// This function writes information to the registry that will tell Office applications to install the web add-in.
/// </summary>
private void WriteRegisterKeys()
{
RegistryKey hklm = Registry.CurrentUser;
string basePath = @"Software\Microsoft\Office";
RegistryKey baseKey = Registry.CurrentUser.OpenSubKey(basePath);
string wxpName = "Word"; // Can be one of "Word", "Powerpoint", or "Excel".
string assetID = "WA999999999"; // Use the AppSource asset ID of your web add-in.
string appName = "ContosoAddin"; // Pass your own web add-in name.
const int supportedBuildMajorNumber = 16; // Major Office build numbers before 16 do not support web add-ins.
const string assetIdStr = "AssetIDs"; // A registry key to indicate that there is a web add-in to install along with the main app.
if (baseKey != null)
{
Version maxVersion = new Version(supportedBuildMajorNumber, 0); // Initial value for the max supported build version.
foreach (string subKeyName in baseKey.GetSubKeyNames())
{
if (Version.TryParse(subKeyName, out Version version))
{
if (version > maxVersion)
{
maxVersion = version;
}
}
}
string maxVersionString = maxVersion.ToString();
// Create the path under AutoInstalledAddins to write the AssetIDs value.
RegistryKey AddInNameKey = hklm.CreateSubKey(String.Format(@"Software\Microsoft\Office\{0}\Wef\AutoInstallAddins\{1}\{2}", maxVersionString, wxpName, appName));
if (AddInNameKey != null)
{
AddInNameKey.SetValue(assetIdStr, assetID);
}
}
}
}
}
条件 & 条件にプライバシー条項を含める (認定開発者に必要)
認定プログラムのメンバーでない場合は、このセクションをスキップしますが、その 場合は必須です。
インストール プログラム コードにを含め、次の例のようなエントリを Windows レジストリに追加します。
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Wef\AutoInstallAddins\{{OfficeApplication}}\{{add-inName}}]
"HasPrivacyLink"="1"
前のセクションとまったく同じように、 {{OfficeApplication}}
と {{add-inName}}
プレースホルダーを置き換えます。 次に例を示します。
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Wef\AutoInstallAddins\Word\ContosoAdd-in]
"HasPrivacyLink"="1"
これを実装するには、前のセクションのコード サンプルで 2 つの小さな変更を行います。
WriteRegistryKeys
メソッドの上部にあるconst
の一覧に、次の行を追加します。const string hasPrivacyLinkStr = "HasPrivacyLink"; // Indicates that your installer has a privacy link.
行
AddInNameKey.SetValue(assetIdStr, assetID);
のすぐ下に、次の行を追加します。// Set this value if the Privacy Consent has been shown on the main app installation program, this is required for a silent installation of the web add-in. AddInNameKey.SetValue(hasPrivacyLinkStr, 1);
ユーザーのインストール エクスペリエンス
エンド ユーザーがインストール実行可能ファイルを実行する場合、Web アドインのインストールエクスペリエンスは 2 つの要因によって異なります。
- 認定された Microsoft 365 開発者かどうか。
- ユーザーの Microsoft 365 管理者によって行われたセキュリティ設定。
認定を受け、管理者が認定された開発者のすべてのアプリに対して自動承認を有効にしている場合、インストール実行可能ファイルの開始後にユーザーが特別な操作を行う必要なく、Web アドインがインストールされます。 認定されていない場合、または管理者が認定された開発者のすべてのアプリに対して自動承認を付与していない場合、ユーザーは、インストール全体の一部として Web アドインの追加を承認するように求められます。 インストール後、Web アドインは、Office on the web のユーザーと Windows 上の Office で使用できます。
Web アドインのインストールと COM/VSTO アドインを組み合わせる場合は、2 つの間の関係を考慮する必要があります。 詳細については、「 Office アドインを既存の COM アドインと互換性のあるものにする」を参照してください。
関連コンテンツ
Office Add-ins