Announcement

Collapse
No announcement yet.

Can I run an external application from UE4 build?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic Can I run an external application from UE4 build?

    Can I run an external application from UE4 build?

    Hello,

    Because my future project will be a 3D platform for customers with many advanced features, I'd like to give them the possibility to run external applications, for example Notepad or something different that is installed in Operating System. Is it possible to have any connection with other standalone applications from an UE4 build? Or for example run exe or small game from Unity?

  • replied
    Originally posted by amusvitkona View Post

    Hi it works perfectly but ive written it in a C++ Actor script inside the BeginPlay() function. And it opens two windows of my executable. Can you tell me the possible reasons for this? I am very new to Unreal.
    Do this inside a "virtual void Init() override;" of a custom GameInstance class, the engine will never run Init() more than once.

    Leave a comment:


  • replied
    Originally posted by MaxL View Post
    I have zero experience with this, but FPlatformProcess::CreateProc might be what you're looking for.

    Edit:

    FPlatformProcess::CreateProc(TEXT("C:\\Users\\Cero\\Desktop\\Test.exe"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);

    Used that in my code and it worked as expected. Would be nice to have an overload that only required the first parameter, but I'm really happy that it worked so intuitively.

    It seems that FPlatformProcess is for Windows only. There's also FGenericPlatformProcess that works for other platforms, but uses untested code.
    Hi it works perfectly but ive written it in a C++ Actor script inside the BeginPlay() function. And it opens two windows of my executable. Can you tell me the possible reasons for this? I am very new to Unreal.
    Last edited by amusvitkona; 11-17-2017, 08:00 AM.

    Leave a comment:


  • replied
    Somehow I fix that "seamless" problem.


    I just try to communicate between builds. I use StringToFile.

    Really waiting for opinion about that. Maybe it was very stupid? It solves problem now, but maybe it is better way to do communication between builds.

    Leave a comment:


  • replied
    Hello everybody.

    How to run external application from UE4 build "seamless"?
    I mean, I want from one UE4 build run another UE4 build, without seeing, how first build quits and another build opens.

    What I use so far.

    FGenericPlatformProcess::CreateProc. But with that, there is a gap between first and another builds.

    delay node. But still, there is a gab. And also, that "another build", is a lot different builds, so it loads in different time.

    put loading screen in "another build" start. That gives smaller "gap". I create empty map, with just loading screen, with opens level.

    Leave a comment:


  • replied
    Originally posted by cgiteach View Post
    Hi Cultrarius, do you know a similar approach for Android?
    Well Android is a bit different in that you do not usually want to directly run some executable. As far as I know, the contract for Android Apps is that they run as a single process. You cannot spawn a new process without breaking that contract. Right now it may run fine on your device, but any update or different OS flavor might cause bugs and crashes.

    Use threads and otherwise the native Android functions like intents, activities and whatnot. Have a look at the NDK for more info: https://developer.android.com/ndk/index.html

    Leave a comment:


  • replied
    Originally posted by Cultrarius View Post
    Why not just use native C++ functionality?
    See for example: http://www.cplusplus.com/reference/cstdlib/system/

    Also, you can use platform specific functions which allow for more control, for example with Windows:

    Code:
    #include <iostream>
    #include <windows.h>
    
    int main() {
        ShellExecute(NULL, "open", "path\\to\\file.exe", NULL, NULL, SW_SHOWDEFAULT);
    }
    Hi Cultrarius, do you know a similar approach for Android?
    Last edited by cgiteach; 01-31-2017, 06:40 AM.

    Leave a comment:


  • replied
    Originally posted by Eden91 View Post
    Did anyone make any progress with this?

    I will really like to know how can I start a dowload from web browser or open a program though a link press in ue4 webrowser widget
    Why not just use native C++ functionality?
    See for example: http://www.cplusplus.com/reference/cstdlib/system/

    Also, you can use platform specific functions which allow for more control, for example with Windows:

    Code:
    #include <iostream>
    #include <windows.h>
    
    int main() {
        ShellExecute(NULL, "open", "path\\to\\file.exe", NULL, NULL, SW_SHOWDEFAULT);
    }

    Leave a comment:


  • replied
    Originally posted by Avelworldcreator View Post
    How on Earth is this related? That article is about running an external program as part of the project build process. The question here is how to execute an external program from a project that is already built.
    The post title is confusing. Build could mean a build ( packaged ) or build process.

    EDIT: Not an excuse for not reading content though.

    Leave a comment:


  • replied
    Originally posted by Syed View Post
    I believe this is highly related:
    Pre/Post build step in UBT
    How on Earth is this related? That article is about running an external program as part of the project build process. The question here is how to execute an external program from a project that is already built.

    Leave a comment:


  • replied
    I believe this is highly related:
    Pre/Post build step in UBT

    Leave a comment:


  • replied
    This is exactly what I am looking to do as well. I want to be able to open a program inside of Unreal of 360 images that I have created.

    Leave a comment:


  • replied
    Did anyone make any progress with this?

    I will really like to know how can I start a dowload from web browser or open a program though a link press in ue4 webrowser widget

    Leave a comment:


  • replied
    Originally posted by giovannibruni View Post
    hi! Have you find the way to Running an external .exe from UE4?
    I really need to open Kolor Eyes 360 player when my VR experience end.
    Kolor eyes have line command so I'm able to create a .bat
    Hope it's possible.
    Thank you so much

    giovanni bruni
    Did you get this working...until Unreal can render 360 Videos....need an alternative !!!

    (On a side issue does Kolor Eyes work with the CV1 Oculus ?)

    Leave a comment:


  • replied
    No, I haven't tested this solution yet. However, I will need running an external .exe from UE4 in the future. Hopefully it's possible.

    Leave a comment:

Working...
X