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. Installing softwares using installers in Qt Application
Forum Update on Monday, May 27th 2025

Installing softwares using installers in Qt Application

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.2k 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.
  • A Offline
    A Offline
    arkenoid
    wrote on 27 Apr 2014, 19:41 last edited by
    #1

    Hii all..

    I want to install some softwares from their .exe installers from the Qt application. For this i simply used this commands..

    First Qprocess Header file is included and the following line is added after the main windows show line.

    @process.start("cmd", QStringList() << "C:\CodeBlocks_setup.exe");@

    But nothing is happening.. It is saying that an instance of CMD is running but no Installation wizard shows up..

    But, if i enter the "C:\CodeBlocks_setup.exe" inside cmd prompt, the installation wizard shows up...

    What is the problem with the Qt API above ?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arkenoid
      wrote on 27 Apr 2014, 19:43 last edited by
      #2

      Even as simple as
      @process.start("cmd", QStringList() << "help");@
      is not showing anything..

      But, this should output the "help" command output in cmd.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MuldeR
        wrote on 27 Apr 2014, 19:54 last edited by
        #3

        Why not run the installer directly?
        @QProcess process;
        process.start("C:\CodeBlocks_setup.exe", QStringList());@

        Anyway, if you want to use the command interpreter, then try:
        @QProcess process;
        QStringList args;
        args << "/c";
        args << "C:\CodeBlocks_setup.exe";
        process.start("cmd.exe", args);@

        __

        See also:
        [quote]C:\Users\MuldeR>cmd /?
        Starts a new instance of the Windows command interpreter

        CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
        [[/S] [/C | /K] string]

        /C Carries out the command specified by string and then terminates[/quote]

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MuldeR
          wrote on 27 Apr 2014, 20:12 last edited by
          #4

          BTW: You may which to use "%COMSPEC%":http://en.wikipedia.org/wiki/ComSpec instead of hardcoding the path to the command interpreter ("cmd.exe"):

          @const wchar_t envComSpec = _wgetenv(L"ComSpec");
          const QString comSpec = QString::fromUtf16(reinterpret_cast<const ushort
          >(envComSpec ? envComSpec : L"cmd.exe"));
          /.../
          process.start(comSpec, args);@

          My OpenSource software at: http://muldersoft.com/

          Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

          Go visit the coop: http://youtu.be/Jay...

          1 Reply Last reply
          0
          • A Offline
            A Offline
            arkenoid
            wrote on 28 Apr 2014, 17:33 last edited by
            #5

            Thanks MuldeR...

            All of the above methods worked.. :D
            I had already tried first method, but i guess i did somewhere wrong..

            I never heard of ComSpec... Thankyou again...

            1 Reply Last reply
            0

            1/5

            27 Apr 2014, 19:41

            • Login

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