Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by incitement · Jul 07, 2010 at 12:20 AM · external-application

make a button in unity to open an external windows application.

Hello

I want to make a button in some area in my game. when the player find it and press, an external application with exe extension should be run. can i do this with unity. if i can how ??? thanks

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by fherbst · Jul 07, 2010 at 12:34 PM

As addition to SpikeX answer and your comment:

You can use

// Goes in OnGUI():
if(GUI.Button(new Rect(15, 15, 95, 35), "Open my Application"))
{
  // Application.dataPath will return your projects' Data folder path
  System.Diagnostics.Process.Start(Application.dataPath + "/myApplication.exe");
}

You will have to copy your "myApplication.exe" to your Data folder whenever you build your game (or write a postProcess script that does that for you, but that would be probably overpowered).

Comment
Add comment · 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 incitement · Jul 07, 2010 at 06:32 PM 0
Share

Great Thanks to all of you

avatar image
2

Answer by qJake · Jul 07, 2010 at 04:21 AM

It's pretty easy (you can't do this with the web player):

// Goes in OnGUI():
if(GUI.Button(new Rect(15, 15, 95, 35), "Open Notepad"))
{
     System.Diagnostics.Process.Start("notepad.exe");
}
Comment
Add comment · Show 2 · 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 incitement · Jul 07, 2010 at 10:02 AM 0
Share

Thanks but if my have ma application named for exemple appl1.exe and placed in the D:/application/apl1.exe how can i do it and expor it with the build of the game. thanks

avatar image qJake · Jul 07, 2010 at 07:18 PM 0
Share

What felix said. Include it in your data directory and use his code.

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.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

In build - Process cannot find file 1 Answer

[SOLVED] Unable To Import Fonts? Unable to open assets/fonts check external settings 2 Answers

Integrate Unity inside a QT Application 0 Answers

How to launch another program when using or interacting with an object? 1 Answer

Embed and communicate with Unity inside another app 2 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