Ylianst / MeshCentralAssistant

Tray icon tool for the MeshCentral Agent. It displays the state of the agent, you can start and stop the agent and request help.
https://meshcentral.com
Apache License 2.0
36 stars 26 forks source link

Problem capturing UAC windows with MashCentralAssistant #29

Open kevimax opened 2 years ago

kevimax commented 2 years ago

Hello everyone !

Translated by Google from French :D

To begin, thank you for this immense and excellent work.

I installed Meshcentral out of curiosity, now I don't plan on not working with it!!

This is not really an issue, but rather a feature request.

I have browsed github, reddit, it seems to me that my request would be appreciated.

When using the MeshCentral Assistant, there may be problems with administrator access and capturing UAC windows. I recompiled meshassistant by modifying manifest.app with:

That solves the first problem because it requires the user to accept the elevation to start assistance. However, capturing UAC windows still doesn't work and that's a real problem in my situation. you must always ask the user to click "yes", even to install a simple print driver...

Previously I was using a lightweight agent from anydesk, it did this just fine without installation.

Is it possible to add an option to change this behavior ?

Thanks a lot !

Jim-Young commented 2 years ago

Hi Kevimax,

Can you elaborate a bit how you recompiled the manifest.app to make MeshCentral Assistant always open with administrator access?

I have same issue here as lots of my clients are not very computer literate and it's hard to ask them to right click on the MeshCentral Assistant and run as Administrator.

However, if they right click on the MeshCentral Assistant to run as Administrator, I don't need to ask the user to click "yes" again.

kevimax commented 2 years ago

Hi Jim-Young

To do this, you must fork your own GITHUB repository, then modify the manifest.app at the line :

requestedExecutionLevel level="administrator" uiAccess="false"

and compile again.

Personally I used the "action" feature of GITHUB to compile :)

Jim-Young commented 2 years ago

Thanks kevimax,

I can only find "manifest.json" in public folder, I don't see manifest.app for some reason.

kevimax commented 2 years ago

sorry, it's app.manifest

https://github.com/Ylianst/MeshCentralAssistant/blob/master/app.manifest

Jim-Young commented 2 years ago

Thank you kevimax.

I've forked and changed the line to requestedExecutionLevel level="requireAdministrator" uiAccess="false"

But when I went to Action, I don't have any workflow and I can't find Visual Studio 2015 as Ylianst said he used that.

Sorry I'm not a developer and not quite sure how to use github. Basically I want to try changing those settings in source code and test it.

I'm not sure why Ylianst doesn't set to run as administrator as default like anydesk. When I work with my clients, very often I need administrator permission to do something in Device Manager or other uninstall&install, but it's hard to ask the clients to do something they don't understand.

kevimax commented 2 years ago

I would also have greatly appreciated an operation like anydesk..

To compile with action, you must add a folder "/.github/workflows/" in the repository of your fork with inside a file named "dotnet-desktop.yml" which contains:


name: .NET Core Desktop

on: workflow_dispatch

jobs:

build:

strategy:
  matrix:
    configuration: [Release]

runs-on: windows-latest 

env:
  Solution_Name: MeshCentralAssistant.sln
steps:
- name: Checkout
  uses: actions/checkout@v3
  with:
    fetch-depth: 0

- name: Install .NET Core
  uses: actions/setup-dotnet@v2
  with:
    dotnet-version: 5.0.x

- name: Setup MSBuild.exe
  uses: microsoft/setup-msbuild@v1.0.2

- name: Execute unit tests
  run: dotnet test

- name: Restore the application
  run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
  env:
    Configuration: ${{ matrix.configuration }}

- name: Create the app package
  run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
  env:
    Appx_Bundle: Always
    Appx_Bundle_Platforms: x86|x64
    Appx_Package_Build_Mode: StoreUpload
    Configuration: ${{ matrix.configuration }}

- name: Upload build artifacts
  uses: actions/upload-artifact@v3
  with:
    name: MSIX Package
    path: ./obj/
Jim-Young commented 2 years ago

Capture

I tried the dotnet-desktop.yml workflow, apparently, it ended up with error where 47 line is nothing there. Then I tried to remove that empty line, the error message says 46 line

Jim-Young commented 2 years ago

Now, I start different approach that whenever I need administrator permission I just download an agent to client's computer and when you connect the agent it pops up UAC, then user only needs to say YES once.