Skip to content

Commit f0292a2

Browse files
committed
Bug 1882413 - Part 1: Re-enable MSIX one-click set to default (no change from backout). r=nalexander,mhughes
Backed out changeset 897f98487b4f Differential Revision: https://phabricator.services.mozilla.com/D203068
1 parent 0b1251d commit f0292a2

File tree

3 files changed

+416
-4
lines changed

3 files changed

+416
-4
lines changed

browser/components/shell/WindowsUserChoice.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,21 @@ UniquePtr<wchar_t[]> GetAssociationKeyPath(const wchar_t* aExt) {
284284
return keyPath;
285285
}
286286

287+
nsresult AppendAssociationKeyPath(const wchar_t* aExt, nsString& output) {
288+
if (aExt[0] == L'.') {
289+
output.AppendLiteral(
290+
u"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\");
291+
} else {
292+
output.AppendLiteral(
293+
u"SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations"
294+
u"\\");
295+
}
296+
297+
output.Append(aExt);
298+
299+
return NS_OK;
300+
}
301+
287302
UniquePtr<wchar_t[]> GenerateUserChoiceHash(const wchar_t* aExt,
288303
const wchar_t* aUserSid,
289304
const wchar_t* aProgId,

browser/components/shell/WindowsUserChoice.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ CheckUserChoiceHashResult CheckUserChoiceHash(const wchar_t* aExt,
6161
*/
6262
mozilla::UniquePtr<wchar_t[]> GetAssociationKeyPath(const wchar_t* aExt);
6363

64+
/*
65+
* Appends the registry path for the given association, file extension or
66+
* protocol to the parameter string.
67+
*
68+
* @return The path, or nullptr on failure.
69+
*/
70+
nsresult AppendAssociationKeyPath(const wchar_t* aExt, nsString& output);
71+
6472
/*
6573
* Get the current user's SID
6674
*

0 commit comments

Comments
 (0)