Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to get sudo permission on installtion of Qt application on Linux?

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 357 Views
  • 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 30 Nov 2023, 22:03 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 1 Dec 2023, 05:56
    0
    • Y Yash001
      30 Nov 2023, 22:03

      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 1 Dec 2023, 05:56 last edited by starkm42 12 Jan 2023, 05:56
      #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

      2/2

      1 Dec 2023, 05:56

      • Login

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