Skip to content
  • 0 Votes
    3 Posts
    814 Views
    A

    Hi,

    I have found something that works but that is not really "clean" in my opinion :

    QString password = "yourRootPassword"; //could be asked with QInputDialog::getText(...) QString cmd = QString("sudo -S kextunload -b %1 > /dev/null").arg(driverName); FILE *pipe = popen(cmd.toStdString().c_str(), "w"); if(pipe != nullptr) { fprintf(pipe, "%s\n", password.toStdString().c_str()); if (ferror(pipe)) { qDebug() << "Failed to write to pipe"; } else { qDebug() << "Written to pipe"; } } else { qDebug() << "Failed to open pipe"; } qDebug() << "Pipe returned : " << pclose(pipe);

    I don't know how to use the Apple method linked by SGaist...

  • 0 Votes
    6 Posts
    3k Views
    mrjjM

    @SebastianS
    well it does call the API directly so its very close.
    I was lazy and just made script to ask and run my exe.
    The AutoIt compiler can make exe from file so no script runtime is needed and its very small.
    But yeah, it should be fairly easy to convert since its fairly normal syntax and uses both API and
    types a c++ version would.