Note that there are some explanatory texts on larger screens.

plurals
  1. POIn Linux how to add a build step in Qt Creator that uses su privileges without getting the wrong password attempts on builds?
    primarykey
    data
    text
    <p>My goal is to successfully link a folder to /opt/ directory- which needs to be run with sudo.</p> <p>I have tried this:</p> <pre><code> system(sudo ln -s $$OUT_PWD/xampp /opt/lampp):message("You should manually link LAMPP") </code></pre> <p>But building from qt-creator it does not prompt for sudo password, therefore I couldn't get it to link the folder. I got the "wrong password attempts..." error in the Compiler Output. Then I tried these with build steps:</p> <pre><code>make sudo make install </code></pre> <p>to see if it would prompt me there, but it failed on <code>make install</code> step with the same error, which is this in detail:</p> <pre><code>00:31:20: Starting: "/usr/bin/sudo" make install sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: 3 incorrect password attempts 00:31:20: The process "/usr/bin/sudo" exited with code 1. </code></pre> <p>The <code>system()</code> function in the qmake script works fine when I use <code>qmake &amp;&amp; make &amp;&amp; make install</code> from terminal since it prompts me before <code>sudo ln...</code> command; but for fast testing purposes I feel that building with CTRL-B inside Qt Creator should also work with sudo commands... </p> <p>Is there a way to be prompted from Qt Creator, or a way around this? Like storing the sudo pass within the Qt Creator (although it is risky)... Or maybe making it run build steps on a terminal where it would prompt me? Would <code>prompt()</code> function in qmake work with gathering sudo passwords?</p> <p>Any suggestions are welcome...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload