Skip to content

Commit

Permalink
Merge pull request #218 from Microsoft/users/arukhlin/protocol_handler
Browse files Browse the repository at this point in the history
Add missing "URL Protocol" flag to a registry node
  • Loading branch information
AlexRukhlin authored Jun 19, 2017
2 parents d7eec3b + bdbd07a commit 9a62da8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public class ProtocolHandlerWindowsRegistrationCommand extends TFSCommand {
private static final Log log = LogFactory.getLog(ProtocolHandlerWindowsRegistrationCommand.class);

private final static String PROTOCOL_HANDLER_LAUNCHER_PROPERTY = "eclipse.launcher"; //$NON-NLS-1$
private final static String PROTOCOL_HANDLER_REGISTRY_PARENT =
"SOFTWARE\\Classes\\" + ProtocolHandler.PROTOCOL_HANDLER_SCHEME; //$NON-NLS-1$
private final static String PROTOCOL_HANDLER_REGISTRY_KEY =
"SOFTWARE\\Classes\\" + ProtocolHandler.PROTOCOL_HANDLER_SCHEME + "\\Shell\\Open\\Command"; //$NON-NLS-1$ //$NON-NLS-2$
PROTOCOL_HANDLER_REGISTRY_PARENT + "\\Shell\\Open\\Command"; //$NON-NLS-1$
private final static String PROTOCOL_HANDLER_REGISTRY_PATH = "HKCU\\" + PROTOCOL_HANDLER_REGISTRY_KEY; //$NON-NLS-1$
private final static String PROTOCOL_HANDLER_REG_VALUE_TYPE = "REG_EXPAND_SZ"; //$NON-NLS-1$
private final static String PROTOCOL_HANDLER_SCRIPT_PATH = "%USERPROFILE%\\.vsts\\latestIDE.cmd"; //$NON-NLS-1$
Expand Down Expand Up @@ -135,7 +137,9 @@ private File createRegeditFile(final String launcher) throws IOException {
final PrintWriter writer = new PrintWriter(script);
try {
writer.println("Windows Registry Editor Version 5.00"); //$NON-NLS-1$
writer.println(MessageFormat.format("[-HKEY_CURRENT_USER\\{0}]", PROTOCOL_HANDLER_REGISTRY_KEY)); //$NON-NLS-1$
writer.println(MessageFormat.format("[-HKEY_CURRENT_USER\\{0}]", PROTOCOL_HANDLER_REGISTRY_PARENT)); //$NON-NLS-1$
writer.println(MessageFormat.format("[HKEY_CURRENT_USER\\{0}]", PROTOCOL_HANDLER_REGISTRY_PARENT)); //$NON-NLS-1$
writer.print("\"URL Protocol\"=\"\""); //$NON-NLS-1$
writer.println(MessageFormat.format("[HKEY_CURRENT_USER\\{0}]", PROTOCOL_HANDLER_REGISTRY_KEY)); //$NON-NLS-1$
writer.print("@=hex(2):"); //$NON-NLS-1$
writeHexValue(writer, PROTOCOL_HANDLER_REG_VALUE);
Expand Down

0 comments on commit 9a62da8

Please sign in to comment.