SonarQube
  1. SonarQube
  2. SONAR-2929

Improve NT scripts to fail with an error message in case UAC is enabled and not ran as administrator

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12
    • Component/s: Wrapper
    • Labels:
      None
    • Environment:
      Windows >= Vista
      Windows Server >= 2008
      both with UAC enabled.
    • Number of attachments :
      0

      Description

      When running the service install/uninstall/start or stop scripts of Sonar on a system with UAC enabled, without running them as administrator, there is a failure without any error message.

      An error message should be displayed to guide the user and have him/her run the script as administrator.

        Issue Links

          Activity

          Hide
          Dinesh Bolkensteyn added a comment -

          Just like Nexus does.

          Show
          Dinesh Bolkensteyn added a comment - Just like Nexus does.
          Hide
          Evgeny Mandrikov added a comment -

          Manually tested on Windows XP and on Windows 7 :

          1. StartSonar.bat as non-admin => OK
          2. StartNTService.bat as admin => message in console:
            wrapper  | The Sonar service is not installed - The specified service does not exist as an installed service. (0x424)
            Press any key to continue . . .
            
          3. InstallNTService.bat as non-admin => message in console:
            wrapper  | OpenSCManager failed - Access is denied. (0x5)
            Press any key to continue . . .
            
          4. InstallNTService.bat as admin => OK
          5. StartNTService.bat as non-admin => message in console:
            wrapper  | OpenSCManager failed - Access is denied. (0x5)
            Press any key to continue . . .
            
          6. StartNTService.bat => OK
          7. UninstallNTService.bat as non-admin => message in console:
            wrapper  | OpenSCManager failed - Access is denied. (0x5)
            Press any key to continue . . .
            
          8. UninstallNTService.bat as admin => OK
          9. UninstallNTService.bat as admin => message in console:
            wrapper  | The Sonar service is not installed - The specified service does not exist as an installed service. (0x424)
            Press any key to continue . . .
            

          Well done Dinesh!

          Show
          Evgeny Mandrikov added a comment - Manually tested on Windows XP and on Windows 7 : StartSonar.bat as non-admin => OK StartNTService.bat as admin => message in console: wrapper | The Sonar service is not installed - The specified service does not exist as an installed service. (0x424) Press any key to continue . . . InstallNTService.bat as non-admin => message in console: wrapper | OpenSCManager failed - Access is denied. (0x5) Press any key to continue . . . InstallNTService.bat as admin => OK StartNTService.bat as non-admin => message in console: wrapper | OpenSCManager failed - Access is denied. (0x5) Press any key to continue . . . StartNTService.bat => OK UninstallNTService.bat as non-admin => message in console: wrapper | OpenSCManager failed - Access is denied. (0x5) Press any key to continue . . . UninstallNTService.bat as admin => OK UninstallNTService.bat as admin => message in console: wrapper | The Sonar service is not installed - The specified service does not exist as an installed service. (0x424) Press any key to continue . . . Well done Dinesh!

            People

            • Assignee:
              Dinesh Bolkensteyn
              Reporter:
              Dinesh Bolkensteyn
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: