Results 1 to 2 of 2

Thread: Qt Installer Framework : Syntax for addElevatedOperation (Windows)

  1. #1
    Join Date
    Mar 2016
    Posts
    22
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qt Installer Framework : Syntax for addElevatedOperation (Windows)

    Hello to everybody,
    I have a problem with installscript.js in Qt Installer Framework.

    I need to create a mysql database using the command:
    mysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS dbbase"
    so I add this line in installscript.js:
    Qt Code:
    1. component.addElevatedOperation("Execute", "cmd","/C","mysql","-uroot","-ppassword", "-e", "\"CREATE DATABASE IF NOT EXISTS dbbase\"");
    To copy to clipboard, switch view to plain text mode 

    if I launch this command from terminal, all works correctly.
    On the other hand, during installation process, I have this error message:

    Error during installation process (mariadb.com): Execution failed(Unexpected exit code: 1):"cmd /C mysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS dbbase""

    In other parts of code the call of "Execute" doesn't cause any problem... perhaps it could be a syntax error "-e", ""CREATE DATABASE IF NOT EXISTS dbbase" ?

    Thanks!

  2. #2
    Join Date
    Mar 2016
    Posts
    22
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Installer Framework : Syntax for addElevatedOperation (Windows)

    I tried to modify the line using an external batch file

    PrepareDB.bat:
    Qt Code:
    1. mysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS dbbase"
    To copy to clipboard, switch view to plain text mode 

    and change it in:
    Qt Code:
    1. var argList = ["/c","@TargetDir@\\PrepareDB.bat"];
    2. component.addElevatedOperation("Execute","cmd",argList);
    To copy to clipboard, switch view to plain text mode 

    but the result is the same...

Similar Threads

  1. Replies: 5
    Last Post: 3rd May 2013, 12:22
  2. Regarding syntax
    By Yayati.Ekbote in forum Qt Programming
    Replies: 3
    Last Post: 27th January 2010, 15:15
  3. Odd Syntax
    By acxdotfm in forum Qt Programming
    Replies: 2
    Last Post: 24th October 2008, 21:23
  4. Windows Migration Framework
    By raman_31181 in forum Qt-based Software
    Replies: 2
    Last Post: 28th September 2008, 22:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.