admin管理员组文章数量:1278855
I want to open a desktop application (or a shortcut) from my web page. I understand that this is not a common practice, but I would like to know whether it is possible.
I have tried using Custom URL Protocol Handling via the Windows Registry, but this approach requires user involvement and admin rights (modifying the registry, etc.).
What I Tried (Registry-Based Approach) I followed these steps to register a custom protocol in Windows:
- Press Win + R, type regedit, and press Enter.
- Create a New Protocol Key: HKEY_CLASSES_ROOT\MyApp
- Set the (Default) value to "URL:MyApp Protocol".
- Add a new String value named "URL Protocol" (leave it empty).
- Inside HKEY_CLASSES_ROOT\MyApp, create a subkey: HKEY_CLASSES_ROOT\MyApp\shell\open\command
- Set (Default) to the executable path, e.g.: "C:\Path\To\MyApp.exe" "%1"
This works, but it requires user confirmation and admin access to modify the registry. Also it is windows dependent solution, I am looking for multi OS supported solution.
My Requirement
I want to launch the application directly from my Angular web page without needing users to modify the registry manually. Is there any way to achieve this without admin rights or user involvement?
Any alternative solutions or workarounds would be greatly appreciated!
I want to open a desktop application (or a shortcut) from my web page. I understand that this is not a common practice, but I would like to know whether it is possible.
I have tried using Custom URL Protocol Handling via the Windows Registry, but this approach requires user involvement and admin rights (modifying the registry, etc.).
What I Tried (Registry-Based Approach) I followed these steps to register a custom protocol in Windows:
- Press Win + R, type regedit, and press Enter.
- Create a New Protocol Key: HKEY_CLASSES_ROOT\MyApp
- Set the (Default) value to "URL:MyApp Protocol".
- Add a new String value named "URL Protocol" (leave it empty).
- Inside HKEY_CLASSES_ROOT\MyApp, create a subkey: HKEY_CLASSES_ROOT\MyApp\shell\open\command
- Set (Default) to the executable path, e.g.: "C:\Path\To\MyApp.exe" "%1"
This works, but it requires user confirmation and admin access to modify the registry. Also it is windows dependent solution, I am looking for multi OS supported solution.
My Requirement
I want to launch the application directly from my Angular web page without needing users to modify the registry manually. Is there any way to achieve this without admin rights or user involvement?
Any alternative solutions or workarounds would be greatly appreciated!
Share Improve this question edited Feb 24 at 7:16 tink 15.2k4 gold badges50 silver badges57 bronze badges asked Feb 24 at 6:01 Akiner AlkanAkiner Alkan 6,9184 gold badges40 silver badges78 bronze badges1 Answer
Reset to default 0What app are you trying to launch? Standard / consistent path?
Security is your biggest limitation (ruined from days of ActiveX, Java). Anything you invoke, from my experience, will prompt the user in modern browsers. Plus you will need a fallback mechanism given the many pitfalls out of your control (different browsers, security).
Alternatives?
- Check out NodeJS child_process?
- Have you considered a browser extension? Have users install CRX/XPI to bridge the gap? You can post an extension to the extension stores and choose if public/hidden.
- Run a small local web server (localhost:9876) to intercept communication with the web app?
- Invoke another known less secure browser?
microsoft-edge:...
to call a local .bat file? eg.onclick="window.open('file:///Folder/Launch-XYZ.bat')"
. FF/Chromium usually view/download the file. - Scraping the bottom of the barrel... Have user download an .hta file (w/ vbscript or JS) or .bat file and
shell.run()
orstart ExampleApp.exe
?
More information required. I'm sure there are many alternatives. Good luck
本文标签: angularHow to Open a Desktop Application from a Browser Without User InvolvementStack Overflow
版权声明:本文标题:angular - How to Open a Desktop Application from a Browser Without User Involvement? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741291062a2370550.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论