-
Notifications
You must be signed in to change notification settings - Fork 6k
Add Account attribute to ServiceInstall element in Windows Service installer documentation #49371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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> | ||||||
|
|
||||||
| <!-- The files inside this DirectoryRef are linked to | ||||||
| the App.WindowsService directory via INSTALLFOLDER --> | ||||||
|
|
@@ -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 --> | ||||||
|
|
@@ -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: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||
|
|
||||||
| - `LocalService`: A built-in account with reduced privileges and no network credentials. | ||||||
|
||||||
| - `LocalService`: A built-in account with reduced privileges and no network credentials. |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.