在Windows平台上,也可以通过Custom Protocol实现Chrome打开EXE进程,调用CS程序
1、通过注册表,实现单一用户支持Custom Protocol
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol] "URL Protocol"="" @="MyProtocol" [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\DefaultIcon] @="FULL_PATH_TO_MYAPP\\MYAPP.exe.exe, 1" [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell] [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell\Open] [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell\Open\command] @="\"FULL_PATH_TO_MYAPP\\MYAPP.exe\" \"%1\""
2、通过注册表,让全体用户支持Custom Protocol,需要管理员权限
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Classes\MyProtocol] "URL Protocol"="" @="MyProtocol" [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\DefaultIcon] @="FULL_PATH_TO_MYAPP\\MYAPP.exe.exe, 1" [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell] [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell\Open] [HKEY_CURRENT_USER\SOFTWARE\Classes\MyProtocol\Shell\Open\command] @="\"FULL_PATH_TO_MYAPP\\MYAPP.exe\" \"%1\""