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 GoblinMinion · Jan 13, 2014 at 06:31 PM · permissionsprocessjarexternal files

External .jar and Windows Permissions?

I am part of a programming project building a game that runs a planning AI via an external .jar file. We are using Unity's version of C# as our language within the toolkit itself.

For the sake of simplicity, cleanliness, and user convenience, we are using a piece of code to start the planner AI jar from within the executable when the user initiates a play session.

Within the Windows 7 environment, this only seems to work from less prtected locations like the desktop, or my documents. As soon as we try to install the program to a subdirectory under Program Files, the planner ceases to run when it is called on.

I have tried adding several things to the code to demand administrator priveleges, but this does not seem to fix the problem. We would really like to be able to assure that our end users will be able to run the program regardless of where they choose to install it.

Does anyone have any thoughts as to what the problem might be?

The code I am using to initiate the jar process;

public class bootSceneController : MonoBehaviour {

 //Vars
 public static Process plannerProcess;                    //A Process to hold the Planner jar
 //StreamWriter myStreamWriter;                            //An output stream for sending a 'heartbeat' to the planner
                                                         //This acts as crash protection: the planner will self-terminate if this stream ever becomes == null
 public GameObject planner;
 
 [PrincipalPermission(SecurityAction.Demand, Role = @"BUILTIN\Administrators")] void Awake (){
     
         //Prepare and Activate the ExecutionManager (planner) jar
         //Preparation Code
     if(bootSceneController.plannerProcess == null){
         bootSceneController.plannerProcess = new Process();
         bootSceneController.plannerProcess.StartInfo.UseShellExecute = false;
         bootSceneController.plannerProcess.StartInfo.CreateNoWindow = true;
         bootSceneController.plannerProcess.StartInfo.FileName = "java.exe";
         bootSceneController.plannerProcess.StartInfo.Arguments = "-jar "+Application.dataPath + "/Planner/Planner.jar";
         bootSceneController.plannerProcess.StartInfo.Verb = "runas";
         print (Application.dataPath + "/Planner/Planner.jar");
         bootSceneController.plannerProcess.StartInfo.RedirectStandardInput = true;
         
         //Activation Code
         try{
             bootSceneController.plannerProcess.Start();
             print("Planner Starting.");    
         }catch (System.SystemException e){
             print(e.Message);
         }
             
         ManagePlanner.planner = bootSceneController.plannerProcess;
     }else{
         bootSceneController.plannerProcess = bootSceneController.plannerProcess;
         print("Planner online already.");    
     }
 
     
 }//end of awake
 
 // Update is called once per frame
 void Update () {
     
     //Go to next scene on first update
     Application.LoadLevel( 2 );
 
 }//end of update
 

}//end of class

Comment
Add comment · Show 1
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 tanoshimi · Jan 13, 2014 at 06:34 PM 0
Share

Is the JAR file signed?

0 Replies

· Add your reply
  • Sort: 

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

19 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

Related Questions

How to ask for permissions in Android for communicating with stockfish binary in Unity 0 Answers

"system.componentmodel.win32exception" when trying to run stockfish binary file for android 1 Answer

Android camera permission? 1 Answer

Changing Write Access when game already published 1 Answer

App asking for permissions that are not needed 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