Search Unity

Launch external .vbs, .exe or .appx

Discussion in 'Windows' started by aswhitehead, May 18, 2017.

  1. aswhitehead

    aswhitehead

    Joined:
    Dec 1, 2016
    Posts:
    4
    I have been searching for days and have found lots of ways to do this in standalone players but not in a Windows Store build. I have played around with the association sample files and can get it to open .txt and other files like that but it will not open .vbs, .exe or other applications that are installed. Does anyone know how to do this?
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
    so in windows store build the Process.start doesn't work?

    Code (CSharp):
    1. Process myProcess = new Process();
    2. myProcess.StartInfo.FileName = fullPath;
    3. myProcess.Start();
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I don't think you're allowed to run external executables today. Microsoft said (at their BUILD conference a week ago) they were working on this for the future, though.
     
  4. aswhitehead

    aswhitehead

    Joined:
    Dec 1, 2016
    Posts:
    4
    Because of the sandboxing the Process.Start does not work. I have seen some workarounds but they involve some heavy use of visual studio and I am not well versed in that.
     
  5. aswhitehead

    aswhitehead

    Joined:
    Dec 1, 2016
    Posts:
    4
    So I found a script that actually sends a 3D model from Unity to the Windows 10 3D Builder app. It actually works really well and is making use of the new TargetApplicationPackageFamilyName. But I am having trouble figuring out where to edit the file to change the app it is opening. I tried changing line 383 to point to a different packagefamilyname but there is something else that is triggering 3D builder because it is still coming up and the other app is not.

    https://github.com/Microsoft/Window.../3DPrintingFromUnity/Assets/Script/Print3D.cs

    Any ideas how I might be able to modify this script to open another appx that is installed on the machine?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Okay let's first figure out what you want to launch. Is the application that you want to launch made by you?