You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/publish/publish-office-add-ins-to-appsource.md
+75-21Lines changed: 75 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Publish your Office Add-in to Microsoft AppSource
3
3
description: Learn how to publish your Office Add-in to Microsoft AppSource and install the add-in with a Windows app or COM/VSTO add-in.
4
4
ms.topic: concept-article
5
-
ms.date: 02/24/2025
5
+
ms.date: 06/06/2025
6
6
CustomerIntent: As a developer, I want to publish my Office Add-in to Microsoft AppSource so that customers can deploy and use my new add-in.
7
7
---
8
8
@@ -128,6 +128,15 @@ We recommend that your installation check whether the user has the Office applic
128
128
129
129
The exact code needed depends on the installation framework and the programming language that you are using. The following is an example of how to check using C#.
130
130
131
+
> [!NOTE]
132
+
> The installation can be designed to install the add-in for all users of the computer, if an administrator of the computer is running the installation program. To implement that design, update the code to do the following.
133
+
>
134
+
> - Check if the user is an administrator of the computer.
135
+
> - If the user is an administrator, the code should do one of the following.
136
+
>
137
+
> - If you want to force the add-in to be installed for all users, the code should set the `supportLocalComputer` variable to `true`.
138
+
> - If you want to give the administrator a choice between installing the add-in only for themself or for all users on the computer, the code should present a dialog to the administrator, return the administrator's choice, and set the `supportLocalComputer` variable accordingly.
stringwxpName="Word"; // Can be one of "Word", "Powerpoint", or "Excel".
158
+
boolsupportLocalComputer=false; // True means LOCAL_MACHINE support, false means CURRENT_USER support.
149
159
150
160
151
161
conststringbuildNumberStr="BuildNumber";
152
162
constintsmallBuildNumber=18227; // This is the minimum build that supports installation of a web add-in in the installation of a Windows app.
163
+
if (supportLocalComputer)
164
+
{
165
+
smallBuildNumber=18730; // This is the minimum build that supports installation of a web add-in, for all users of the computer, in the installation of a Windows app.
166
+
}
153
167
constintsupportedBuildMajorNumber=16; // 16 is the lowest major build of Office applications that supports web add-ins.
154
168
155
169
if (baseKey!=null)
@@ -295,11 +309,16 @@ namespace SampleProject
295
309
296
310
##### Create a registry key for the add-in (required)
297
311
298
-
Include in the installation program a function to add an entry like the following example to the Windows Registry.
312
+
Include in the installation program a function to add *one* of the following keys and values to the Windows Registry, depending on whether the add-in is being installed for all users of the computer or only for the user that is running the installation program.
The exact code will depend on your installation framework and programming language. The following is an example in C#.
346
+
The exact code depends on your installation framework and programming language. The following is an example in C#.
323
347
324
-
```csharp
348
+
> [!NOTE]
349
+
> To install the add-in for all users, change this code so that `WriteRegisterKeys` takes a `bool` parameter. The method should set the `supportLocalMachine` variable to the value that is passed: `true` to install for all users, `false` to install for only the current user.
350
+
351
+
```csharp
325
352
usingMicrosoft.Win32;
326
353
usingSystem;
327
354
328
355
namespaceSampleProject
329
356
{
330
-
internalclassWriteRegisterKeysSample
331
-
{
357
+
internalclassWriteRegisterKeysSample
358
+
{
332
359
/// <summary>
333
360
/// This function writes information to the registry that will tell Office applications to install the web add-in.
using (RegistryKeyaddInKey=targetRootKey.CreateSubKey(subKeyPath))
365
401
{
366
-
AddInNameKey.SetValue(assetIdStr, assetID);
402
+
if (addInKey!=null)
403
+
{
404
+
addInKey.SetValue(assetIdStr, assetID);
405
+
}
406
+
else
407
+
{
408
+
Console.WriteLine("Failed to create or open the registry subkey.");
409
+
}
367
410
}
368
411
}
369
412
}
413
+
370
414
}
371
415
}
372
416
```
@@ -375,18 +419,28 @@ namespace SampleProject
375
419
376
420
Skip this section if you aren't a member of the certification program, but *it is required if you are*.
377
421
378
-
Include in the installation program code to add an entry like the following example to the Windows Registry.
422
+
Include in the installation program code to add *one* of the following keys and values to the Windows Registry, depending on whether the add-in is being installed for all users of the computer or only for the user that is running the installation program.
0 commit comments