Results 1 to 2 of 2

Thread: Change Installed File Permissions

  1. #1
    Join Date
    May 2017
    Posts
    14
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Change Installed File Permissions

    Is there a way to alter file permissions on files that you've installed via the QT IFW? I've attempted using the installscript.qs to accomplish this, but have failed in every way. I can successfully use the "CreateShortcut" operation, but the "Execute" is giving me all sorts of trouble.

    Attempt #1:
    Qt Code:
    1. component.addElevatedOperation("Execute", "ICACLS", "\"@TargetDir@\\libDat.dll\"", "/grant", "\"Users\":F", ">nul 2>&1");
    To copy to clipboard, switch view to plain text mode 
    Result:
    Error during installation: Execution failed(Unexpected exit code: 87)


    Attempt #2:
    Qt Code:
    1. component.addElevatedOperation("Execute", "cmd", "/C", "ICACLS", "\"@TargetDir@\\libDat.dll\"", "/grant", "\"Users\":F");
    To copy to clipboard, switch view to plain text mode 
    Result:
    Error during installation: Execution failed(Unexpected exit code: 87)


    Attempt #3:
    Qt Code:
    1. component.addElevatedOperation("Execute", "cmd /C \"@TargetDir@\\scripts\\permission.bat\"");
    To copy to clipboard, switch view to plain text mode 
    Result:
    Error during installation: Execution failed(Unexpected exit code: 2)


    Attempt #4:
    Qt Code:
    1. component.performOperation("Execute", "cmd /C \"@TargetDir@\\scripts\\permission.bat\"");
    To copy to clipboard, switch view to plain text mode 
    Result:
    No error during install, but permissions are not changed. (If I manually run script, it works fine)


    I looked for some documentation on these exit codes, but found very little information.

    Is what I'm trying to do actually possible? and if not, is there another way to accomplish this via IFW?

    Thanks for any input.

  2. #2
    Join Date
    May 2017
    Posts
    14
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Change Installed File Permissions

    Well I may have found a solution:
    Qt Code:
    1. isntaller.executeDetached("cmd","/C win_perm.bat",installer.value("TargetDir")+"\\scripts\\");
    To copy to clipboard, switch view to plain text mode 

    I wish I could have done it without a batch file, and just implemented the commands straight, but can't quite get it to work. Probably something with quotes or escapes, but just not worth the effort anymore.

Similar Threads

  1. Replies: 1
    Last Post: 18th October 2011, 18:53
  2. Replies: 4
    Last Post: 18th March 2011, 06:17
  3. Replies: 1
    Last Post: 27th September 2008, 21:12
  4. Replies: 3
    Last Post: 11th September 2008, 21:08
  5. Replies: 1
    Last Post: 20th June 2008, 19:43

Tags for this Thread

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.