Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
DisplayName="$(Name)"
Description="A joke service that periodically logs nerdy humor."
Start="auto"
Account="LocalService"
ErrorControl="normal" />

<!-- Tell WiX to start the Service -->
Expand Down
21 changes: 15 additions & 6 deletions docs/core/extensions/windows-service-with-installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,17 @@ After the project reference has been added, configure the _Package.wxs_ file. Op
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />

<!-- Define the directory structure -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">

<!-- Create a folder inside program files -->
<Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">
<!-- Create a folder inside program files -->
<Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">

<!-- Create a folder within the parent folder given the name -->
<Directory Id="INSTALLFOLDER" Name="$(Name)" />
<!-- Create a folder within the parent folder given the name -->
<Directory Id="INSTALLFOLDER" Name="$(Name)" />
</Directory>
</Directory>
</StandardDirectory>
</Directory>
Comment on lines +189 to +199
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description states this change fixes directory structure alignment with sample code, but the original issue (#37133) requested using StandardDirectory Id='ProgramFiles6432Folder' to eliminate compilation errors. This change appears to revert to the older structure that may have caused the reported issue, rather than implementing the requested fix.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the original issue. I agree with the Copilot suggestion.


<!-- The files inside this DirectoryRef are linked to
the App.WindowsService directory via INSTALLFOLDER -->
Expand All @@ -219,6 +221,7 @@ After the project reference has been added, configure the _Package.wxs_ file. Op
DisplayName="$(Name)"
Description="A joke service that periodically logs nerdy humor."
Start="auto"
Account="LocalService"
ErrorControl="normal" />

<!-- Tell WiX to start the Service -->
Expand All @@ -240,6 +243,12 @@ After the project reference has been added, configure the _Package.wxs_ file. Op
</Wix>
```

The `ServiceInstall` element's `Account` attribute specifies the account under which the service runs. The `LocalService` account is a built-in account with reduced privileges that's appropriate for most services. Other common values include:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a better change than the suggestion by Copilot to remove line 248:

Suggested change
The `ServiceInstall` element's `Account` attribute specifies the account under which the service runs. The `LocalService` account is a built-in account with reduced privileges that's appropriate for most services. Other common values include:
The `ServiceInstall` element's `Account` attribute specifies the account under which the service runs. The `LocalService` account is a built-in account with reduced privileges that's appropriate for most services. Common values include:


- `LocalService`: A built-in account with reduced privileges and no network credentials.
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation repeats the definition of LocalService twice. Line 246 already describes LocalService as 'a built-in account with reduced privileges,' and then line 248 repeats essentially the same information. Consider removing the redundant description on line 248 or restructuring to avoid repetition.

Suggested change
- `LocalService`: A built-in account with reduced privileges and no network credentials.

Copilot uses AI. Check for mistakes.
- `NetworkService`: Similar to LocalService but has network credentials.
- `LocalSystem`: The highest privilege level (use with caution).

When you build the project, the output is an MSI file that can be used to install and uninstall the service.

# [Microsoft installer extension](#tab/ext)
Expand Down
Loading