Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to embed executable into app
Forum Updated to NodeBB v4.3 + New Features

How to embed executable into app

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ginar44
    wrote on last edited by
    #1

    Hi;
    What's the problem:
    My Qt Quick application runs external *.exe (using QProcess) and communicate with it.
    It works when I put direct path to exec file and compile for desktop.

            const QString EXEC_PATH = "c:/Users/zby/Desktop/quick/testApp/Exec/Gomoku.exe";
            m_pGomokuProcess->start( EXEC_PATH, ARG_LIST_DEFAULT_O );
    

    The problem is when I run app on mobile phone..
    Gomoku.exe is just unavaliable and when process runs thorw a exception: Gomoku process has failed.

    What's I have tried to do:
    Somehow emmbed exec into application while compile.
    a. I added Gomoku.exe to resources (.qrc):
    http://fotoo.pl/show.php?img=1177267_post1-emmbed.jpg.html
    b. I invoked exec like this:

    const QString GomokuExe::EXEC_PATH = ":/Algorithm/Exec/Gomoku.exe";        
            m_pGomokuProcess->start( EXEC_PATH, ARG_LIST_DEFAULT_O );
    

    but got: Gomoku process has failed.

    Is it a way to emmbedd exec into app?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You can't run them from a .qrc file. QProcess uses the platform infrastructure to run the executable/scripts/etc. passed in parameter. These infrastructures just don't know how to go read an executable from qrc. What you can do is copy your executable from the resource to a known folder location on the target.

      One last detail: Gomoku.exe look like a Windows application, don't forget to build it also for the the other platform you are targetting.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • G Offline
        G Offline
        ginar44
        wrote on last edited by
        #3

        Yes, Gomoku.exe - was targetted for my PC windows and was unaware that it won't work on android.
        So what I have to do is:

        • copile Gomoku project with 'Android for armeabi-v7a' - but what would be the output? Binary file or .exe?

        • Even though I would be able to re - targeted my entire Gomoku project to 'Android for armeabi-v7a' (hope it will be easy as I use CMake ) is there an option to put it everything into one bundle (maybe modifying AndroidManifest.xml) and deploy app at one time instead of copying .exe then load application separatly?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Android is a Linux based OS that is usually running on ARM based devices so no you can't run Windows executable on that OS.

          It's a bit more complexe than exec vs binary. I'm not even sure whether your package would pass the PlayStore verification if embedding several executables. In any case, a Qt application on Android is not an exe file.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved