4

How to pin your apps to the Windows 10 Start menu (big right icons) and taskbar alongside the live tiles using WiX?

I was looking the manual but is for V3. WiX Toolset v4.x reference manual is coming soon. at: http://wixtoolset.org/documentation/

I wish to give the user the option to Pin the icon app in the installation process. I'm able to make a normal installation on all windows platforms but not able to include the app (big button icon on the right). Is that possible using WiX?

Alan Mattano
  • 860
  • 3
  • 14
  • 22

2 Answers2

6

That's not supported. Per MSDN:

A small set of applications are pinned by default for new installations. Other than these, only the user can pin further applications; programmatic pinning by an application is not permitted.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • 1
    Well that's just annoying... I thought this was what the StartMenuFolder was vs the ProgramMenuFolder lol – Reahreic Feb 10 '21 at 18:32
0

Newly (looks like Microsoft created article in 07/2022), it is possible to create Applications pins programatically, but it might be allowed only to UWP. See MSDN for more details:

You can programmatically pin your own app to the taskbar, just like you can pin your app to the Start menu. And you can check whether your app is currently pinned, and whether the taskbar allows pinning.

However, the WIX installer does not have any support for that at the moment - you might need to create those pins yourself from the application at start-time. You can follow the official sample code from GitHub or this summarized example for C# application:

using System;
using Windows.Foundation.Metadata;
using Windows.UI.Shell;

async void SetPinAsync()
{
    // Check if the Taskbar API is present
    if (ApiInformation.IsTypePresent("Windows.UI.Shell.TaskbarManager") == false)
        return;
    
    // Get the taskbar manager
    var taskbarManager = TaskbarManager.GetDefault();

    // Check if taskbar allows pinning
    // It can be blocked for reasons(no taskbar || blocked by Policy || ...)
    if (taskbarManager?.IsPinningAllowed == false)
        return;

    // Check if the application is currently pinned
    bool isPinned = await taskbarManager.IsCurrentAppPinnedAsync();
    if (isPinned == false)
    {
        // Try to pin application and get result whether it succeeded
        bool didPin = await TaskbarManager.GetDefault().RequestPinCurrentAppAsync();        
    }
}

Tatranskymedved
  • 4,194
  • 3
  • 21
  • 47