Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve file types association #348

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

United600
Copy link
Contributor

Add file extension logos and localized names.

App default apps settings

I couldn't reliably add the .ttf extension, sometimes it would refuse to compile. I was pretty sure those restrictions were relaxed but maybe I have the wrong SDK version.

Samples

OpenOTF.mp4
SetAsDefault.mp4
OpenTTC.mp4

@JohnnyWestlake JohnnyWestlake marked this pull request as draft July 12, 2024 15:39
@JohnnyWestlake
Copy link
Collaborator

JohnnyWestlake commented Jul 12, 2024

Unfortunately will probably have to drop this one unless we provide a way to install fonts - the problem is the default Windows Font Viewer is used as the primary way to install fonts on the system and once we remove the default association we remove the default way for people to install fonts - to the point that various software vendors and font distributors used to have support articles recommending users uninstall Character Map UWP entirely so they could get their font installs working (which is why I had to remove them previously). There is a large non-technical user base of the app who use it for design and craft work and getting them workaround to install fonts doesn't really work.

So, basically, unless we provide a font install method ourselves, we can't really do this :') And to do that, we need to be able to write to the real registry. Maybe there's a way to do it now, I haven't tried in a few years.

(Fwiw, .ttf is still in the operating-system reserved file type list - https://learn.microsoft.com/en-us/windows/uwp/launch-resume/reserved-uri-scheme-names#file-types-reserved-for-the-operating-system )

@United600
Copy link
Contributor Author

Unfortunately will probably have to drop this one unless we provide a way to install fonts

Unfortunate indeed. Sorry, didn't knew.
Yeah if I set it as the default app, the Install verb disappears. That's not good.

ContextMenu

I don't think setting desktop2:AllowSilentDefaultTakeOver will make a difference since, even without it, it only takes over the .woff/.woff2 extensions (oh and the .otc).

So, basically, unless we provide a font install method ourselves, we can't really do this :') And to do that, we need to be able to write to the real registry. Maybe there's a way to do it now, I haven't tried in a few years.

AFAIK it is possible, but needs the unvirtualized registry rescap. Personally, I don't like that tradeoff. More info.

(Fwiw, .ttf is still in the operating-system reserved file type list - https://learn.microsoft.com/en-us/windows/uwp/launch-resume/reserved-uri-scheme-names#file-types-reserved-for-the-operating-system )

Yes but, IIRC as of Windows 10 2004, those restrictions were "lifted"/"relaxed".

I can limit the associations to the current ones for now.

@United600
Copy link
Contributor Author

the problem is the default Windows Font Viewer is used as the primary way to install fonts on the system and once we remove the default association we remove the default way for people to install fonts - to the point that various software vendors and font distributors used to have support articles recommending users uninstall Character Map UWP entirely so they could get their font installs working (which is why I had to remove them previously). There is a large non-technical user base of the app who use it for design and craft work and getting them workaround to install fonts doesn't really work.

Although I can see the problem, the ability to "register" the app on the Open with menu is really convenient but, unknowingly, the user can set it as the default app and that will cause the issues that you highlight there. Even though its easily reversible.

Can we add a Button/MenuFlyoutItem to launch the menu so they can reverse or open the Font Viewer to install?

@JohnnyWestlake
Copy link
Collaborator

Can we add a Button/MenuFlyoutItem to launch the menu so they can reverse or open the Font Viewer to install?

The problem is I mostly work on this for people in the design / crafting community who are not very well tech versed and asking them to change their default file association ends up being harder than them uninstalling it, and the support companies for these devices they're using would rather recommend they uninstall it as it's not their problem to deal with.

I'm not personally opposed to the unvirtualized registry rescap, I'll take another look at it. It will only allow install to the current user profile, but it might be good enough.

@JohnnyWestlake
Copy link
Collaborator

JohnnyWestlake commented Jul 13, 2024

On this front, per-user fonts should be registered at HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts, which we could access with the above.

But we would need to copy the files to a file path that would survive the application getting uninstalled. Ideally they would get registered at %USERPROFILE%\AppData\Local\Microsoft\Windows\Fonts, but we can't write there by default. And if we write to our own local storage (or publisher cache), they'll all get deleted on uninstall. So need to find somewhere persistent that we can access.

@United600
Copy link
Contributor Author

United600 commented Jul 13, 2024

AFAIK, per-user install as been the default for some time.

But we would need to copy the files to a file path that would survive the application getting uninstalled. Ideally they would get registered at %USERPROFILE%\AppData\Local\Microsoft\Windows\Fonts, but we can't write there by default. And if we write to our own local storage (or publisher cache), they'll all get deleted on uninstall. So need to find somewhere persistent that we can access.

Just checked on how the Store handles that and it's not an option. Persist uninstall will be hard and would have to place them on a "hidden/hard to find" place to prevent accidental deletion.

Registry

Microsoft 365 doesn't even registers the cloud fonts with the system.

File explorer font cache

@United600 United600 changed the title Improve file associations Improve file types association Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants