private void onWindows()

in runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPropertiesExtension.java [219:249]


    private void onWindows(final @NotNull Map<String, String> parameters, final ToolProvider toolProvider) {
      try {
        myCommandLineExecutor.runProcess(OurIcaclsCmdLineSetup, 600);
      } catch (ExecutionException e) {
        LOG.warn(ICACLS_TOOL_NAME + " is not supported");
        return;
      }

      final String pathToRunAsPlugin = toolProvider.getPath(RUN_AS_TOOL_NAME);
      final String runAsToolPath = new File("x86", RUN_AS_WIN32_TOOL_NAME).getPath();
      final CommandLineSetup cmdLineSetup = new CommandLineSetup(
        new File(pathToRunAsPlugin, runAsToolPath).getAbsolutePath(),
        Arrays.asList(new CommandLineArgument("-t", CommandLineArgument.Type.PARAMETER)),
        Collections.<CommandLineResource>emptyList());

      try {
        final ExecResult result = myCommandLineExecutor.runProcess(cmdLineSetup, 600);
        if (result != null) {
          LOG.info(RUN_AS_WIN32_TOOL_NAME + " self-test exit code: " + result.getExitCode());
          final int bitness = result.getExitCode();
          if (bitness == 32 || bitness == 64) {
            myIsRunAsEnabled = true;
            parameters.put(Constants.RUN_AS_ENABLED, Boolean.toString(true));
          } else {
            LOG.warn("Invalid " + RUN_AS_WIN32_TOOL_NAME + " exit code: " + bitness);
          }
        }
      } catch (ExecutionException e) {
        LOG.warn(RUN_AS_WIN32_TOOL_NAME + " is not supported");
      }
    }