Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Qt Installer Framework] How to give multiple parameters in component.addOperation("Execute"...);



  • Hi, I need to execute echo "hello" > /etc/temp.txt. For that there is "Execute" operation at https://doc.qt.io/qtinstallerframework/operations.html

    The syntax for multiple parameters is given but I'm not able to decode it. I have tried a few things but nothing worked. Can someone decode it for me?



  • @akhi95
    Since you are using redirection (>), I would suggest you may well need to run this via the shell (unless their Execute already does this). So, looking at the syntax, something like:

    component.addOperation("Execute", "/bin/sh", "-c", "echo \"hello\" > /etc/temp.txt", ...)
    


  • @akhi95
    Since you are using redirection (>), I would suggest you may well need to run this via the shell (unless their Execute already does this). So, looking at the syntax, something like:

    component.addOperation("Execute", "/bin/sh", "-c", "echo \"hello\" > /etc/temp.txt", ...)
    


  • @JonB Thank you for your reply. Sorry, I didn't get the notifications. Eventually I made a shell script to achieve my goal. So I didn't get to try your answer but I think it should work


Log in to reply