• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by liontis · Sep 05, 2017 at 06:51 AM · unity 5webglserverapplicationweb browser

Is there a way to open an unity application (or any .exe file) from a unity browser game?

I want to know if i could connect a unity browser game to an application on the computer, for example to run the file or exchange data between the two. Just so it is clear, imagine you're on a website playing a unity game, then you click (within the game) -"lunch .exe" and it lunches a file (which i want it to be a unity game), then exchange data between the application on the computer and the browser application and vice versa, like win/loss and such. My question: Is there a way to do that within unity or should I create my own server - client protocol outside of unity?

Comment

People who like this

0 Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hellium · Sep 05, 2017 at 07:22 AM 1
Share

Imagine if it would be possible, it would be an extraordinary opportunity for evil intentioned people to do what they want on your computer. Launch softwares you don't want to, etc...

avatar image liontis Hellium · Sep 06, 2017 at 04:46 PM 0
Share

Well it is possible, for example, you lunch the battlefield games through the battle-log website. It is unsafe but chrome as well as other browsers ask you for permission before lunching the .exe.

avatar image maximeb-valtech liontis · Sep 06, 2017 at 05:51 PM 0
Share

I am not sure how Battlefield does it but there are two possibilities.

Either they make you click on a url that has a custom protocol like steam://rungameid/220200 which would lunch Kerbal Space Program through Steam. This method requires to have a program that is registered as opening those URLs in the registry. It has some limitations, the user has to click on the link and there is no communication between both applications beyond the content of the URL. This is probably how Battlefield does it.

The other possibility is to have a NPAPI browser plugin. The problem is that those have become deprecated has they are too much of a security risk. Such plugins run as part of the browser with the same user permissions as the browser does. They can open processes and initiate two way communications between them. It is also then possible to use a window handles' SetParent to have an external application display inside of the browser window, faking being native web.

I have implemented the later method for a previous company in the early 2010s. Although the results were great, there was also a substantial number of users who stopped using it since the browser displays so many warning before installing such a plugin. Now that all major browsers have stopped supporting this technique, there is no point to this anymore.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by maximeb-valtech · Sep 06, 2017 at 12:42 PM

Unity WebGL is a javascript application running inside of a webpage, therefore it is sandboxed. This means that it only has access to resources on its own domain through webrequests or through the PersistentDataPath which is implemented as websql. It cannot run other executable as that would be a security risk.

From what I can understand of what you want to do, I would recommend using a server with a REST API. I find that the easiest technology to use for that is Nodejs with Express web server.

Comment
liontis

People who like this

1 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image liontis · Sep 06, 2017 at 04:38 PM 0
Share

Alright got it, thanks for the help! I will defiantly look that up.

avatar image

Answer by N00MKRAD · Sep 06, 2017 at 07:47 AM

I don't think that's possible.

How would you know the user's path where the exe is?

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image liontis · Sep 06, 2017 at 04:40 PM 0
Share

I know it is possible, although Unity probably does not support that kind of technology.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

144 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

ExternalCall in WebGL not working 0 Answers

How can i run my unity application on linux? and what distributian for linux development? 0 Answers

WebGL set up server to receive messages from android app 0 Answers

Unity Z fighting webgl 0 Answers

WebGl build on Server has load memory error 6 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges