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. [Qt Installer Framework] How to run a shell script after installation is finished?

[Qt Installer Framework] How to run a shell script after installation is finished?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 911 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
    akhi95
    wrote on 11 Jan 2021, 06:54 last edited by
    #1

    Hi. I'm trying to run a shell script after my Linux installer has finished installation.

    In Windows, I had to run a batch script after installation is finished. For that, I had used:

    if (installer.isInstaller() && installer.status = QInstaller.Success) {
        QDesktopServices.openUrl("file:///" + installer.value("TargetDir") + "test.bat");
    }
    

    The above worked in Windows. But doing the same does not work for shell script, i.e., replacing test.bat with my test.sh will simply open the shell script file in gedit instead of executing it. Yes, I have given execution permission to the shell script file.

    Please help me here.

    A 1 Reply Last reply 15 Jan 2021, 09:47
    1
    • A akhi95
      11 Jan 2021, 06:54

      Hi. I'm trying to run a shell script after my Linux installer has finished installation.

      In Windows, I had to run a batch script after installation is finished. For that, I had used:

      if (installer.isInstaller() && installer.status = QInstaller.Success) {
          QDesktopServices.openUrl("file:///" + installer.value("TargetDir") + "test.bat");
      }
      

      The above worked in Windows. But doing the same does not work for shell script, i.e., replacing test.bat with my test.sh will simply open the shell script file in gedit instead of executing it. Yes, I have given execution permission to the shell script file.

      Please help me here.

      A Offline
      A Offline
      akhi95
      wrote on 15 Jan 2021, 09:47 last edited by akhi95
      #2

      @akhi95 Answering myself to help others: moved my code from installationFinished() to installationFinishedPageIsShown() and then used installer.execute to call my .sh

      1 Reply Last reply
      1
      • N Offline
        N Offline
        Nalizhi
        wrote 26 days ago last edited by Nalizhi
        #3

        Thank you for your help.I consider that the point is that executing .sh should be in Component when status of installer is Succcess.

        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