Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Start application as specific user

    Scheduled Pinned Locked Moved Support
    buildmaster
    4 Posts 2 Posters 29 Views
    Loading More Posts
    • 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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hello all,

      I would like to start an WPF application that has to run in foreground with GUI after deployment under Windows.

      I have tried to achieve it starting it from a *.bat file with "Execute command line" action.
      Example of *.bat content:
      start notepad++.exe
      exit /b
      The application was started in a back-ground and the execution plan was not finishing, it got stuck after the process of the application was started. And BM was logging the stdout of it.
      Then I tried to start the application with "Execute PowerShell Script" action.
      Example:
      Start-Processnotepad++.exe
      The deployment was successful but the process was again in the background because its owner was SYSTEM.

      Then i tried to start it with a different user as follows:

      $username = 'myAdmin'
      $password = 'myPlainTextPassword
      $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
      $credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
      Start-Process Notepad.exe -Credential $credential

      But this time I received an error:
      This command cannot be run due to the error: Access is denied.

      Could you please give me some guidelines on how to start a WPF application with GUI as a foreground process as a part of a deployment plan?

      Best regards,
      Stoyan Kostov

      Product: BuildMaster
      Version: 6.0.6

      1 Reply Last reply Reply Quote 0
      • T Offline
        thoven
        last edited by

        I am not aware of any good way to interact with the GUI while running as a service, at least not since Windows Vista.

        There is "Kiosk Mode", is that what you're looking for?

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Hello Tod,

          Thank you very much for the answer but I don't need "Kiosk Mode".
          What I'm trying to achieve is to start my application using the deployment plan by some kind of command. So later the administrator can interact with it though its GUI. Currently I'm deploying the application to few servers. The goal is not to open the application manually after the deployment. I want the launching of my application to be done by Build Master. The application is written in C#, Windows Presentation Foundation.

          Best regards,
          Stoyan Kostov

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Stoyan -- this is really no way of doing this on Windows. It's simply a limitation of the operation system, and has been for over 10 years. You cannot have something that runs under a service context (BuildMaster and Inedo Agents run as a service) interact with the desktop UI in anyway.

            You cannot "escape" a service context in any way. So from within a service, you can't launch a program that launches a program that launches a program etc., that launches a WPF application.

            You would, instead, need to write a desktop application that monitors "something" (a drop folder, pipe, etc), and then reacts when that that changes.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation