Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Run Exe file as an Embedded Resource

Run Exe file as an Embedded Resource

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 3.6k Views
  • 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.
  • R Offline
    R Offline
    RIVOPICO
    wrote on 13 Dec 2016, 15:01 last edited by
    #1

    Hi it's possible with qt run exe file like embedded resource?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 Dec 2016, 15:05 last edited by mrjj
      #2

      Hi
      Only if u save it to a real file first.
      There is no way to execute it as a resource.

      1 Reply Last reply
      1
      • R Offline
        R Offline
        RIVOPICO
        wrote on 13 Dec 2016, 15:35 last edited by RIVOPICO
        #3

        I'm saying like:
        i have one application with qt and i include my other .exe file like resource and run both files. ¿Is possible?

        M 1 Reply Last reply 13 Dec 2016, 15:42
        0
        • R RIVOPICO
          13 Dec 2016, 15:35

          I'm saying like:
          i have one application with qt and i include my other .exe file like resource and run both files. ¿Is possible?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 13 Dec 2016, 15:42 last edited by
          #4

          @RIVOPICO
          only if you save the "other .exe file" to a real file on the filesystem and call QProcess to start it.
          Else no.

          R 1 Reply Last reply 13 Dec 2016, 15:59
          1
          • M mrjj
            13 Dec 2016, 15:42

            @RIVOPICO
            only if you save the "other .exe file" to a real file on the filesystem and call QProcess to start it.
            Else no.

            R Offline
            R Offline
            RIVOPICO
            wrote on 13 Dec 2016, 15:59 last edited by RIVOPICO
            #5

            @mrjj yeah i copy my files in my filesystem. And then run with qprocess but i don know how i can put these executable like resource in my main program and then use in my filesystem like executable. I can put the example i'm trying? or can take me some idea how to embedd exe like resource. thanks.

            M 1 Reply Last reply 13 Dec 2016, 16:07
            0
            • R RIVOPICO
              13 Dec 2016, 15:59

              @mrjj yeah i copy my files in my filesystem. And then run with qprocess but i don know how i can put these executable like resource in my main program and then use in my filesystem like executable. I can put the example i'm trying? or can take me some idea how to embedd exe like resource. thanks.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 13 Dec 2016, 16:07 last edited by mrjj
              #6

              @RIVOPICO
              To include
              http://www.bogotobogo.com/Qt/Qt5_Resource_Files.php

              To use ( pseudo code)

              void ReadExe(QString Filename) {
                QFile mFile(Filename);
              
                if(!mFile.open(QFile::ReadOnly)) {
                  qDebug() << "could not open file for read";
                  return;
                }
              
                QDataStream in(&mFile);
                QByteArray mExe = in.readAll();
                mFile.close();
                // save to file
                // run with QProcess
              }
              
              

              Note is other exe is Qt program also u might get other issues finding the DLLS when running via QProcess.

              R 1 Reply Last reply 13 Dec 2016, 17:09
              0
              • M mrjj
                13 Dec 2016, 16:07

                @RIVOPICO
                To include
                http://www.bogotobogo.com/Qt/Qt5_Resource_Files.php

                To use ( pseudo code)

                void ReadExe(QString Filename) {
                  QFile mFile(Filename);
                
                  if(!mFile.open(QFile::ReadOnly)) {
                    qDebug() << "could not open file for read";
                    return;
                  }
                
                  QDataStream in(&mFile);
                  QByteArray mExe = in.readAll();
                  mFile.close();
                  // save to file
                  // run with QProcess
                }
                
                

                Note is other exe is Qt program also u might get other issues finding the DLLS when running via QProcess.

                R Offline
                R Offline
                RIVOPICO
                wrote on 13 Dec 2016, 17:09 last edited by RIVOPICO
                #7

                @mrjj sorry for all! one last doubt. how i saw in the links, i can read one resource with the path and one function to read.
                But i have one question:
                i could include this resource at the content of my file.
                And for example i can change the icon of one file adding one icon like resource using code.
                Sorry i had doubts about this.

                M 1 Reply Last reply 13 Dec 2016, 19:38
                0
                • R RIVOPICO
                  13 Dec 2016, 17:09

                  @mrjj sorry for all! one last doubt. how i saw in the links, i can read one resource with the path and one function to read.
                  But i have one question:
                  i could include this resource at the content of my file.
                  And for example i can change the icon of one file adding one icon like resource using code.
                  Sorry i had doubts about this.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 13 Dec 2016, 19:38 last edited by
                  #8

                  @RIVOPICO
                  Hi im not sure
                  if ok or you asked something else :)
                  Im not sure what you means with the icons.

                  1 Reply Last reply
                  1
                  • R Offline
                    R Offline
                    RIVOPICO
                    wrote on 13 Dec 2016, 22:23 last edited by
                    #9

                    Thanks sir you are very friendly! thanks again

                    1 Reply Last reply
                    0

                    7/9

                    13 Dec 2016, 17:09

                    • Login

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