Problem:
Microsoft Power Automate Desktop was packaged on the FPC. Now, when deployed, the primary "Power Automate service" service is not visible or functional aspects of the application are not working.
Resolution:
Microsoft Power Automate has two different, and very distinct versions. First, the "Microsoft Store App", which is specifically called "Power Automate" - This is not the full desktop version, and cannot be packaged as FlexApp/FA1 at this time.
This KB article is designed for FlexApp/FlexAppOne, for MS "Power Automate for desktop" only.
This KB was written & tested using the current latest version, 2.65.00145.26040, using both FPC Version 6.8.7.9216/9309- Note things are subject to change after this date, however the following links should help.
You will need the Power Automate desktop MSI (EXE) installer - You can find the latest version, and older ones here: https://learn.microsoft.com/en-us/power-automate/desktop-flows/install#install-power-automate-using-the-msi-installer
Released versions for Power Automate for desktop:
https://learn.microsoft.com/en-us/power-platform/released-versions/power-automate-desktop
Make sure you also take note of, and make sure to pre-install any Pre-Requisite Runtimes from MS on both your FPC and Base images for optimal packaging, in accordance with our FlexApp best practices guides.
https://learn.microsoft.com/en-us/power-automate/desktop-flows/install#net-8-requirement
The primary issue is that Power Automate desktop version, Microsoft uses a "virtual account" to run the primary "Power Automate" service. The username is "NT SERVICE\UIFlowService", and also requires RDP and Performance monitor group access on the local device to be able to function properly.
At present time, we are unable to capture this kind of account - This will be addressed in an upcoming release.
To remedy this, we need to do a few things - First Edit the package, then add post-activation and pre-deactivation scripts to setup the correct service and account setup during post-activation, and likewise, during pre-deactivation take it apart if used on non-persistent devices.
- Capture the full package install, and launch it once at the end, but close it before clicking on Login or Change Region - After that, close the application capture/Save the package.
- Edit the package, go to the Services section. You should see something like this:
- Right-Click and Delete the 4th service in the list, "Power Automate service" (The one using the "NT SERVICE\UIFlowService" Account).
- Next, expand Registry Section - Under hklm, navigate down to hklm\SYSTEM\ControlSet001\Services:
- Delete the "UIFlowService" from the Services section to match the Services settings:
- Save the Package.
- Activate the Package on the FPC, and go to the Edit Scripts Button of the package:
-
Add the attached PS1 files as shown below:
Note: In many environments, regular user accounts are not allowed to create services - To remedy that, we name the scripts like this:
system_Setup-PowerAutomate.ps1 (Post-Activation)
system_Remove-PowerAutomate.ps1 (Pre-Deactivation)The system_ prefix in any script name will cause the scripts to execute as 'NT AUTHORITY/SYSTEM' user, which should fix this.
- Click OK to Save the package after adding the scripts that are attached at the bottom of the page.
-
Test - You can check the log(s) under C:\ProgramData\Liquidware\Logs to see how it's working - Please see the attached scripts for more information, and be careful/ in your testing.
Product: Liquidware FlexApp/FlexAppOne - FPC versions: 6.8.7.9216/6.8.7.9309
Application: Power Automate Desktop (Microsoft)
Version: 6.8.x+