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
QtWS25 Last Chance

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.
  • RIVOPICOR Offline
    RIVOPICOR Offline
    RIVOPICO
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      • RIVOPICOR Offline
        RIVOPICOR Offline
        RIVOPICO
        wrote on 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?

        mrjjM 1 Reply Last reply
        0
        • RIVOPICOR RIVOPICO

          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?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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.

          RIVOPICOR 1 Reply Last reply
          1
          • mrjjM mrjj

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

            RIVOPICOR Offline
            RIVOPICOR Offline
            RIVOPICO
            wrote on 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.

            mrjjM 1 Reply Last reply
            0
            • RIVOPICOR RIVOPICO

              @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.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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.

              RIVOPICOR 1 Reply Last reply
              0
              • mrjjM mrjj

                @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.

                RIVOPICOR Offline
                RIVOPICOR Offline
                RIVOPICO
                wrote on 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.

                mrjjM 1 Reply Last reply
                0
                • RIVOPICOR RIVOPICO

                  @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.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 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
                  • RIVOPICOR Offline
                    RIVOPICOR Offline
                    RIVOPICO
                    wrote on last edited by
                    #9

                    Thanks sir you are very friendly! thanks again

                    1 Reply Last reply
                    0

                    • Login

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