WTF is happening with Windows 11? And nothing else


  • Considered Harmful

    @Zerosquare said in WTF is happening with Windows 11? And nothing else:

    Knitting lady intensifies...



  • @Zerosquare said in WTF is happening with Windows 11? And nothing else:

    I tested the latest versions of Firefox, Chrome, Opera, Vivaldi, and Brave, and only Firefox was able to set defaults without sending users to the default apps section of Windows 11. Either way, competitors aren’t impressed with Microsoft’s changes to Windows 11 here.

    enhance

    Firefox was able to set defaults without sending users to the default apps section of Windows 11.

    So it is actually possible for a browser to :doing_it_right:. Not that I'm defending the Windows 11 stupidity, but it sounds like the other browser makers are just whining that they have to do some work



  • @Zecc said in WTF is happening with Windows 11? And nothing else:

    Microsoft is making it harder to want to switch to Windows 11

    When they said "Windows 10 will be the last version", maybe they forgot to finish the sentence 🤔

    "Windows 10 will be the last version you will want"




  • Notification Spam Recipient

    Status: Wait, I found the screen in Windows 10 they're talking about.

    07e91597-fc97-4821-a7b9-7a71f3b0a906-image.png

    I do wonder if Chrome (which says it could do IRC) can actually do it. Alternatively, why Windows thinks Chrome was a candidate for that protocol, but then fails to list it in the list of apps you can select for it. :mlp_crazy:


  • Discourse touched me in a no-no place

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    Wait, I found the screen in Windows 10 they're talking about.

    Yeah but isn't the behaviour in Windows 10 that if you don't select the "Always use this app" checkbox then it'll ask you next time?


  • Notification Spam Recipient

    @loopback0 said in WTF is happening with Windows 11? And nothing else:

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    Wait, I found the screen in Windows 10 they're talking about.

    Yeah but isn't the behaviour in Windows 10 that if you don't select the "Always use this app" checkbox then it'll ask you next time?

    Not to my knowledge. It asks once and once only if there is already an association (i.e. Edge) and a new application has become available. If you don't tick the box, it assumes you didn't really mean it and will return to using the existing association.


  • Discourse touched me in a no-no place

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    It asks once and once only if there is already an association (i.e. Edge) and a new application has become available.

    IME it doesn't ask at all if there's already a default. Which is exactly as it should be.

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    If you don't tick the box, it assumes you didn't really mean it and will return to using the existing association.

    OK but I meant in the scenario that there's not a default already.


  • Notification Spam Recipient

    @loopback0 said in WTF is happening with Windows 11? And nothing else:

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    It asks once and once only if there is already an association (i.e. Edge) and a new application has become available.

    IME it doesn't ask at all if there's already a default. Which is exactly as it should be.

    :mlp_shrug: If I install something that says it can handle things, why not be given the choice? Being asked once and never again is a really high price to pay for flexibility I guess...

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    If you don't tick the box, it assumes you didn't really mean it and will return to using the existing association.

    OK but I meant in the scenario that there's not a default already.

    In other words you mean the scenario which was never brought up, or insinuated, at all, in the entire thread so far? I can't see how I could have possibly misinterpreted your meaning.



  • @hungrier said in WTF is happening with Windows 11? And nothing else:

    Firefox was able to set defaults without sending users to the default apps section of Windows 11.

    So it is actually possible for a browser to :doing_it_right:. Not that I'm defending the Windows 11 stupidity, but it sounds like the other browser makers are just whining that they have to do some work

    You're assuming that Firefox doesn't do this through some horrendous cludge. Like impersonating a superuser logon on a hidden virtual monitor and virtually clicking through the menus. Or something.



  • @Zecc said in WTF is happening with Windows 11? And nothing else:

    Microsoft is making it harder to want to switch to Windows 11

    What makes you think that they'll ask you? It's not like it was really optional last time.

    0be895b0-b3b7-46b0-bdcd-cfbd098c5856-image.png


  • Discourse touched me in a no-no place

    @Tsaukpaetra said in WTF is happening with Windows 11? And nothing else:

    fails to list it in the list of apps you can select for it

    Was it developed by Microsoft or downloaded from the Microsoft Store? No? Then you can't select that here!


  • 🚽 Regular

    You know what I'd like? A little app which isn't a browser and which will instead just popup a text input with the URL that tried to open, so I can then do whatever I want with it, including ignoring it, copying it to the clipboard or letting it open in my browser or some other app.

    I started investigating what the needful was so it would open a program of mine instead of my browser, but at some point I lost track of all the registry keys.


  • Notification Spam Recipient

    @Zecc said in WTF is happening with Windows 11? And nothing else:

    You know what I'd like? A little app which isn't a browser and which will instead just popup a text input with the URL that tried to open, so I can then do whatever I want with it, including ignoring it, copying it to the clipboard or letting it open in my browser or some other app.

    I started investigating what the needful was so it would open a program of mine instead of my browser, but at some point I lost track of all the registry keys.

    I was looking for a shim for Internet Explorer because it literally doesn't exist on Server Core and a program was hardcoded to use an iexplore frame. Sadly, never got far.


  • 🚽 Regular

    @Tsaukpaetra You bring a valid point, although the use case is slightly different.
    I'm not thinking of programs which embed web frames, but programs which ask the system to open a URL.

    Programs which hardcode launching IE deserve to be righteously raged over.



  • At this point, I wonder if it wouldn't be easier and more efficient to replace iexplore.exe with something that launches your preferred web browser, instead of trying to do things the "right way".



  • @acrow said in WTF is happening with Windows 11? And nothing else:

    @hungrier said in WTF is happening with Windows 11? And nothing else:

    Firefox was able to set defaults without sending users to the default apps section of Windows 11.

    So it is actually possible for a browser to :doing_it_right:. Not that I'm defending the Windows 11 stupidity, but it sounds like the other browser makers are just whining that they have to do some work

    You're assuming that Firefox doesn't do this through some horrendous cludge. Like impersonating a superuser logon on a hidden virtual monitor and virtually clicking through the menus. Or something.

    I think it's a reasonable assumption


  • Notification Spam Recipient

    @Zecc said in WTF is happening with Windows 11? And nothing else:

    Programs which hardcode launching IE deserve to be righteously raged over.

    Yes, this one was made by Microsoft (big surprise).



  • @Zecc said in WTF is happening with Windows 11? And nothing else:

    A little app which isn't a browser and which will instead just popup a text input with the URL that tried to open, so I can then do whatever I want with it

    I use "Browser Chooser 2" for this, which is roughly what you describe. You set it to be your "default browser", and then when you click a link it pops up for you to pick what browser you actually want to open the link in (with one option being to just put it into the clipboard).

    It is, however, clearly just something that an engineer threw together in VB.NET and has a by-engineers-for-engineers mentality, where like, you set up the grid of what browsers to present as options by specifying the x- and y-coordinates of where you want that browser to show up. There's not even an installer or anything, it's just a straight .exe to run. It's not the most easy-to-configure, is all I'm saying, but once you do it's awfully convenient. I do think, though, that it's surprising there aren't more or better options out there in this space, especially since I'd think that web developers opening links in different browsers all day is relatively normal use case.


  • Considered Harmful

    @pcooper said in WTF is happening with Windows 11? And nothing else:

    @Zecc said in WTF is happening with Windows 11? And nothing else:

    A little app which isn't a browser and which will instead just popup a text input with the URL that tried to open, so I can then do whatever I want with it

    I use "Browser Chooser 2" for this, which is roughly what you describe. You set it to be your "default browser", and then when you click a link it pops up for you to pick what browser you actually want to open the link in (with one option being to just put it into the clipboard).

    It is, however, clearly just something that an engineer threw together in VB.NET and has a by-engineers-for-engineers mentality, where like, you set up the grid of what browsers to present as options by specifying the x- and y-coordinates of where you want that browser to show up. There's not even an installer or anything, it's just a straight .exe to run. It's not the most easy-to-configure, is all I'm saying, but once you do it's awfully convenient. I do think, though, that it's surprising there aren't more or better options out there in this space, especially since I'd think that web developers opening links in different browsers all day is relatively normal use case.

    IntelliJ decorates hyperlinks with a chooser 🏆


  • 🚽 Regular

    @pcooper Thanks. That seems very useful.

    At the very least, it's open source so I can look for what it does to register itself as the default URL handler. (something around here maybe? Too sleepy and too VB.net)

    I could do the same digging in Firefox's and/or Chromium source code, of course. I probably will at some point.


  • Notification Spam Recipient

    @Zecc said in WTF is happening with Windows 11? And nothing else:

    too VB.net

    Here, courtesy Telerik.com:

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Globalization;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Security;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.VisualBasic;
    using Microsoft.Win32;
    using System.Runtime.InteropServices;
    using System.Security.Permissions;
    using System.Windows.Forms;
    using Browser_Chooser_2.WinAPIs;
    using Browser_Chooser_2.WinAPIExtras;
    using System.Security.AccessControl;
    
    // windows 10 control panel solution from https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/7aa1dedd-7016-4093-a5d2-d2e3658f6414/how-to-start-windows-store-control-panel-from-desktop-app?forum=windowsgeneraldevelopmentissues
    
    public class DefaultBrowser
    {
        private const string mBC2KeyName = @"SOFTWARE\Clients\StartMenuInternet\Browser Chooser 2.exe";
        private const string mCanonical = "Browser Chooser 2.exe";
        private const string mFileAssociations = "BrowserChooser2HTML";
        private const string mURLAssociations = "BrowserChooser2URL";
        private const string mAppName = "Browser Chooser 2";
    
        public enum Scope
        {
            sGlobal,
            sUser
        }
    
        /// Notes: As of Alpha 3, the protocols and file types are dynamic and set by the user. this call will happen more often
        ///     '''  Also, Alpha 3 is the first to not fully support windows XP, this class is impcacted by that change. It will be a best effot.
        ///     '''     Windows 7 User scope uses the XP process, so I guess XP will live a little longer.
        ///     '''
        ///     ''' As of Windows 8, we need to deregister and reregister to get the dialog to pop-up. i think.
        ///     ''' Update Nov 2014: It is more simple than that. We can either show the associations dialog in windows or the open with box. 
        ///     '''
        ///     ''' You can try to figure out what i happening for the Windows 8+ hash, but good luck. Here is what I know so far:
        ///     '''     Uses bcrypt and rsa and the machine guid
    
        private static void CreateApplicationRegistration(RegistryKey aROOT)
        {
            Logger.AddToLog("DefaultBrowser.CreateApplicationRegistration", "Start", aROOT.Name);
            // oftware\Microsoft\Windows\CurrentVersion\App Paths
            RegistryKey lKey = aROOT.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths", RegistryKeyPermissionCheck.ReadWriteSubTree);
            RegistryKey lSubKey = lKey.CreateSubKey(mCanonical, RegistryKeyPermissionCheck.ReadWriteSubTree);
            lSubKey.SetValue("", string.Format(@"{0}\{1}", My.Application.Info.DirectoryPath, mCanonical), RegistryValueKind.String);
            lSubKey.SetValue("Path", My.Application.Info.DirectoryPath, RegistryValueKind.String);
            lSubKey.SetValue("UseUrl", 1, RegistryValueKind.DWord);
            Logger.AddToLog("DefaultBrowser.CreateApplicationRegistration", "End", aROOT.Name);
        }
    
        private static void CreateAssociations(RegistryKey aROOT)
        {
            Logger.AddToLog("DefaultBrowser.CreateAssociations", "Start", aROOT.Name);
            // finaly, end with file accociations
            byte[] lData = new byte[] { 2 };
            var lKey = aROOT.CreateSubKey(mFileAssociations);
            lKey.SetValue("", mCanonical, RegistryValueKind.String);
            lKey.SetValue("FriendlyTypeName", mAppName, RegistryValueKind.String);
            lKey.SetValue("EditFlags", lData, RegistryValueKind.Binary);
            lKey.CreateSubKey("DefaultIcon").SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\",0", RegistryValueKind.String);
            lKey.CreateSubKey(@"shell\open\command").SetValue("", "\"" + Application.ExecutablePath + "\" \"%1\"", RegistryValueKind.String);
    
            // file types
            foreach (FileType lFileType in gSettings.FileTypes)
                aROOT.CreateSubKey(string.Format(@".{0}\OpenWithProgIds", lFileType.Extention)).SetValue(mFileAssociations, RegistryValueKind.String);
    
            // url accociations
            lKey = aROOT.CreateSubKey(mURLAssociations);
            lKey.SetValue("", mCanonical, RegistryValueKind.String);
            lKey.SetValue("FriendlyTypeName", mAppName, RegistryValueKind.String);
            lKey.SetValue("EditFlags", lData, RegistryValueKind.Binary);
            lKey.SetValue("URL Protocol", mCanonical, RegistryValueKind.String);
            lKey.CreateSubKey("DefaultIcon").SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\",0", RegistryValueKind.String);
            lKey.CreateSubKey(@"shell\open\command").SetValue("", "\"" + Application.ExecutablePath + "\" \"%1\"", RegistryValueKind.String);
            Logger.AddToLog("DefaultBrowser.CreateAssociations", "End", aROOT.Name);
        }
    
        private static void CreateCapabilities(RegistryKey aROOT)
        {
            Logger.AddToLog("DefaultBrowser.CreateCapabilities", "Start", aROOT.Name);
            var lKey = aROOT.CreateSubKey(mBC2KeyName, RegistryKeyPermissionCheck.ReadWriteSubTree);
    
            if (Information.IsNothing(lKey) == false)
            {
                // write out our values
                lKey.CreateSubKey("Capabilities").SetValue("ApplicationName", mAppName, RegistryValueKind.String);
                lKey.CreateSubKey("Capabilities").SetValue("ApplicationIcon", Application.ExecutablePath + ",0", RegistryValueKind.String);
                lKey.CreateSubKey("Capabilities").SetValue("ApplicationDescription", "Small application that let's you choose what browser to open with a provided url. https://browserchooser2.com", RegistryValueKind.String);
    
                // file types
                foreach (FileType lFileType in gSettings.FileTypes)
                    lKey.CreateSubKey(@"Capabilities\FileAssociations").SetValue("." + lFileType.Extention, mFileAssociations, RegistryValueKind.String);
    
                lKey.CreateSubKey(@"Capabilities\StartMenu").SetValue("StartMenuInternet", "Browser Chooser 2.exe", RegistryValueKind.String);
    
                // protocols
                foreach (Protocol lProtocol in gSettings.Protocols)
                    lKey.CreateSubKey(@"Capabilities\URLAssociations").SetValue(lProtocol.Header, mURLAssociations, RegistryValueKind.String);
    
                // end with registered applications
                aROOT.CreateSubKey(@"SOFTWARE\RegisteredApplications").SetValue(mAppName, mBC2KeyName + @"\Capabilities", RegistryValueKind.String);
            }
            Logger.AddToLog("DefaultBrowser.CreateCapabilities", "End", aROOT.Name);
        }
    
        public static void CreateSPAD(RegistryKey aROOT)
        {
            Logger.AddToLog("DefaultBrowser.CreateSPAD", "Start", aROOT.Name);
            RegistryKey lSubKey;
    
            // Register the canonical name and Register the Display Name, icon
            RegistryKey lKey = aROOT.CreateSubKey(@"SOFTWARE\Clients\StartMenuInternet\" + mCanonical);
            lKey.SetValue("", mAppName, RegistryValueKind.String);
            lKey.SetValue("LocalizedString", mAppName, RegistryValueKind.String);
    
            lKey.CreateSubKey("DefaultIcon").SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\",0", RegistryValueKind.String);
    
            // Registering an Open Verb
            lKey.CreateSubKey(@"shell\open\command").SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\"", RegistryValueKind.String);
    
            // Registering Installation Information
            lSubKey = lKey.CreateSubKey("InstallInfo");
            lSubKey.SetValue("ReinstallCommand", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\" --reinstall", RegistryValueKind.String); // aka set default
            lSubKey.SetValue("HideIconsCommand", "\"" + Path.Combine(Application.StartupPath, "Browser Chooser 2.exe") + "\" --hideicons", RegistryValueKind.String); // aka unset default, hide from system menu
            lSubKey.SetValue("ShowIconsCommand", "\"" + Path.Combine(Application.StartupPath, "Browser Chooser 2.exe") + "\" --showicons", RegistryValueKind.String); // aka not default, show in system menus
            lSubKey.SetValue("IconsVisible", 1, RegistryValueKind.DWord); // current state - icons shown
            Logger.AddToLog("DefaultBrowser.CreateSPAD", "End", aROOT.Name);
        }
    
        public static void MakeAvailable(DefaultBrowser.Scope aScope) // needs admin - writes to HKLM
        {
            Logger.AddToLog("DefaultBrowser.MakeAvailable", "Start", aScope);
            // note: Part 1: SPAD this is implemented from documentation found at http://msdn.microsoft.com/en-us/library/windows/desktop/cc144109%28v=vs.85%29.aspx
            if (aScope == Scope.sGlobal)
            {
                CreateSPAD(Registry.LocalMachine);
                CreateApplicationRegistration(Registry.LocalMachine);
            }
    
            CreateSPAD(Registry.CurrentUser);
            CreateApplicationRegistration(Registry.CurrentUser);
    
            // PArt 2: now onto default programs. from http://msdn.microsoft.com/en-us/library/windows/desktop/cc144154%28v=vs.85%29.aspx
            if (aScope == Scope.sGlobal)
            {
                CreateCapabilities(Registry.LocalMachine);
                CreateAssociations(Registry.ClassesRoot); // should work witout admin, need to test - it does
            }
    
            CreateCapabilities(Registry.CurrentUser);
            CreateAssociations(Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes", true));
    
            // broadcast change - this will trigger a notification in Win 8+
            SHChangeNotify(SHChangeNotifyEventID.SHCNE_ASSOCCHANGED, SHChangeNotifyFlags.SHCNF_DWORD | SHChangeNotifyFlags.SHCNF_FLUSH, IntPtr.Zero, IntPtr.Zero);
            Logger.AddToLog("DefaultBrowser.MakeAvailable", "End", aScope);
        }
    
        public static DialogResult UpdateUserScope()
        {
            Logger.AddToLog("DefaultBrowser.UpdateUserScope", "Start");
            RegistryKey aROOT = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes\", true);
    
            // no support for XP here. XP code is deprecated and will be removed at some point
            // we need to update our classes root
            bool lNeedsUpdate = false;
            var lKey = aROOT.OpenSubKey(mFileAssociations, true);
            var lKey2 = aROOT.OpenSubKey(mURLAssociations, true);
            var lSubKey = lKey.OpenSubKey(@"shell\open\command", true);
            var lSubKey2 = lKey2.OpenSubKey(@"shell\open\command", true);
            DialogResult lAnswer = DialogResult.No;
            if (lSubKey.GetValue("").ToString() != "\"" + Application.ExecutablePath + "\" \"%1\"" | lSubKey2.GetValue("").ToString() != "\"" + Application.ExecutablePath + "\" \"%1\"")
            {
                lAnswer = MessageBox.Show("BROSWER CHOOSER 2: The registry settings need updating. Do you want to update registry settings?", "BROSWER CHOOSER 2: Update Registry", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                if (lAnswer == DialogResult.Yes)
                {
                    lKey.CreateSubKey(@"shell\open\command").SetValue("", "\"" + Application.ExecutablePath + "\" \"%1\"", RegistryValueKind.String);
                    lKey2.CreateSubKey(@"shell\open\command").SetValue("", "\"" + Application.ExecutablePath + "\" \"%1\"", RegistryValueKind.String);
                }
            }
    
            Logger.AddToLog("DefaultBrowser.UpdateUserScope", "End");
            return lAnswer; // default is no, no update required. 
        }
    
        private static void DoUserScope(RegistryKey aMaster) // includes windows XP
        {
            Logger.AddToLog("DefaultBrowser.DoUserScope", "Start", aMaster.Name);
            // If aScope = Settings.Scope.sGlobal Then
            Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Clients\StartMenuInternet\").DeleteValue("", false);
            // End If
    
            // Windows XP section - raw copy, com call above wont work
            foreach (string lKey in aMaster.CreateSubKey(mBC2KeyName, RegistryKeyPermissionCheck.ReadWriteSubTree).CreateSubKey(@"Capabilities\FileAssociations").GetValueNames())
            {
    
                // put our canoninical name in the default of those in classes root
                if (GeneralUtilities.IsRunningXP == true)
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes\" + lKey, RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", mFileAssociations, RegistryValueKind.String);
                else
                {
                    // windows 7. if user has manully set an association there may be a deny mark on the this key, try to override
                    RegistrySecurity lRegSec = new RegistrySecurity();
                    RegistryKey lRegKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\" + lKey + @"\\UserChoice", RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.ChangePermissions);
                    if (Information.IsNothing(lRegKey) == false)
                    {
                        string lRegUser = Environment.UserDomainName + @"\" + Environment.UserName;
                        RegistryAccessRule lRule = new RegistryAccessRule(lRegUser, RegistryRights.FullControl, AccessControlType.Allow);
    
                        // get access control and modify it
                        lRegSec = lRegKey.GetAccessControl();
                        lRegSec.ResetAccessRule(lRule); // this will leave a duplicate allow rule
                        lRegSec.RemoveAccessRule(lRule); // this will delete it, BOTH are needed to work
                        lRegKey.SetAccessControl(lRegSec);
                        lRegKey.Close();
                    }
    
                    // reopen it with set value permissions
                    lRegKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\" + lKey + @"\\UserChoice", RegistryKeyPermissionCheck.ReadWriteSubTree);
                    lRegKey.SetValue("Progid", mURLAssociations);
                }
            }
    
            // repeat for URLs
            foreach (string lKey in aMaster.CreateSubKey(mBC2KeyName, RegistryKeyPermissionCheck.ReadWriteSubTree).CreateSubKey(@"Capabilities\URLAssociations").GetValueNames())
            {
                if (GeneralUtilities.IsRunningXP == true)
                {
                    // copy our stuff into here - kinds weird XP...
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes\" + lKey + @"\DefaultIcon", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\",0", RegistryValueKind.String);
    
                    // now copy the open command
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes\" + lKey + @"\Shell\open\command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\" \"%1\"", RegistryValueKind.String);
                }
                else
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\" + lKey + @"\UserChoice").SetValue("Progid", mURLAssociations);
            } // and XP ends abrutly like this...
    
            // one extra for Win Vista and 7 
            if (GeneralUtilities.IsRunningXP == false)
                // intentional front slash ---v do not change
                Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\Shell\Associations\MIMEAssociations\text/html\UserChoice").SetValue("Progid", mFileAssociations);// not sure if this will work
    
            // create accosiations in user software classes
            CreateAssociations(Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes\", true));
    
            Logger.AddToLog("DefaultBrowser.DoUserScope", "End", aMaster.Name);
        }
    
        public static void MakeDefault(DefaultBrowser.Scope aScope, bool aForce8 = false, bool aShowMessage = true, string aDoSingle = "", bool abIsProtocol = false)
        {
            Logger.AddToLog("DefaultBrowser.MakeDefault", "Start", aScope, aForce8, aShowMessage, aDoSingle, abIsProtocol);
            if (GeneralUtilities.IsRunningPost8 == false & aForce8 == false)
            {
                // upto windows 7 - default programs / SPAD
                RegistryKey lMaster;
    
                if (aScope == DefaultBrowser.Scope.sGlobal)
                    lMaster = Registry.LocalMachine;
                else
                    lMaster = Registry.CurrentUser;
    
                // apply canonical name to default value - this sets us as default
                lMaster.CreateSubKey(@"SOFTWARE\Clients\StartMenuInternet").SetValue("", mCanonical, RegistryValueKind.String);
    
                // windows XP only 
                if (GeneralUtilities.IsRunningXP == true | aScope == Scope.sUser)
                {
                    if (aDoSingle != "")
                        Debug.Print("FIXME: Add DoSingle for Windows XP and user mode for Windows 7");
                    DoUserScope(lMaster);
                }
                else if (aDoSingle != "")
                {
                    // using a com call here to set the file associations
                    var aa = new WinAPIExtras.ApplicationAssociationRegistration();
                    var iaa = (WinAPIExtras.IApplicationAssociationRegistration)aa;
    
                    if (abIsProtocol == true)
                        iaa.SetAppAsDefault(mAppName, aDoSingle, ASSOCIATIONTYPE.AT_URLPROTOCOL); // seems to only work  only on hklm
                    else
                        iaa.SetAppAsDefault(mAppName, aDoSingle, ASSOCIATIONTYPE.AT_FILEEXTENSION);// seems to only work  only on hklm
                }
                else
                {
                    // using a com call here to set the file associations
                    var aa = new WinAPIExtras.ApplicationAssociationRegistration();
                    var iaa = (WinAPIExtras.IApplicationAssociationRegistration)aa;
                    // If aScope = Scope.sUser Then
                    // Else
                    iaa.SetAppAsDefaultAll(mAppName); // seems to only work  only on hklm
                }
    
                // as per MS docs, broadcast the change
                IntPtr lString = Marshal.StringToCoTaskMemAuto("SOFTWARE/Clients/StartMenuInternet");
                SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, lString, SendMessageTimeoutFlags.SMTO_NORMAL, 100, IntPtr.Zero);
            }
            else if (GeneralUtilities.IsRunningPost10 == true)
            {
                // scan registry keys for immersivecontrolpanel
                RegistryKey lKey = Registry.ClassesRoot.OpenSubKey(@"ActivatableClasses\Package");
    
                foreach (string lItem in lKey.GetSubKeyNames())
                {
                    if (Strings.InStr(lItem, "windows.immersivecontrolpanel") > 0)
                    {
                        // this is the one we want
                        Debug.Print(lItem);
                        string appUserModelId = Microsoft.Win32.Registry.GetValue(string.Format(@"HKEY_CLASSES_ROOT\ActivatableClasses\Package\{0}\Server\microsoft.windows.immersivecontrolpanel", lItem), "AppUserModelId", string.Empty).ToString();
                        Debug.Print(appUserModelId);
                        uint pid;
                        // Dim result As UInteger = 
                        var aa = new ApplicationActivationManager.ApplicationActivationManager();
                        var iaa = (ApplicationActivationManager.IApplicationActivationManager)aa;
                        iaa.ActivateApplication(appUserModelId, "page=SettingsPageAppsDefaults", ApplicationActivationManager.ActivateOptions.None, pid);
                    }
                }
            }
            else
                        // cause the open with dialog to open, if canceled go to advanced dialog
                        if (aDoSingle != "")
            {
                // NOTE THAT THIS SECTION IS NOT WINDOWS XP SAFE, you should never come here on windows XP, but still.
                // NOTE 2: Scope is irrelevent on Windows 8 - it is all user.
                WinAPIs.OPENASINFO lOpenAsInfo = new WinAPIs.OPENASINFO();
                lOpenAsInfo.cszFile = aDoSingle.ToUpper(); // testing
                lOpenAsInfo.cszClass = "";
                if (abIsProtocol == true)
                    lOpenAsInfo.OPEN_AS_INFO_FLAGS = WinAPIs.OPEN_AS_INFO_FLAGS.OAIF_URL_PROTOCOL | WinAPIs.OPEN_AS_INFO_FLAGS.OAIF_FORCE_REGISTRATION | WinAPIs.OPEN_AS_INFO_FLAGS.OAIF_REGISTER_EXT;
                else
                    lOpenAsInfo.OPEN_AS_INFO_FLAGS = WinAPIs.OPEN_AS_INFO_FLAGS.OAIF_FORCE_REGISTRATION | WinAPIs.OPEN_AS_INFO_FLAGS.OAIF_REGISTER_EXT;
                int lResult = WinAPIs.SHOpenWithDialog(IntPtr.Zero, lOpenAsInfo);
            }
            else
            {
                // If lResult = WinAPIs.ERROR_CANCELLED Then
                // show the dialog
                // If aShowMessage = True Then
                // If MessageBox.Show("In order to become the default for any system component, you must use Windows' Set Programs Association screen. In that screen, click on 'Select All' and then Save. Do you want to open this screen?", "Windows 8+ Instructions", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
                // Exit Sub
                // End If
                // End If
    
                frmOptions.TopMost = false;
                var aa = new WinAPIExtras.ApplicationAssociationRegistrationUI();
                var iaa = (WinAPIExtras.IApplicationAssociationRegistrationUI)aa;
                iaa.LaunchAdvancedAssociationUI(mAppName);
            }
    
            Logger.AddToLog("DefaultBrowser.MakeDefault", "End", aScope, aForce8, aShowMessage, aDoSingle, abIsProtocol);
        }
    
        public static void CheckIfIsDefault()
        {
            Logger.AddToLog("DefaultBrowser.CheckIfIsDefault", "Start");
            // using a com call here to set the file associations
            var aa = new WinAPIExtras.ApplicationAssociationRegistration();
            var iaa = (WinAPIExtras.IApplicationAssociationRegistration)aa;
            bool lbIsDefault = false;
    
            try
            {
                if (iaa.QueryAppIsDefaultAll(ASSOCIATIONLEVEL.AL_EFFECTIVE, mAppName, lbIsDefault) == 0)
                {
                    if (lbIsDefault == true)
                    {
                        if (MessageBox.Show("Browser Chooser 2 is no longer the default browser. Do you whish to re-enable?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            GeneralUtilities.LaunchAdminMode(GeneralUtilities.ListOfCommands.MakeDefault);
                    }
                }
            }
            catch (Exception ex)
            {
                // not machine default - maybe user scope - must use XP fall method
                bool lbFound = true;
    
                // for each protocol and filetype
                foreach (var lProtocol in gSettings.Protocols)
                {
                    // copy our stuff into here - kinds weird XP...
                    if (GeneralUtilities.IsRunningXP == true)
                    {
                        RegistryKey lKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes\" + lProtocol.Header, false);
    
                        if (Information.IsNothing(lKey) == true)
                        {
                            lbFound = false;
                            break;
                        }
                        else if (Information.IsNothing(lKey.OpenSubKey("DefaultIcon", false)) == false && lKey.OpenSubKey("DefaultIcon", false).GetValue("").ToString() == "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\",0")
                        {
    
                            // first test passed, second test is a negative (we are looking exclusivly for faillures)
                            if (lKey.OpenSubKey(@"Shell\open\command", false).GetValue("").ToString() != "\"" + Path.Combine(Application.StartupPath, mCanonical) + "\" \"%1\"")
                            {
    
                                // second test failled
                                lbFound = false;
                                break;
                            }
                        }
                        else
                        {
                            // first tast failled
                            lbFound = false;
                            break;
                        }
                    }
                    else
                    {
                        // window 7 user mode detenction
                        RegistryKey lKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\" + lProtocol.Header + @"\UserChoice", false);
    
                        if (Information.IsNothing(lKey) == true)
                        {
                            lbFound = false;
                            break;
                        }
                        else if (Information.IsNothing(lKey.GetValue("Progid")) == false && lKey.GetValue("Progid").ToString() != mURLAssociations)
                            lbFound = false;
                    }
                }
    
                // repeat for each filetype
                if (lbFound == true)
                {
                    foreach (var lFileType in gSettings.FileTypes)
                    {
                        if (GeneralUtilities.IsRunningXP == true)
                        {
                            RegistryKey lKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes\." + lFileType.Extention, false);
    
                            if (Information.IsNothing(lKey) == true)
                            {
                                lbFound = false;
                                break;
                            }
                            else if (Information.IsNothing(lKey.GetValue("")) == false && lKey.GetValue("").ToString() != mFileAssociations)
                            {
    
                                // test failled
                                lbFound = false;
                                break;
                            }
                        }
                        else
                        {
                            RegistryKey lKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\." + lFileType.Extention + @"\UserChoice", false);
    
                            if (Information.IsNothing(lKey) == true)
                            {
                                lbFound = false;
                                break;
                            }
                            else if (Information.IsNothing(lKey.GetValue("Progid")) == false && lKey.GetValue("Progid").ToString() != mURLAssociations)
                            {
    
                                // test failled
                                lbFound = false;
                                break;
                            }
                        }
                    }
                }
    
                if (lbFound == false)
                {
                    // at least one is not default
                    if (MessageBox.Show("Browser Chooser 2 is no longer the default browser. Do you whish to re-enable?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        MakeAvailable(Scope.sUser);
                        MakeDefault(Scope.sUser, aShowMessage: false);
                    }
                }
            }
    
            Logger.AddToLog("DefaultBrowser.CheckIfIsDefault", "End");
        }
    
        public static void RemoveAllKeys(DefaultBrowser.Scope aScope)
        {
            Logger.AddToLog("DefaultBrowser.RemoveAllKeys", "Start", aScope);
            // remove all keys we created undre current scope
            RegistryKey lMaster;
            RegistryKey lClassesRoot;
    
            if (aScope == Scope.sGlobal)
            {
                lMaster = Registry.LocalMachine;
                lClassesRoot = Registry.ClassesRoot;
            }
            else
            {
                lMaster = Registry.CurrentUser;
                lClassesRoot = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes", true);
            }
    
            // application registration: Software\Microsoft\Windows\CurrentVersion\App Paths
            lMaster.DeleteSubKeyTree(string.Format(@"Software\Microsoft\Windows\CurrentVersion\App Paths\{0}", mCanonical));
    
            // associations / capabilities
            lClassesRoot.DeleteSubKeyTree(mFileAssociations);
            lClassesRoot.DeleteSubKeyTree(mURLAssociations);
    
            // SPAD
            lMaster.DeleteSubKeyTree(string.Format(@"SOFTWARE\Clients\StartMenuInternet\{0}", mCanonical));
    
            Logger.AddToLog("DefaultBrowser.RemoveAllKeys", "Start", aScope);
        }
    }
    

    Accuracy and correctness not guaranteed.


  • 🚽 Regular

    @Tsaukpaetra

    I have two main takeaways after skimming through the code.

    #1 - Relevant documentation is here

    and here

    The second link above says

    This topic does not apply for Windows 10. The way that default file associations work changed in Windows 10. For more information, see the section on Changes to how Windows 10 handles default apps in this post.

    and "this post" just says what it looks like from a user's perspective, not a registering program's perspective.

    I did find this as well:

    #2 - it involves more registry shenanigans than I originally thought, though not much, and for Windows 10 using ApplicationActivationManager to start the UI for changing associations.

    I actually don't consider this having to ask the user to confirm the new associations a bad thing; except it seems to be asking for one at a time rather than all in just one go? :eek:

    Again, I'll have to take a better look at this when I'm more awake.


  • Considered Harmful

    @Zecc said in WTF is happening with Windows 11? And nothing else:

    I actually don't consider this having to ask the user to confirm the new associations a bad thing; except it seems to be asking for one at a time rather than all in just one go?

    Has it got a varargs syntax? If it's blocking, the dialog is part of the call, what did you expect?



  • @Zecc said in WTF is happening with Windows 11? And nothing else:

    @Tsaukpaetra

    I have two main takeaways after skimming through the code.

    #1 - Relevant documentation is here

    We should probably make a house rule to always include a one chapter long excerpt from any Microsoft documentation page we link to. That way, we can maybe still Google for them when Microsoft inevitably moves stuff around and breaks the links.

    Hell, maybe somebody has already written a NodeBB add-on for that?


  • Notification Spam Recipient

    @acrow said in WTF is happening with Windows 11? And nothing else:

    we can maybe still Google for them

    Google does love the forums very much...


  • BINNED

    @acrow said in WTF is happening with Windows 11? And nothing else:

    We should probably make a house rule to always include a one chapter long excerpt from any Microsoft documentation page we link to. That way, we can maybe still Google for them when Microsoft inevitably moves stuff around and breaks the links.

    Random thought of the day:
    Maybe MSDN links are in a quantum superposition (of "existing here" and "moved somewhere else") when posted. Waiting for two days or more than one person looking at it acts like a measurement and collapses the state to "the page you're looking for cannot be found."



  • @TimeBandit said in WTF is happening with Windows 11? And nothing else:

    "Windows 10 will be the last version you will want"

    Wrong. I do not want that either.


  • Notification Spam Recipient

    @BernieTheBernie said in WTF is happening with Windows 11? And nothing else:

    @TimeBandit said in WTF is happening with Windows 11? And nothing else:

    "Windows 10 will be the last version you will want"

    Wrong. I do not want that either.

    https://youtu.be/nK5VqPm8uWE




  • Discourse touched me in a no-no place

    @TimeBandit

    Oh well.

    3c118843-ef13-45bd-a61f-44c9598a58db-image.png



  • @loopback0 If the 6xxxx series isn't supported, that sounds like good news for me with my 4xxx processor


  • Considered Harmful

    @hungrier said in WTF is happening with Windows 11? And nothing else:

    that sounds like good news for me

    It does indeed 🍹



  • When I try to download the compatibility checker, it just says "coming soon". I know they removed it after the initial outcry and have broadened the compatibility list; is that a screenshot of an old version?


  • Discourse touched me in a no-no place



  • @loopback0 said in WTF is happening with Windows 11? And nothing else:

    @Benjamin-Hall Nope, downloaded just before the screenshot was taken.

    https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewpchealth

    Hmm. Guess Microsoft's habit of breaking links still applies...well, in this case, not updating the links.

    My 3-year-old Ryzen 5 2600x machine meets the requirements just fine, it seems.


  • Discourse touched me in a no-no place

    @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    Guess Microsoft's habit of breaking links still applies...well, in this case, not updating the links.

    Presumably because the checker is in preview and not generally available.



  • @loopback0 Yeah, the link you posted above lands you on a page that asks you to log in for the Windows Insider program. Didn't go further than that, because :kneeling_warthog:, and I'm not actually sure I ever signed up for anything like that.

    Was a bit curious about the TPM stuff; that's the only thing I don't know off-hand. I've disabled secure boot, though, so that might be a problem.


  • Discourse touched me in a no-no place

    @cvi I'm not signed up either as far as I'm aware, just logging in was enough.



  • @loopback0 said in WTF is happening with Windows 11? And nothing else:

    @cvi I'm not signed up either as far as I'm aware, just logging in was enough.

    Yeah. I'm not signed up (that I know of) but it didn't even ask me to log in (but I do have a cloud user account on that machine).



  • @loopback0

    bd754877-626e-4ab9-a387-0d106e7f7aea-image.png

    Well, I'm not THAT crazy 🍹



  • @loopback0 Apparently this is a deliberate choice:


  • Discourse touched me in a no-no place

    @Grunnen said in WTF is happening with Windows 11? And nothing else:

    Apparently this is a deliberate choice

    Duh.





  • @Grunnen said in WTF is happening with Windows 11? And nothing else:

    @loopback0 Apparently this is a deliberate choice:

    In the onebox:

    your Ryzen 7 or Core i7 get abandoned by Windows 7

    :wtf_owl: pcworld?

    And funny...my Ryzen 5 is supported. And Core i7 doesn't mean much, since that could be a 2nd generation one or a (latest) generation one. Both are "Core i7", but very different in terms of capability.


  • Banned

    @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    And funny...my Ryzen 5 is supported. And Core i7 doesn't mean much, since that could be a 2nd generation one or a (latest) generation one. Both are "Core i7", but very different in terms of capability.

    Funny you make that comment regarding Cores but not Ryzens.



  • @Gąska said in WTF is happening with Windows 11? And nothing else:

    @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    And funny...my Ryzen 5 is supported. And Core i7 doesn't mean much, since that could be a 2nd generation one or a (latest) generation one. Both are "Core i7", but very different in terms of capability.

    Funny you make that comment regarding Cores but not Ryzens.

    I was under the impression (probably a bad one) that Ryzen numbering was sequential (ie Ryzen N XXXX > Ryzen N-1 XXXX.

    If that's mistaken, then I'm not sure what the big deal is--mine was a low/mid-end model from 3+ years ago and it's fully supported. Sure, if you're @Tsaukpaetra and trying to run it on a potato, I can see the issue.


  • Banned

    @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    @Gąska said in WTF is happening with Windows 11? And nothing else:

    @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    And funny...my Ryzen 5 is supported. And Core i7 doesn't mean much, since that could be a 2nd generation one or a (latest) generation one. Both are "Core i7", but very different in terms of capability.

    Funny you make that comment regarding Cores but not Ryzens.

    I was under the impression (probably a bad one) that Ryzen numbering was sequential (ie Ryzen N XXXX > Ryzen N-1 XXXX.

    They use the same numbering scheme as Cores, down to only using 3/5/7/9 at N position.



  • @Benjamin-Hall said in WTF is happening with Windows 11? And nothing else:

    And funny...my Ryzen 5 is supported. And Core i7 doesn't mean much, since that could be a 2nd generation one or a (latest) generation one. Both are "Core i7", but very different in terms of capability.

    Ryzen 3/5/7/etc. is the same branding as Intel's i3/i5/i7/etc. It's the thousands digit(s) of the following number that show(s) the generation.

    Windows 11 wants a Ryzen 2xxx+ or an Intel 8xxx+ processor. It will also accept a very limited range of Intel 7xxx parts. My i7-2600k is right out.

    I'm just surprised that there are that many people upset about it. Stay on Windows 10 for now. It won't kill you.



  • @Parody said in WTF is happening with Windows 11? And nothing else:

    i7-2600k

    Wait...how many aeons ago is that? How big is your :belt_onion:? :trollface:


Log in to reply