Why doesn’t my tile have correct colour?

Updated on 9 May 2018: I was reading this blog entry by Raymond Chen and discovered the topic of this blog entry is something Raymond has already talked about in 2015. It seems that Office is another offender of no-time-travel rule.

Before I recently reinstalled Windows 10 (thanks to its Anniversary Update, which broke Visual Studio), I had custom colours for my Office apps. That has been there since Windows 8.1. But the colours (and the correct layout of the app icons, which should be lifted a bit if app names are displayed) are gone after this clean install of Windows and Office, what could be wrong?

Well, searching on the Internet and digging into documentation never goes wrong. I first found this article telling us that desktop app tiles are customisable since Windows 8.1. Therefore, the colour of a desktop app tile is not computed cleverly by Windows, instead defined by the developer (quite different from the Windows 7 Taskbar hover colour). Office once had its colour correct, what could be wrong? What could be preventing Windows from discovering its colour? Searching how to customize desktop app tile gives this documentation. Now, following the instructions, I verified everything Office Installer did until I meet the following step:

Step 7: Important! Refresh your shortcut file

If your app is already installed, you must nudge your shortcut after the new or updated .VisualElementsManifest.xml is in place or it will be ignored. The following Windows PowerShell command example for the fictional Contoso app is one model for how to accomplish this, although there are many ways that it can be done.

(ls "$env:programdata\microsoft\windows\start menu\programs\contoso.lnk").lastwritetime = get-date

A quick check on shortcut file time and Resources.pri/*.VisualElementsManifest.xml file time revealed that the latter were created and written 3 to 4 minutes after the shortcuts had been created.

Now you know why: Office Installer installs core features of Office apps; after enough features of an app is installed, the shortcut gets created; and the Resources.pri and *.VisualElementsManifest.xml are considered not so important. But why my last install succeeded in colouring? Perhaps I installed it with an offline setup package. Perhaps I pinned the shortcut after an update. Having identified the problem, it is easy to solve it, see Workaround.

Issue

Condition

  • You installed Office 365 with an online installer;
  • You pinned the Office apps to Start before the installation finishes;

Sympotoms

You might not see coloured Office app tiles. Nor are the icons correctly placed. Moreover, Office app tiles will not behave as desired in High Contrast mode.

Workaround

Set the last write date of the Office app shortcuts. You can do this manually or with the following PowerShell script:

#Requires RunAsAdministrator

Set-Location "$env:PROGRAMDATA\Microsoft\Windows\Start Menu\Programs"
Get-ChildItem *2016.lnk | ForEach-Object { $_.LastWriteTime = Get-Date }

Note The script assumes all shortcuts ending in 2016 are Office shortcuts. This may well not be true but it works for, at least, me.

After this, unpin all Office apps from Start and then repin them. You should see correctly coloured Office app tiles with correct behaviour in High Contrast mode.

Solution

Since this is a mistake in Microsoft Office installer, no official solution exists.

For Microsoft, the only solution to this is to install the Resources.pri, the *.VisualElementsManifest.xml and the resources themselves before creating any shortcut. This is okay even for low-speed network since they together are less than 1 MB.

Moral

Do things AS DOCUMENTED. And those who write documentation might as well not follow it.

Exercise See the last paragraph of Solution. Why can’t the installer ‘refresh’ (update the last write time of) the shortcuts after everything is done?

Answer If the user pins the shortcut before the installer finishes, the tile layout fails. The failure will never be fixed unless the user unpins and repins the shortcut since the shortcut, once pinned, is copied.

Please enable JavaScript to view the comments powered by Disqus.