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. Exe doesn't run correctly when executed with QProcess::start
Qt 6.11 is out! See what's new in the release blog

Exe doesn't run correctly when executed with QProcess::start

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 5 Posters 2.5k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    What does it output ?

    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
    0
    • I Offline
      I Offline
      incantation
      wrote on last edited by
      #5

      The outpus is as follows:

      Board Name: CSE161G4 (The boardname is acquired by one of the functions defined in the include folder)

      Cannot find Stream2Disk.ini - using default parameters. (The .ini file is searched by the configuration function inside CsAppSupport.h, the next 3 lines are connected to the .ini file)

      No ini entry for Stm configuration. Using defaults.
      Selecting Expert Stream from image 1.

      Failed to create the directory

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #6

        Hi, just guessing, but try removing that extra space before "...\ Gage", like this:

        env.insert("GageDir", "C:\\Program Files (x86)\\Gage\\Compuscope\\");
        
        1 Reply Last reply
        1
        • I Offline
          I Offline
          incantation
          wrote on last edited by
          #7

          Sorry about that, that was a mistake typing it out, there's no space in the code. I'll edit that now

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #8

            Have you tried copying the Stream2Disk.ini file to the same directory as the program (GageStream2Disk.exe)?

            1 Reply Last reply
            0
            • I Offline
              I Offline
              incantation
              wrote on last edited by
              #9

              It is there, there is no issue with the .ini file when executing the .exe not from the gui.

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #10

                Ok. Maybe you need to do a cd (change directory) to where the .exe file and the .ini file are.

                1 Reply Last reply
                1
                • I Offline
                  I Offline
                  incantation
                  wrote on last edited by
                  #11

                  Don't think that is a problem since the path is specified correctly in the program variable.

                  jsulmJ 1 Reply Last reply
                  0
                  • Kent-DorfmanK Offline
                    Kent-DorfmanK Offline
                    Kent-Dorfman
                    wrote on last edited by Kent-Dorfman
                    #12

                    Just for giggles, create a dos batch file with your command in it and try to execute the batch file as a QProcess. Try both explicitly using the path to the executable, and by inserting the chdir to where the exe lives.

                    Something is not being set right in your process environment. you may be able to work-around by making sure needed environment variables are set in a batch file.

                    Are all DLL search directories in the PATH? IIRC, windoze searches the PATH for DLLs.

                    The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

                    1 Reply Last reply
                    2
                    • I incantation

                      Don't think that is a problem since the path is specified correctly in the program variable.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      @incantation I would try to set working directory of the process to that where the ini file is located.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      3
                      • I Offline
                        I Offline
                        incantation
                        wrote on last edited by
                        #14

                        @Kent-Dorfman Thanks for the suggestion, but would this approach work if I need to read from and write to the process?
                        All the .dll dependencies are in C:\windows\system32 and I checked both the path variable and the environment of the process and it's present in both

                        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