Sublime Forum

BUG:After update from ST2 to ST3, can't set ST as default

#1

After having had Sublime Text 2 installed, and then removing it and installing Sublime Text 3, it becomes impossible to set Sublime Text as the default program to open files with, and files previously set to open with sublime text produce an “open with” dialog. Registry hacking is required to resolve this.

I’ve run into this issue on multiple windows 7 systems that I have upgraded to ST3.

To reproduce:

  1. Install Sublime Text 2.
  2. Set one or more file types to be associated with Sublime Text.
  3. Uninstall Sublime Text 2.
  4. Install Sublime Text 3.
  5. Attempt to open one of those filetypes - you will get the Open With… dialog.
  6. Click Browse, and locate the new sublime_text.exe - but sublime text will not be added to the list of programs to open with.

The cause of this issue is that Sublime Text 2 sets the following registry key:
HKEY_CURRENT_USER\Software\Classes\Applications\sublime_text.exe\shell\open\command
to the path to Sublime Text:
“C:\Program Files\Sublime Text 2\sublime_text.exe” “%1”

However, the uninstall process does not remove this, and the installer for sublime text 3 does not correct it.

As a result, when you try to set an executable named “sublime_text.exe” (regardless of where it’s located, as windows indexes these based on the file name, not the file path) as the default program to open a file type with, windows will think it needs to use the above command - which points to a file that doesn’t exist. Windows is smart enough to realize this won’t work, so it doesnt display sublime text in Open With dialog, even if you browse to it - but (apparently) not smart enough to realize that we’re trying to point it to the new location of this file.

We can of course point the finger at windows for this boneheaded behavior, but you’re selling a $70 windows program, you need to work around this like everyone else does. It took me hours to work out how to fix it the first time I ran into it (because all the obvious search terms are too generic). This is really basic stuff - I’ve never seen another app that bungs up file associations this badly.

0 Likes

#2
  1. open regedit.exe
  2. find HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command
  3. right-click (Default) --> Modify
  4. change the directory so it matches the current sublime_text.exe (it is still set with the directory of sublime text 2)
  5. Proceed as usual to make Sublime Text your default program.
0 Likes