Rewrite UpdateService as WPF .NET 8#3
Merged
Conversation
Agent-Logs-Url: https://github.com/gb63728f4/UpdateService/sessions/da12cb3f-d1b8-4d8f-a859-e3ae38388140 Co-authored-by: gb63728f4 <39524431+gb63728f4@users.noreply.github.com>
…ve duplicate logging Agent-Logs-Url: https://github.com/gb63728f4/UpdateService/sessions/da12cb3f-d1b8-4d8f-a859-e3ae38388140 Co-authored-by: gb63728f4 <39524431+gb63728f4@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gb63728f4/UpdateService/sessions/4f791e42-cd47-45a2-a194-a8adc54f6f90 Co-authored-by: gb63728f4 <39524431+gb63728f4@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
gb63728f4
April 7, 2026 08:25
View session
There was a problem hiding this comment.
Pull request overview
This PR migrates UpdateService from a .NET Framework 4.8 console application to a .NET 8 WPF desktop app, introducing a GUI front-end and refactoring the update/install logic to run asynchronously with UI-friendly logging.
Changes:
- Converted the project to SDK-style
net8.0-windowswith WPF/WinForms enabled and switched configuration input toappsettings.json. - Added a WPF
MainWindowUI (destination path selection, execute mode selection, execute/clear log, timestamped log output). - Refactored service update logic into an instance-based
UpdateServiceLogicusingasync/awaitand process exit signaling viaTaskCompletionSource.
Reviewed changes
Copilot reviewed 24 out of 39 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| UpdateService/UpdateService.csproj | Migrates project to SDK-style .NET 8 Windows desktop configuration and copies appsettings.json to output. |
| UpdateService/UpdateService.cs | Refactors update logic into UpdateServiceLogic, adds async process execution + logging callback. |
| UpdateService/obj/UpdateService.csproj.nuget.g.targets | Generated NuGet restore artifact (build output). |
| UpdateService/obj/UpdateService.csproj.nuget.g.props | Generated NuGet restore artifact (build output). |
| UpdateService/obj/UpdateService.csproj.nuget.dgspec.json | Generated NuGet restore spec (build output). |
| UpdateService/obj/project.nuget.cache | Generated NuGet cache file (build output). |
| UpdateService/obj/project.assets.json | Generated NuGet assets file (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.sourcelink.json | Generated SourceLink metadata (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.pdb | Generated debug symbols (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.GlobalUsings.g.cs | Generated global usings (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.genruntimeconfig.cache | Generated runtimeconfig cache (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.GeneratedMSBuildEditorConfig.editorconfig | Generated MSBuild editorconfig (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.g.resources | Generated WPF resources (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.dll | Generated assembly (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.csproj.FileListAbsolute.txt | Generated file list (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.csproj.CoreCompileInputs.cache | Generated compile inputs cache (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.assets.cache | Generated assets cache (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.AssemblyInfoInputs.cache | Generated assembly info inputs cache (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService.AssemblyInfo.cs | Generated assembly info (build output). |
| UpdateService/obj/Debug/net8.0-windows/UpdateService_MarkupCompile.cache | Generated WPF markup compile cache (build output). |
| UpdateService/obj/Debug/net8.0-windows/refint/UpdateService.dll | Generated reference assembly (build output). |
| UpdateService/obj/Debug/net8.0-windows/ref/UpdateService.dll | Generated reference assembly (build output). |
| UpdateService/obj/Debug/net8.0-windows/MainWindow.g.cs | Generated code-behind for XAML (build output). |
| UpdateService/obj/Debug/net8.0-windows/MainWindow.baml | Compiled XAML BAML (build output). |
| UpdateService/obj/Debug/net8.0-windows/App.g.cs | Generated WPF app entry code (build output). |
| UpdateService/obj/Debug/net8.0-windows/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | Generated framework attributes (build output). |
| UpdateService/MainWindow.xaml.cs | Adds WPF UI behavior: load settings from JSON, folder browser, execute workflow, append log. |
| UpdateService/MainWindow.xaml | Adds the WPF UI layout for settings, actions, and log display. |
| UpdateService/bin/Debug/net8.0-windows/UpdateService.runtimeconfig.json | Generated runtime configuration (build output). |
| UpdateService/bin/Debug/net8.0-windows/UpdateService.pdb | Generated debug symbols (build output). |
| UpdateService/bin/Debug/net8.0-windows/UpdateService.dll.config | Generated config output (build output). |
| UpdateService/bin/Debug/net8.0-windows/UpdateService.dll | Generated assembly (build output). |
| UpdateService/bin/Debug/net8.0-windows/UpdateService.deps.json | Generated dependency manifest (build output). |
| UpdateService/bin/Debug/net8.0-windows/appsettings.json | Copied appsettings.json output (build output). |
| UpdateService/appsettings.json | Adds JSON configuration for destination path and execute mode. |
| UpdateService/App.xaml.cs | Adds WPF App partial class. |
| UpdateService/App.xaml | Adds WPF Application definition and startup URI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
@copilot 幫我針對內容產生commit並且完成PR |
Contributor
Author
|
@gb63728f4 I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts the .NET Framework 4.8 console app to a WPF .NET 8 GUI application.
Project
UpdateService.csproj→ SDK-style,net8.0-windows,UseWPF+UseWindowsFormsApp.config→appsettings.json(read via built-inSystem.Text.Json, no extra packages)UI (
MainWindow)Complete/Install/UnInstall[HH:mm:ss]timestamps and auto-scrollLogic (
UpdateServiceLogic)staticclass into instantiableUpdateServiceLogicwithAction<string>log callbackasync/await+TaskCompletionSourcereplacesAutoResetEvent.WaitOne()— UI stays responsiveprocess.Exitednow subscribed beforeprocess.Start()OverWriteDestinationFileerrors logged with context at the call site; re-throw removed to avoid duplicate log entries.Where(n => n != null)instead of null-forgiving!