Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to get sudo permission on installtion of Qt application on Linux?
Qt 6.12 LTS is out! See what's new in the release blog

how to get sudo permission on installtion of Qt application on Linux?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtinstallerlinuxqt 5.15.2ubuntu 20.04
2 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yash001
    wrote on last edited by
    #1

    I would like to set some custom rule while installing my application on linux platform.

    #!/bin/bash
    
    # Add user to dialout group
    sudo usermod -aG dialout $USER
    
    # Create or update Udev rule for changing the group of HID raw devices
    echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-change-hidraw-group.rules > /dev/null
    
    # Reload Udev rules
    sudo udevadm control --reload-rules
    
    

    how can i execute this custom rule during installtion process. since it is require enter password from user.

    function Controller() {
       
      // Execute the setup_permissions.sh script
        installer.executeDetached("sudo", ["./setup_permissions.sh"]);
    }
    

    I can add this things installtion in script. But I don't know how the user will enter password during installtion.

    or

    Is there any alternative available such that user do not require permission or group for USB and hid devices?

    S 1 Reply Last reply
    0
    • Y Yash001

      I would like to set some custom rule while installing my application on linux platform.

      #!/bin/bash
      
      # Add user to dialout group
      sudo usermod -aG dialout $USER
      
      # Create or update Udev rule for changing the group of HID raw devices
      echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-change-hidraw-group.rules > /dev/null
      
      # Reload Udev rules
      sudo udevadm control --reload-rules
      
      

      how can i execute this custom rule during installtion process. since it is require enter password from user.

      function Controller() {
         
        // Execute the setup_permissions.sh script
          installer.executeDetached("sudo", ["./setup_permissions.sh"]);
      }
      

      I can add this things installtion in script. But I don't know how the user will enter password during installtion.

      or

      Is there any alternative available such that user do not require permission or group for USB and hid devices?

      S Offline
      S Offline
      starkm42
      wrote on last edited by starkm42
      #2

      @Yash001 this is just general advice. on linux, to run commands as part of the installation is usually handled by postinst.src if deb based, or under %dir section (.spec file) if centos based distro, which are part of respective .rpm or .deb files.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved