Sublime Forum

Cannot make sublime 3 default editor windows 10 (Sept 2018)

#4

you could try uninstalling, downloading the latest ST3 installer and installing from that, I seem to recall that some company info was previously not being set by the installer which caused win 10 to reject it as a default app. Installing from the latest installer should help as it now contains this necessary metadata.

edit: ah, sorry, you said fresh install so probably not going to help

0 Likes

#5

No worries mate appreciate your help.

Thinking it’s a Windows issue and not sublime.

0 Likes

#6

Hi!
I’m on the same situation.
I’ve tried with notepad++ but it couldn’t be setted as default program for .py files.
I hope they fixed it soon.

It’s actually so wierd, because I couldn’t set windows’ notepad as default program to open .md files :thinking:
:cry:

0 Likes

#7

Yup, same problem - running the 3176 version, which is the latest I can find :frowning:

0 Likes

#8

I’ve noticed that my computer doesn’t even recognize Sublime as a downloaded program. Attempted to search for it and I get no results.

Would be nice if staff chimed in and helped, because this is kind of stupid that we can’t make this a default program.

0 Likes

#9

I’ve actually found that this seems to be a Windows-problem, more than a Sublime problem. Or, rather, that later versions of Windows 10 have modified something, that makes Sublime (and other programs) not wanting to replace the default Windows ones.

Previously, when I experienced this issue, I was on Windows 10 1803 (latest before the pulled October update) - for other reasons (although this was part of it), I reinstalled with an older Windows 10 version, the 1709, and this time it worked just fine setting Sublime as the default - via all the different methods (going into Settings and setting it by file-type, right-clicking a file and picking “Open with” and “Always open with this program”, and also right-clicking and going into properties and setting the default program there).

So, it’s definitely something Microsoft did - mind, all of these tests are done with the Sublime Text 3 build 3176.

0 Likes

Can't choose Sublime as default app for .html, .py
#10

I’ve been looking for an iso file to install that w10 version (1709) and I couldn’t find anyone.
Where did you download your one?

0 Likes

#11
0 Likes

#12

Same here, i formatted my work pc and my home pc, install last windows 10 version and both have same problem.

0 Likes

#13

The same problem is happening here. I thought I had screwed up my Windows 10 installation. So all I can do is wait.

1 Like

#14

Facing same issue here with build 3176. This is a new PC.

OS Name Microsoft Windows 10 Home Single Language
Version 10.0.17134 Build 17134

Not sure if its windows trouble or SB3. Tried even tweaking registry as per some old posts but in vain.

0 Likes

#15

The same issue here with ST3176 on Windows 10 Ent. 1803 build 17134.345.

0 Likes

#16

Beep, me too.

0 Likes

#17

Looking around, I found this: https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/cant-change-default-app-after-windows-latest/3847cfd0-585d-4c54-a640-0c7c6fe9bb5e

One reply:

Hi,

The fix for this is to just uninstall the October 9th update (KB4462919) from your computer. I did a system reset and found out it was actually that update that messes up with that. Its a known bug from what I been gathering around the web. I think you should hold off on updating Windows 10 after 1809 is released again because MS is keen on fixing issues with that build. I would suggest you stick with the September 26th update (KB4458469) and it fixes the issue. You can uninstall the update via the Settings > Update & Security > View update history > Uninstall updates > Select KB4462919.

Best of luck,

CT-7221

Gonna try it now, will edit here with results.

Edit (kinda late, life happens): Didn’t work.

0 Likes

#18

You want to get on the build before KB4458469, so build 17134.286. This bug is in 17134.320 and 17134.345.

0 Likes

#19

I am using build 17134.376 of Windows 10:1803 and I am still experiencing this issue.

0 Likes

#20

Is 17134.376 an Insider build? I don’t see it under 1803 here.

0 Likes

#21

I just helped a colleague with a similar issue with Notepad++.

Apparently the latest Windows build is a lot more strict about properly registering applications support for file associations. I brought up a similar issue a while ago here.

Basically, you need to add some registry settings to tell windows that Sumblime can open said files.

I have a sample registry file which adds support for:
.as, .asm, .c, .cc, .cfg, .cpp, .h, .hpp, .ini, .inl, .lua, .nfo, .txt

Before you attempt to run the file, I highly recommend you read through it and understand it. Likewise, you will probably want to add/remove supported types from the script.

Note: If sublime is not installed to C:\Program Files\Sublime Text\sublime_text.exe, you will need to modify the script
Run at your own risk: Bind Sublime File Associations.

1 Like

#22

Thanks! So this should be fixable with a Sublime update? This should probably also be mentioned in the microsoft thread linked above.

Care to explain what each line does? I see the 5 repeating ones for each extension:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt]
@="Text File"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\DefaultIcon]
@="\"%SystemRoot%\\system32\\imageres.dll\",-102"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell]
@="Open"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell\Open]
@="Edit"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell\Open\command]
@="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\" \"%1\""

And this bit at the bottom:

[HKEY_LOCAL_MACHINE\SOFTWARE\Sublime\SublimeText\Capabilites]
"ApplicationDescription"="Sublime Text 3 - Text editor of the future!"
"ApplicationName"="Sublime Text 3"
"ApplicationIcon"="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\",0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Sublime\SublimeText\Capabilites\FileAssociations]
".as"="SublimeText.as"
...
".txt"="SublimeText.txt"

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Sublime Text 3"="Software\\Sublime\\SublimeText\\Capabilites"

I just think it’d be really difficult/time-consuming for me to look this up to understand it but really easy for you to explain.

And specifically, what does that DefaultIcon look like?

Edit: Can confirm this script solved it on my PC. Had to find and replace C:\\Program Files\\Sublime Text\\ to C:\\Program Files\\Sublime Text 3\\, after which it worked.

By the way, for whoever wants to know, icons look like this:

It’s probably be better/nicer to use the Sublime icon, "C:\Program Files\Sublime Text 3\sublime_text.exe",0

0 Likes

#23

For each file type, you can define a type handler:

; Create a new file type handler class and give it a description
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt]
@="Text File"

; Define the Icon to use for the file
; Note: This is optional. If not defined, the program icon will be used
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\DefaultIcon]
@="\"%SystemRoot%\\system32\\imageres.dll\",-102"

; Define the default shell action (what to trigger when double clicked)
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell]
@="Open" 

; Declare the default action defined above (Open) and assign some text to the command
; Note: The text below (Edit) will be shown at the top of the right click menu for that type
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell\Open]
@="Edit"

; Define the command for the "Open" action
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SublimeText.txt\shell\Open\command]
@="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\" \"%1\""

Technically, if you don’t care about the file description or assigning custom icons to each file type, you can really just declare one file type handler. You should just need to replace “SublimeText.txt” with something like “SublimeTextDoc” and assign default values for everything.

The second section defines basic display information for the application:

[HKEY_LOCAL_MACHINE\SOFTWARE\Sublime\SublimeText\Capabilites]
; Give the application a description
; This use to be view-able in the Control Panel, but I think it's no longer shown
"ApplicationDescription"="Sublime Text 3 - Text editor of the future!"

; Give a readable name to the program
; Shown in several places (Open with menu and such)
"ApplicationName"="Sublime Text 3"

; Icon to show for the program, generally next to the name (Open with menu and such)
"ApplicationIcon"="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\",0"

The third section defines the file types the applications supports, and the handler to use:

[HKEY_LOCAL_MACHINE\SOFTWARE\Sublime\SublimeText\Capabilites\FileAssociations]
; Format: <File Type>=<File Handler>
".as"="SublimeText.as"
...
".txt"="SublimeText.txt"

So, if you created a generic “SublimeTextDoc” handler class, and you wanted sublime to open python files, you would add something like:

".py"="SublimeTextDoc"

Similarly, if you create a specific handler with a custom icon, you would replace SublimeTextDoc with your custom handler (SublimeText.py if you followed my pattern)

The final section tells Windows where you find the program information. This effectively adds Sublime to the “Open With” menu and such.

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Sublime Text 3"="Software\\Sublime\\SublimeText\\Capabilites"

As a side note, the “DefaultIcon” from the sample reg file isn’t what I actually use. I generally use a bunch of icons provided by Visual Studio, which looks like a basic white rect with the extension overlayed. Since everyone doesn’t have VS, I replaced the custom icon with more generic stuff.

3 Likes