microsoft / github-actions-for-desktop-apps

This repo contains a sample WPF application to demonstrate how to create CI/CD pipelines using GitHub Actions.
MIT License
353 stars 108 forks source link

Can i use this action to setup an app ? #50

Closed amrsa1 closed 1 year ago

amrsa1 commented 1 year ago

Is it possible to just use the action to install an app.exe in the GH runner so i can peform some automation test ?

LanceMcCarthy commented 1 year ago

Yes, you can download any file (e.g., exe, msi, etc) and run that installer. You use a PowerShell command to run any exe you want.

For example, you can use PowerShell...

Start-Process 'C:\Downloads\My.exe' -ArgumentList "/q" -Wait

Write-Output "My.exe installation complete."

Edit 1- edit reply to give concrete example

amrsa1 commented 1 year ago

@LanceMcCarthy it stuck at this command, seems like the system waiting for some permission to be allowed adding/removing runAs didnt help

2022-11-30_23h08_54
LanceMcCarthy commented 1 year ago

I'm not an expert in using Powershell to start new processes. You'll probably get better assistance in stackexchange's https://superuser.com/

My firth thought is "does that installer require user interaction?" That would explain such behavior, check the evernote.exe launch args documentation to see if there's a way to execute it without user interaction. In my example, I pass the /q flag to the arguments list, but that doesn't mean it knows how to use it.

Here are some screenshots on how I use the approach to install VS extensions (keep in mind is that Visual Studio and VSIX has the built-in capability to run userless via the /q flag).

image

amrsa1 commented 1 year ago

@LanceMcCarthy that's awesome tips, thank you so much will take a look