microsoft / microsoft/msix-packaging

[BUG] MSIX cannot install per-user service

Open
#559 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-External Area-MSIX
Dominant language
C
Stars
1.1k
Forks
193
Avg merge
2h 16m
Merged PRs (30d)
2

Description

Project
MSIX SDK

Describe the bug
With the advent of Windows 10, Microsoft introduced per-user Windows Services. These services are started when a user logs in, run with the user's permissions, and are automatically shut down when the user signs off.

These new user services also alleviate some of the security restrictions put in place for Windows Services with newer releases of Windows (since they are effectively background user processes).

To Reproduce
Create an MSIX project (using the MSIX Packaging Tool, using manifest schema, or otherwise).

Under StartAccount (from the manifest's desktop6:Service XML entry), there is no option for per-user services. The only options are "localSystem", "localService", and "networkService"--all of which are system service options.
See: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-desktop6-service

Expected behavior
I expected to be able to specify "userService", possibly also requiring a share/own process option (since the SERVICE_USER_SERVICE (0x40) flag is OR'd with similar flags in a traditional Windows Installer context).

Screenshots
n/a

Platform
Windows 10 and Windows 11

Additional context
To follow best security practices and to enable services to seamlessly use the current user's security context, some services should be run as per-user services rather than under system accounts. Many of Windows 11's services can do this.

We can do this with MSI. But it would be really great if we could move forward and use the latest packaging technology and all of the benefits it provides--both in Enterprise environments and also for consumers (with simple right-click app removal, etc.).

Some notes from Microsoft on per-user services:
https://learn.microsoft.com/en-us/windows/application-management/per-user-services-in-windows

A useful post with some background info on installing per-user services:
https://helgeklein.com/blog/per-user-services-in-windows-info-and-configuration/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MSIX manifest schema's desktop6:Service entry and its StartAccount options, then inspect the MSIX SDK handling for service declarations. Determine whether per-user services can be represented and what installation behavior is required on Windows 10 and Windows 11. Done means an MSIX package can declare and install a per-user service.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.