diff --git a/App.xaml.cs b/App.xaml.cs index 1c963a4..d45fb42 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs index cdfb7e1..db9b008 100644 --- a/AssemblyInfo.cs +++ b/AssemblyInfo.cs @@ -3,18 +3,21 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("ThreadPilot.Core.Tests")] [assembly:ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located diff --git a/Converters/BoolToColorConverter.cs b/Converters/BoolToColorConverter.cs index 8ed8f3b..640c41f 100644 --- a/Converters/BoolToColorConverter.cs +++ b/Converters/BoolToColorConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/BoolToFontWeightConverter.cs b/Converters/BoolToFontWeightConverter.cs index d7ee6c2..becd057 100644 --- a/Converters/BoolToFontWeightConverter.cs +++ b/Converters/BoolToFontWeightConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/BoolToStringConverter.cs b/Converters/BoolToStringConverter.cs index e6c75ca..7aa93ff 100644 --- a/Converters/BoolToStringConverter.cs +++ b/Converters/BoolToStringConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/BoolToVisibilityConverter.cs b/Converters/BoolToVisibilityConverter.cs index 90b2dcc..def1e2f 100644 --- a/Converters/BoolToVisibilityConverter.cs +++ b/Converters/BoolToVisibilityConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/BytesToStringConverter.cs b/Converters/BytesToStringConverter.cs index 3625c44..1b1206a 100644 --- a/Converters/BytesToStringConverter.cs +++ b/Converters/BytesToStringConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/CpuTopologyConverters.cs b/Converters/CpuTopologyConverters.cs index abdbfd7..69c7e83 100644 --- a/Converters/CpuTopologyConverters.cs +++ b/Converters/CpuTopologyConverters.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/InverseBooleanConverter.cs b/Converters/InverseBooleanConverter.cs index 99853d1..5a5b63c 100644 --- a/Converters/InverseBooleanConverter.cs +++ b/Converters/InverseBooleanConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/ItemIndexConverter.cs b/Converters/ItemIndexConverter.cs index 5633f5a..78cafc8 100644 --- a/Converters/ItemIndexConverter.cs +++ b/Converters/ItemIndexConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Converters/NullToBoolConverter.cs b/Converters/NullToBoolConverter.cs index 09d5f33..c32863d 100644 --- a/Converters/NullToBoolConverter.cs +++ b/Converters/NullToBoolConverter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Helpers/AffinityHelper.cs b/Helpers/AffinityHelper.cs index da6da39..74abfbd 100644 --- a/Helpers/AffinityHelper.cs +++ b/Helpers/AffinityHelper.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Collections.Generic; diff --git a/Helpers/Converters.cs b/Helpers/Converters.cs index eeb983c..66086ce 100644 --- a/Helpers/Converters.cs +++ b/Helpers/Converters.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Helpers/ServiceProviderExtensions.cs b/Helpers/ServiceProviderExtensions.cs index 9ed9d7d..4fc52e0 100644 --- a/Helpers/ServiceProviderExtensions.cs +++ b/Helpers/ServiceProviderExtensions.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/LICENSE b/LICENSE index 90c0a09..be3f7b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,122 +1,94 @@ -GNU General Public License v3.0 - -Copyright (C) 2025 Prime Build - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 only. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. - The licenses for most software and other practical works are designed + The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. - When we speak of free software, we are referring to freedom, not + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and + The precise terms and conditions for copying, distribution and modification follow. - TERMS AND CONDITIONS + TERMS AND CONDITIONS - 0. Definitions. + 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. - "Copyright" also means copyright-like laws that apply to other kinds of + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - "The Program" refers to any copyrightable work licensed under this + "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. - To "modify" a work means to copy from or adapt all or part of the work + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. - A "covered work" means either the unmodified Program or a work based + A "covered work" means either the unmodified Program or a work based on the Program. - To "propagate" a work means to do anything with it that, without + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - To "convey" a work means any kind of propagation that enables other + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays "Appropriate Legal Notices" + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the @@ -125,18 +97,18 @@ work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - 1. Source Code. + 1. Source Code. - The "source code" for a work means the preferred form of the work + The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. - A "Standard Interface" means an interface that either is an official + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - The "System Libraries" of an executable work include anything, other + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that @@ -147,7 +119,7 @@ implementation is available to the public in source code form. A (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - The "Corresponding Source" for a work in object code form means all + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's @@ -160,16 +132,16 @@ linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - The Corresponding Source need not include anything that users + The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - The Corresponding Source for a work in source code form is that + The Corresponding Source for a work in source code form is that same work. - 2. Basic Permissions. + 2. Basic Permissions. - All rights granted under this License are granted for the term of + All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a @@ -177,7 +149,7 @@ covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - You may make, run and propagate covered works that you do not + You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you @@ -188,19 +160,19 @@ for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - Conveying under any other circumstances is permitted solely under + Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - No covered work shall be deemed part of an effective technological + No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - When you convey a covered work, you waive any legal power to forbid + When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or @@ -208,9 +180,9 @@ modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - 4. Conveying Verbatim Copies. + 4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program's source code as you + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -218,37 +190,37 @@ non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - You may charge any price or no price for each copy that you convey, + You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - 5. Conveying Modified Source Versions. + 5. Conveying Modified Source Versions. - You may convey a work based on the Program, or the modifications to + You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. - A compilation of a covered work with other separate and independent + A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an @@ -258,59 +230,59 @@ beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - 6. Conveying Non-Source Forms. + 6. Conveying Non-Source Forms. - You may convey a covered work in object code form under the terms + You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. - A separable portion of the object code, whose source code is excluded + A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A "User Product" is either (1) a "consumer product", which means any + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, @@ -323,7 +295,7 @@ is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - "Installation Information" for a User Product means any methods, + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must @@ -331,7 +303,7 @@ suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - If you convey an object code work under this section in, or with, or + If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a @@ -342,7 +314,7 @@ if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - The requirement to provide Installation Information does not include a + The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a @@ -350,15 +322,15 @@ network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - Corresponding Source conveyed, and Installation Information provided, + Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - 7. Additional Terms. + 7. Additional Terms. - "Additional permissions" are terms that supplement the terms of this + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent @@ -367,41 +339,41 @@ apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - When you convey a copy of a covered work, you may at your option + When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - Notwithstanding any other provision of this License, for material you + Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. - All other non-permissive additional terms are considered "further + All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further @@ -411,46 +383,46 @@ License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - If you add terms to a covered work in accord with this section, you + If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - Additional terms, permissive or non-permissive, may be stated in the + Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - 8. Termination. + 8. Termination. - You may not propagate or modify a covered work except as expressly + You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - However, if you cease all violation of this License, then your + However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - Moreover, your license from a particular copyright holder is + Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - Termination of your rights under this section does not terminate the + Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - 9. Acceptance Not Required for Having Copies. + 9. Acceptance Not Required for Having Copies. - You are not required to accept this License in order to receive or + You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, @@ -459,14 +431,14 @@ modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - 10. Automatic Licensing of Downstream Recipients. + 10. Automatic Licensing of Downstream Recipients. - Each time you convey a covered work, the recipient automatically + Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - An "entity transaction" is a transaction transferring control of an + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that @@ -476,7 +448,7 @@ give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - You may not impose any further restrictions on the exercise of the + You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation @@ -484,13 +456,13 @@ rights granted under this License, and you may not initiate litigation any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - 11. Patents. + 11. Patents. - A "contributor" is a copyright holder who authorizes use under this + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - A contributor's "essential patent claims" are all patent claims + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, @@ -500,19 +472,19 @@ purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - Each contributor grants you a non-exclusive, worldwide, royalty-free + Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a "patent license" is any express + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - If you convey a covered work, knowingly relying on a patent license, + If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, @@ -526,7 +498,7 @@ covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - If, pursuant to or in connection with a single transaction or + If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify @@ -534,7 +506,7 @@ or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is "discriminatory" if it does not include within + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered @@ -549,13 +521,13 @@ for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - Nothing in this License shall be construed as excluding or limiting + Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others' Freedom. + 12. No Surrender of Others' Freedom. - If conditions are imposed on you (whether by court order, agreement or + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this @@ -565,46 +537,56 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. - Notwithstanding any other provision of this License, you have + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. - 14. Revised Versions of this License. + 14. Revised Versions of this License. - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - Later license versions may give you additional or different + Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - 15. Disclaimer of Warranty. + 15. Disclaimer of Warranty. - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, @@ -613,9 +595,9 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 16. Limitation of Liability. + 16. Limitation of Liability. - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -625,66 +607,55 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - 17. Interpretation of Sections 15 and 16. + 17. Interpretation of Sections 15 and 16. - If the disclaimer of warranty and limitation of liability provided + If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs - If you develop a new program, and you want it to be of the greatest + If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest + To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - Copyright (C) + + Copyright (C) - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, + You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see +For more information on this, and how to apply and follow the GNU AGPL, see . - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 90c0a09..be3f7b2 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,122 +1,94 @@ -GNU General Public License v3.0 - -Copyright (C) 2025 Prime Build - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 only. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. - The licenses for most software and other practical works are designed + The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. - When we speak of free software, we are referring to freedom, not + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and + The precise terms and conditions for copying, distribution and modification follow. - TERMS AND CONDITIONS + TERMS AND CONDITIONS - 0. Definitions. + 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. - "Copyright" also means copyright-like laws that apply to other kinds of + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - "The Program" refers to any copyrightable work licensed under this + "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. - To "modify" a work means to copy from or adapt all or part of the work + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. - A "covered work" means either the unmodified Program or a work based + A "covered work" means either the unmodified Program or a work based on the Program. - To "propagate" a work means to do anything with it that, without + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - To "convey" a work means any kind of propagation that enables other + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays "Appropriate Legal Notices" + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the @@ -125,18 +97,18 @@ work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - 1. Source Code. + 1. Source Code. - The "source code" for a work means the preferred form of the work + The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. - A "Standard Interface" means an interface that either is an official + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - The "System Libraries" of an executable work include anything, other + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that @@ -147,7 +119,7 @@ implementation is available to the public in source code form. A (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - The "Corresponding Source" for a work in object code form means all + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's @@ -160,16 +132,16 @@ linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - The Corresponding Source need not include anything that users + The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - The Corresponding Source for a work in source code form is that + The Corresponding Source for a work in source code form is that same work. - 2. Basic Permissions. + 2. Basic Permissions. - All rights granted under this License are granted for the term of + All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a @@ -177,7 +149,7 @@ covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - You may make, run and propagate covered works that you do not + You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you @@ -188,19 +160,19 @@ for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - Conveying under any other circumstances is permitted solely under + Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - No covered work shall be deemed part of an effective technological + No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - When you convey a covered work, you waive any legal power to forbid + When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or @@ -208,9 +180,9 @@ modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - 4. Conveying Verbatim Copies. + 4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program's source code as you + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -218,37 +190,37 @@ non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - You may charge any price or no price for each copy that you convey, + You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - 5. Conveying Modified Source Versions. + 5. Conveying Modified Source Versions. - You may convey a work based on the Program, or the modifications to + You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. - A compilation of a covered work with other separate and independent + A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an @@ -258,59 +230,59 @@ beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - 6. Conveying Non-Source Forms. + 6. Conveying Non-Source Forms. - You may convey a covered work in object code form under the terms + You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. - A separable portion of the object code, whose source code is excluded + A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A "User Product" is either (1) a "consumer product", which means any + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, @@ -323,7 +295,7 @@ is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - "Installation Information" for a User Product means any methods, + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must @@ -331,7 +303,7 @@ suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - If you convey an object code work under this section in, or with, or + If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a @@ -342,7 +314,7 @@ if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - The requirement to provide Installation Information does not include a + The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a @@ -350,15 +322,15 @@ network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - Corresponding Source conveyed, and Installation Information provided, + Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - 7. Additional Terms. + 7. Additional Terms. - "Additional permissions" are terms that supplement the terms of this + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent @@ -367,41 +339,41 @@ apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - When you convey a copy of a covered work, you may at your option + When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - Notwithstanding any other provision of this License, for material you + Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. - All other non-permissive additional terms are considered "further + All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further @@ -411,46 +383,46 @@ License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - If you add terms to a covered work in accord with this section, you + If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - Additional terms, permissive or non-permissive, may be stated in the + Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - 8. Termination. + 8. Termination. - You may not propagate or modify a covered work except as expressly + You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - However, if you cease all violation of this License, then your + However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - Moreover, your license from a particular copyright holder is + Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - Termination of your rights under this section does not terminate the + Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - 9. Acceptance Not Required for Having Copies. + 9. Acceptance Not Required for Having Copies. - You are not required to accept this License in order to receive or + You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, @@ -459,14 +431,14 @@ modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - 10. Automatic Licensing of Downstream Recipients. + 10. Automatic Licensing of Downstream Recipients. - Each time you convey a covered work, the recipient automatically + Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - An "entity transaction" is a transaction transferring control of an + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that @@ -476,7 +448,7 @@ give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - You may not impose any further restrictions on the exercise of the + You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation @@ -484,13 +456,13 @@ rights granted under this License, and you may not initiate litigation any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - 11. Patents. + 11. Patents. - A "contributor" is a copyright holder who authorizes use under this + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - A contributor's "essential patent claims" are all patent claims + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, @@ -500,19 +472,19 @@ purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - Each contributor grants you a non-exclusive, worldwide, royalty-free + Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a "patent license" is any express + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - If you convey a covered work, knowingly relying on a patent license, + If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, @@ -526,7 +498,7 @@ covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - If, pursuant to or in connection with a single transaction or + If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify @@ -534,7 +506,7 @@ or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is "discriminatory" if it does not include within + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered @@ -549,13 +521,13 @@ for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - Nothing in this License shall be construed as excluding or limiting + Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others' Freedom. + 12. No Surrender of Others' Freedom. - If conditions are imposed on you (whether by court order, agreement or + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this @@ -565,46 +537,56 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. - Notwithstanding any other provision of this License, you have + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. - 14. Revised Versions of this License. + 14. Revised Versions of this License. - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - Later license versions may give you additional or different + Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - 15. Disclaimer of Warranty. + 15. Disclaimer of Warranty. - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, @@ -613,9 +595,9 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 16. Limitation of Liability. + 16. Limitation of Liability. - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -625,66 +607,55 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - 17. Interpretation of Sections 15 and 16. + 17. Interpretation of Sections 15 and 16. - If the disclaimer of warranty and limitation of liability provided + If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs - If you develop a new program, and you want it to be of the greatest + If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest + To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - Copyright (C) + + Copyright (C) - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, + You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see +For more information on this, and how to apply and follow the GNU AGPL, see . - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. \ No newline at end of file diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 24463b7..4cd99af 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -689,7 +689,15 @@ namespace ThreadPilot ShowWindowFromTray(); } - private async void OnExitRequested(object? sender, EventArgs e) + private void OnExitRequested(object? sender, EventArgs e) + { + TaskSafety.FireAndForget(OnExitRequestedAsync(), ex => + { + LogDebug($"OnExitRequested failed: {ex.Message}"); + }); + } + + private async Task OnExitRequestedAsync() { await PerformGracefulShutdownAsync(); } @@ -882,7 +890,15 @@ namespace ThreadPilot await PerformGracefulShutdownAsync(validateUnsavedChanges: false); } - private async void OnMonitoringToggleRequested(object? sender, MonitoringToggleEventArgs e) + private void OnMonitoringToggleRequested(object? sender, MonitoringToggleEventArgs e) + { + TaskSafety.FireAndForget(OnMonitoringToggleRequestedAsync(e), ex => + { + LogDebug($"OnMonitoringToggleRequested failed: {ex.Message}"); + }); + } + + private async Task OnMonitoringToggleRequestedAsync(MonitoringToggleEventArgs e) { try { @@ -923,7 +939,15 @@ namespace ThreadPilot } } - private async void OnPowerPlanChangeRequested(object? sender, PowerPlanChangeRequestedEventArgs e) + private void OnPowerPlanChangeRequested(object? sender, PowerPlanChangeRequestedEventArgs e) + { + TaskSafety.FireAndForget(OnPowerPlanChangeRequestedAsync(e), ex => + { + LogDebug($"OnPowerPlanChangeRequested failed: {ex.Message}"); + }); + } + + private async Task OnPowerPlanChangeRequestedAsync(PowerPlanChangeRequestedEventArgs e) { try { @@ -948,7 +972,15 @@ namespace ThreadPilot } } - private async void OnProfileApplicationRequested(object? sender, ProfileApplicationRequestedEventArgs e) + private void OnProfileApplicationRequested(object? sender, ProfileApplicationRequestedEventArgs e) + { + TaskSafety.FireAndForget(OnProfileApplicationRequestedAsync(e), ex => + { + LogDebug($"OnProfileApplicationRequested failed: {ex.Message}"); + }); + } + + private async Task OnProfileApplicationRequestedAsync(ProfileApplicationRequestedEventArgs e) { try { @@ -1387,7 +1419,15 @@ namespace ThreadPilot } } - private async void OnWindowLoaded(object? sender, RoutedEventArgs e) + private void OnWindowLoaded(object? sender, RoutedEventArgs e) + { + TaskSafety.FireAndForget(OnWindowLoadedAsync(), ex => + { + LogDebug($"OnWindowLoaded failed: {ex.Message}"); + }); + } + + private async Task OnWindowLoadedAsync() { Loaded -= OnWindowLoaded; await InitializeKeyboardShortcutsAsync(); @@ -1482,7 +1522,15 @@ namespace ThreadPilot NavSettings.IsActive = tag == "Settings"; } - private async void NavMenuItem_Click(object sender, RoutedEventArgs e) + private void NavMenuItem_Click(object sender, RoutedEventArgs e) + { + TaskSafety.FireAndForget(NavMenuItem_ClickAsync(sender, e), ex => + { + LogDebug($"NavMenuItem_Click failed: {ex.Message}"); + }); + } + + private async Task NavMenuItem_ClickAsync(object sender, RoutedEventArgs e) { if (_isHandlingTabSelection) { diff --git a/Models/ApplicationSettingsModel.cs b/Models/ApplicationSettingsModel.cs index 28af7d8..52e578e 100644 --- a/Models/ApplicationSettingsModel.cs +++ b/Models/ApplicationSettingsModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/ConditionalProcessProfile.cs b/Models/ConditionalProcessProfile.cs index 6e59128..892e41d 100644 --- a/Models/ConditionalProcessProfile.cs +++ b/Models/ConditionalProcessProfile.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/Core/IModel.cs b/Models/Core/IModel.cs index 2845af0..447bd33 100644 --- a/Models/Core/IModel.cs +++ b/Models/Core/IModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/CoreMask.cs b/Models/CoreMask.cs index 19f3d61..6eab59a 100644 --- a/Models/CoreMask.cs +++ b/Models/CoreMask.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/CpuTopologyModel.cs b/Models/CpuTopologyModel.cs index 7f10dee..d17dc2e 100644 --- a/Models/CpuTopologyModel.cs +++ b/Models/CpuTopologyModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/LogEventTypes.cs b/Models/LogEventTypes.cs index ca517ef..036de26 100644 --- a/Models/LogEventTypes.cs +++ b/Models/LogEventTypes.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ namespace ThreadPilot.Models diff --git a/Models/NotificationModel.cs b/Models/NotificationModel.cs index 11011c0..b3b304f 100644 --- a/Models/NotificationModel.cs +++ b/Models/NotificationModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/PowerPlanModel.cs b/Models/PowerPlanModel.cs index 865f0d7..9c11da2 100644 --- a/Models/PowerPlanModel.cs +++ b/Models/PowerPlanModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using CommunityToolkit.Mvvm.ComponentModel; diff --git a/Models/ProcessModel.cs b/Models/ProcessModel.cs index 7fbd173..d76041d 100644 --- a/Models/ProcessModel.cs +++ b/Models/ProcessModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/ProcessMonitorConfiguration.cs b/Models/ProcessMonitorConfiguration.cs index a4eee7e..a25d080 100644 --- a/Models/ProcessMonitorConfiguration.cs +++ b/Models/ProcessMonitorConfiguration.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/ProcessPowerPlanAssociation.cs b/Models/ProcessPowerPlanAssociation.cs index e5018da..b0927f2 100644 --- a/Models/ProcessPowerPlanAssociation.cs +++ b/Models/ProcessPowerPlanAssociation.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Models/ProfileModel.cs b/Models/ProfileModel.cs index a4db152..136b684 100644 --- a/Models/ProfileModel.cs +++ b/Models/ProfileModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Platforms/Windows/CpuSetNativeMethods.cs b/Platforms/Windows/CpuSetNativeMethods.cs index ff62492..447cca4 100644 --- a/Platforms/Windows/CpuSetNativeMethods.cs +++ b/Platforms/Windows/CpuSetNativeMethods.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Win32.SafeHandles; diff --git a/Platforms/Windows/IProcessCpuSetHandler.cs b/Platforms/Windows/IProcessCpuSetHandler.cs index 0c452a2..0ecd834 100644 --- a/Platforms/Windows/IProcessCpuSetHandler.cs +++ b/Platforms/Windows/IProcessCpuSetHandler.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Platforms/Windows/ProcessCpuSetHandler.cs b/Platforms/Windows/ProcessCpuSetHandler.cs index 6600579..7d61846 100644 --- a/Platforms/Windows/ProcessCpuSetHandler.cs +++ b/Platforms/Windows/ProcessCpuSetHandler.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; diff --git a/README.md b/README.md index 4be8592..0e64846 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Windows CI](https://img.shields.io/badge/CI-Windows-success)](.github/workflows/ci-devsecops.yml) [![Windows](https://img.shields.io/badge/Windows-11%20official%20%7C%2010%20best--effort-blue?logo=windows)](https://www.microsoft.com/windows) [![.NET](https://img.shields.io/badge/.NET-8.0-512BD4?logo=dotnet&logoColor=white)](https://dotnet.microsoft.com/) -[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) +[![License](https://img.shields.io/badge/License-AGPLv3-blue.svg)](LICENSE) ThreadPilot is a free and open-source Windows process and power plan manager focused on deterministic performance workflows. @@ -100,7 +100,7 @@ See CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening pull requests. ## License -Licensed under GNU General Public License v3.0. See LICENSE. +Licensed under GNU Affero General Public License v3.0. See LICENSE. ## Support diff --git a/Services/ApplicationSettingsService.cs b/Services/ApplicationSettingsService.cs index de3f3c2..65f0f0f 100644 --- a/Services/ApplicationSettingsService.cs +++ b/Services/ApplicationSettingsService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/AtomicFileWriter.cs b/Services/AtomicFileWriter.cs index f738d65..cc79b68 100644 --- a/Services/AtomicFileWriter.cs +++ b/Services/AtomicFileWriter.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/AutostartService.cs b/Services/AutostartService.cs index 5bfd178..630e22a 100644 --- a/Services/AutostartService.cs +++ b/Services/AutostartService.cs @@ -3,18 +3,19 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading.Tasks; @@ -32,6 +33,7 @@ namespace ThreadPilot.Services private const string APPLICATION_NAME = "ThreadPilot"; private const string SCHEDULED_TASK_NAME = "ThreadPilot_Startup"; private static readonly string SchTasksExecutablePath = Path.Combine(Environment.SystemDirectory, "schtasks.exe"); + private static readonly TimeSpan ScheduledTaskTimeout = TimeSpan.FromSeconds(20); private readonly ILogger _logger; private readonly IElevationService _elevationService; @@ -48,8 +50,11 @@ namespace ThreadPilot.Services _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _elevationService = elevationService ?? throw new ArgumentNullException(nameof(elevationService)); - // Initialize current status - _ = Task.Run(CheckAutostartStatusAsync); + // Initialize current status without surfacing startup exceptions. + TaskSafety.FireAndForget(CheckAutostartStatusAsync(), ex => + { + _logger.LogDebug(ex, "Autostart status initialization failed"); + }); } public async Task EnableAutostartAsync(bool startMinimized = true) @@ -140,7 +145,7 @@ namespace ThreadPilot.Services } } - public async Task CheckAutostartStatusAsync() + public Task CheckAutostartStatusAsync() { try { @@ -149,7 +154,7 @@ namespace ThreadPilot.Services { _isAutostartEnabled = false; _autostartPath = null; - return false; + return Task.FromResult(false); } var value = key.GetValue(APPLICATION_NAME) as string; @@ -159,14 +164,14 @@ namespace ThreadPilot.Services _logger.LogDebug("Autostart status checked: {IsEnabled}, Path: {Path}", _isAutostartEnabled, _autostartPath); - return _isAutostartEnabled; + return Task.FromResult(_isAutostartEnabled); } catch (Exception ex) { _logger.LogError(ex, "Failed to check autostart status"); _isAutostartEnabled = false; _autostartPath = null; - return false; + return Task.FromResult(false); } } @@ -236,33 +241,32 @@ namespace ThreadPilot.Services { try { - var taskArguments = $"/Create /TN \"{SCHEDULED_TASK_NAME}\" /TR \"\\\"{executablePath}\\\" {arguments}\" " + - $"/SC ONLOGON /RL HIGHEST /F /RU \"{Environment.UserName}\""; - - var processInfo = new ProcessStartInfo + if (!IsValidExecutablePath(executablePath)) { - FileName = SchTasksExecutablePath, - Arguments = taskArguments, - UseShellExecute = false, - CreateNoWindow = true, - RedirectStandardOutput = true, - RedirectStandardError = true - }; + _logger.LogWarning("Skipping elevated startup task creation due to invalid executable path: {Path}", executablePath); + return; + } - using var process = Process.Start(processInfo); - if (process != null) + var taskRunCommand = BuildAutostartCommand(executablePath, arguments); + var result = await RunSchTasksAsync(new List { - await process.WaitForExitAsync(); - if (process.ExitCode == 0) - { - _logger.LogInformation("Created elevated startup task successfully"); - } - else - { - var error = await process.StandardError.ReadToEndAsync(); - _logger.LogWarning("Failed to create elevated startup task. Exit code: {ExitCode}, Error: {Error}", - process.ExitCode, error); - } + "/Create", + "/TN", SCHEDULED_TASK_NAME, + "/TR", taskRunCommand, + "/SC", "ONLOGON", + "/RL", "HIGHEST", + "/F", + "/RU", Environment.UserName + }); + + if (result.ExitCode == 0) + { + _logger.LogInformation("Created elevated startup task successfully"); + } + else + { + _logger.LogWarning("Failed to create elevated startup task. Exit code: {ExitCode}, Error: {Error}", + result.ExitCode, result.StandardError); } } catch (Exception ex) @@ -278,31 +282,21 @@ namespace ThreadPilot.Services { try { - var taskArguments = $"/Delete /TN \"{SCHEDULED_TASK_NAME}\" /F"; - - var processInfo = new ProcessStartInfo + var result = await RunSchTasksAsync(new List { - FileName = SchTasksExecutablePath, - Arguments = taskArguments, - UseShellExecute = false, - CreateNoWindow = true, - RedirectStandardOutput = true, - RedirectStandardError = true - }; + "/Delete", + "/TN", SCHEDULED_TASK_NAME, + "/F" + }); - using var process = Process.Start(processInfo); - if (process != null) + if (result.ExitCode == 0) { - await process.WaitForExitAsync(); - if (process.ExitCode == 0) - { - _logger.LogInformation("Removed elevated startup task successfully"); - } - else - { - // Task might not exist, which is fine - _logger.LogDebug("Scheduled task removal completed with exit code: {ExitCode}", process.ExitCode); - } + _logger.LogInformation("Removed elevated startup task successfully"); + } + else + { + // Task might not exist, which is fine. + _logger.LogDebug("Scheduled task removal completed with exit code: {ExitCode}", result.ExitCode); } } catch (Exception ex) @@ -310,6 +304,90 @@ namespace ThreadPilot.Services _logger.LogWarning(ex, "Failed to remove elevated startup task"); } } + + private static bool IsValidExecutablePath(string executablePath) + { + if (string.IsNullOrWhiteSpace(executablePath) || !Path.IsPathRooted(executablePath)) + { + return false; + } + + return File.Exists(executablePath) && + string.Equals(Path.GetExtension(executablePath), ".exe", StringComparison.OrdinalIgnoreCase); + } + + private static string BuildAutostartCommand(string executablePath, string arguments) + { + var trimmedArguments = arguments?.Trim(); + return string.IsNullOrWhiteSpace(trimmedArguments) + ? $"\"{executablePath}\"" + : $"\"{executablePath}\" {trimmedArguments}"; + } + + private static async Task RunSchTasksAsync(IReadOnlyList arguments) + { + if (!File.Exists(SchTasksExecutablePath)) + { + return new ProcessResult(-1, string.Empty, "schtasks.exe not found in system directory"); + } + + var processInfo = new ProcessStartInfo + { + FileName = SchTasksExecutablePath, + UseShellExecute = false, + CreateNoWindow = true, + RedirectStandardOutput = true, + RedirectStandardError = true + }; + + foreach (var argument in arguments) + { + processInfo.ArgumentList.Add(argument); + } + + using var process = Process.Start(processInfo); + if (process == null) + { + return new ProcessResult(-1, string.Empty, "Could not start schtasks.exe"); + } + + var outputTask = process.StandardOutput.ReadToEndAsync(); + var errorTask = process.StandardError.ReadToEndAsync(); + var exitTask = process.WaitForExitAsync(); + var completedTask = await Task.WhenAny(exitTask, Task.Delay(ScheduledTaskTimeout)); + if (completedTask != exitTask) + { + try + { + process.Kill(entireProcessTree: true); + } + catch + { + // Best-effort kill for timeout. + } + + return new ProcessResult(-1, await outputTask, $"schtasks timeout after {ScheduledTaskTimeout.TotalSeconds} seconds"); + } + + await exitTask; + return new ProcessResult(process.ExitCode, await outputTask, await errorTask); + } + + private readonly struct ProcessResult + { + public ProcessResult(int exitCode, string standardOutput, string standardError) + { + ExitCode = exitCode; + StandardOutput = standardOutput; + StandardError = standardError; + } + + public int ExitCode { get; } + + public string StandardOutput { get; } + + public string StandardError { get; } + } } } diff --git a/Services/ConditionalProfileService.cs b/Services/ConditionalProfileService.cs index 074988a..58011c5 100644 --- a/Services/ConditionalProfileService.cs +++ b/Services/ConditionalProfileService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; @@ -408,7 +408,15 @@ namespace ThreadPilot.Services } } - private async void MonitoringCallback(object? state) + private void MonitoringCallback(object? state) + { + TaskSafety.FireAndForget(MonitoringCallbackAsync(), ex => + { + _logger.LogWarning(ex, "Error during profile monitoring cycle"); + }); + } + + private async Task MonitoringCallbackAsync() { if (!_isMonitoring) return; @@ -484,16 +492,16 @@ namespace ThreadPilot.Services await AddProfileAsync(gameProfile); } - private async Task GetCpuUsageAsync() + private Task GetCpuUsageAsync() { // Simplified CPU usage calculation - return Environment.ProcessorCount * 10.0; // Placeholder + return Task.FromResult(Environment.ProcessorCount * 10.0); // Placeholder } - private async Task GetMemoryUsageAsync() + private Task GetMemoryUsageAsync() { var totalMemory = GC.GetTotalMemory(false); - return totalMemory / (1024.0 * 1024.0); // MB + return Task.FromResult(totalMemory / (1024.0 * 1024.0)); // MB } private async Task GetProcessCountAsync() diff --git a/Services/Core/BaseSystemService.cs b/Services/Core/BaseSystemService.cs index d71e602..e14974b 100644 --- a/Services/Core/BaseSystemService.cs +++ b/Services/Core/BaseSystemService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; diff --git a/Services/Core/ISystemService.cs b/Services/Core/ISystemService.cs index fa98561..9d742a7 100644 --- a/Services/Core/ISystemService.cs +++ b/Services/Core/ISystemService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/CoreMaskService.cs b/Services/CoreMaskService.cs index 88146a3..39206b7 100644 --- a/Services/CoreMaskService.cs +++ b/Services/CoreMaskService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/CpuTopologyService.cs b/Services/CpuTopologyService.cs index 681420e..f175f6f 100644 --- a/Services/CpuTopologyService.cs +++ b/Services/CpuTopologyService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ElevationService.cs b/Services/ElevationService.cs index eca279c..824ad02 100644 --- a/Services/ElevationService.cs +++ b/Services/ElevationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/EnhancedLoggingService.cs b/Services/EnhancedLoggingService.cs index 2c9054c..6be73cc 100644 --- a/Services/EnhancedLoggingService.cs +++ b/Services/EnhancedLoggingService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -242,9 +242,12 @@ namespace ThreadPilot.Services } } - private async void FlushLogs(object? state) + private void FlushLogs(object? state) { - await FlushLogsAsync(); + TaskSafety.FireAndForget(FlushLogsAsync(), ex => + { + _logger.LogWarning(ex, "Periodic log flush failed"); + }); } private async Task FlushLogsAsync() diff --git a/Services/GameBoostService.cs b/Services/GameBoostService.cs index f02f6ee..b23dd36 100644 --- a/Services/GameBoostService.cs +++ b/Services/GameBoostService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/GameDetectionService.cs b/Services/GameDetectionService.cs index b94d2e1..ca6b3fd 100644 --- a/Services/GameDetectionService.cs +++ b/Services/GameDetectionService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/GameModeService.cs b/Services/GameModeService.cs index a826a84..0d7b708 100644 --- a/Services/GameModeService.cs +++ b/Services/GameModeService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/GitHubUpdateChecker.cs b/Services/GitHubUpdateChecker.cs index ca524cf..7bef599 100644 --- a/Services/GitHubUpdateChecker.cs +++ b/Services/GitHubUpdateChecker.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IApplicationSettingsService.cs b/Services/IApplicationSettingsService.cs index 10baa8b..2d2f1ad 100644 --- a/Services/IApplicationSettingsService.cs +++ b/Services/IApplicationSettingsService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IAutostartService.cs b/Services/IAutostartService.cs index 35f70fb..6b32f35 100644 --- a/Services/IAutostartService.cs +++ b/Services/IAutostartService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IConditionalProfileService.cs b/Services/IConditionalProfileService.cs index aa63665..b67f92c 100644 --- a/Services/IConditionalProfileService.cs +++ b/Services/IConditionalProfileService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ICoreMaskService.cs b/Services/ICoreMaskService.cs index 7ce7a63..96e0625 100644 --- a/Services/ICoreMaskService.cs +++ b/Services/ICoreMaskService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Collections.Generic; diff --git a/Services/ICpuTopologyService.cs b/Services/ICpuTopologyService.cs index 22553df..0331230 100644 --- a/Services/ICpuTopologyService.cs +++ b/Services/ICpuTopologyService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IElevationService.cs b/Services/IElevationService.cs index 0194c46..0d41d8d 100644 --- a/Services/IElevationService.cs +++ b/Services/IElevationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Threading.Tasks; diff --git a/Services/IEnhancedLoggingService.cs b/Services/IEnhancedLoggingService.cs index da3de49..7d905c8 100644 --- a/Services/IEnhancedLoggingService.cs +++ b/Services/IEnhancedLoggingService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IGameBoostService.cs b/Services/IGameBoostService.cs index 214d09c..e7ee4ec 100644 --- a/Services/IGameBoostService.cs +++ b/Services/IGameBoostService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IGameDetectionService.cs b/Services/IGameDetectionService.cs index 979da73..1ba741f 100644 --- a/Services/IGameDetectionService.cs +++ b/Services/IGameDetectionService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IGameModeService.cs b/Services/IGameModeService.cs index 8f150cb..6afe17b 100644 --- a/Services/IGameModeService.cs +++ b/Services/IGameModeService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Threading.Tasks; diff --git a/Services/IKeyboardShortcutService.cs b/Services/IKeyboardShortcutService.cs index afb86f0..2fff7dd 100644 --- a/Services/IKeyboardShortcutService.cs +++ b/Services/IKeyboardShortcutService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/INotificationService.cs b/Services/INotificationService.cs index 3a7ceb5..fac0194 100644 --- a/Services/INotificationService.cs +++ b/Services/INotificationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IPerformanceMonitoringService.cs b/Services/IPerformanceMonitoringService.cs index 1786ac3..746fffe 100644 --- a/Services/IPerformanceMonitoringService.cs +++ b/Services/IPerformanceMonitoringService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IPowerPlanService.cs b/Services/IPowerPlanService.cs index 5046f3b..69733d5 100644 --- a/Services/IPowerPlanService.cs +++ b/Services/IPowerPlanService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IProcessMonitorManagerService.cs b/Services/IProcessMonitorManagerService.cs index 356fe0e..6d6e8e6 100644 --- a/Services/IProcessMonitorManagerService.cs +++ b/Services/IProcessMonitorManagerService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IProcessMonitorService.cs b/Services/IProcessMonitorService.cs index 59d4b59..38a9228 100644 --- a/Services/IProcessMonitorService.cs +++ b/Services/IProcessMonitorService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IProcessPowerPlanAssociationService.cs b/Services/IProcessPowerPlanAssociationService.cs index a42741c..94c66cf 100644 --- a/Services/IProcessPowerPlanAssociationService.cs +++ b/Services/IProcessPowerPlanAssociationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IProcessService.cs b/Services/IProcessService.cs index fb0081b..7fafde2 100644 --- a/Services/IProcessService.cs +++ b/Services/IProcessService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Collections.Generic; diff --git a/Services/IRetryPolicyService.cs b/Services/IRetryPolicyService.cs index ee4e187..df629c2 100644 --- a/Services/IRetryPolicyService.cs +++ b/Services/IRetryPolicyService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ISecurityService.cs b/Services/ISecurityService.cs index 5920360..e30f4e9 100644 --- a/Services/ISecurityService.cs +++ b/Services/ISecurityService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ namespace ThreadPilot.Services diff --git a/Services/IServiceDisposalCoordinator.cs b/Services/IServiceDisposalCoordinator.cs index 4b92202..c8acd25 100644 --- a/Services/IServiceDisposalCoordinator.cs +++ b/Services/IServiceDisposalCoordinator.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IServiceHealthMonitor.cs b/Services/IServiceHealthMonitor.cs index 9435b3f..ed0690c 100644 --- a/Services/IServiceHealthMonitor.cs +++ b/Services/IServiceHealthMonitor.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ISmartNotificationService.cs b/Services/ISmartNotificationService.cs index 1359acd..1edf4a4 100644 --- a/Services/ISmartNotificationService.cs +++ b/Services/ISmartNotificationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ISystemTrayService.cs b/Services/ISystemTrayService.cs index aa7e25e..15f6cfa 100644 --- a/Services/ISystemTrayService.cs +++ b/Services/ISystemTrayService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ISystemTweaksService.cs b/Services/ISystemTweaksService.cs index 6a5c8ea..fe6444a 100644 --- a/Services/ISystemTweaksService.cs +++ b/Services/ISystemTweaksService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IThemeService.cs b/Services/IThemeService.cs index 756c4db..c95f8f0 100644 --- a/Services/IThemeService.cs +++ b/Services/IThemeService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/IVirtualizedProcessService.cs b/Services/IVirtualizedProcessService.cs index 8f25892..4bdbe1b 100644 --- a/Services/IVirtualizedProcessService.cs +++ b/Services/IVirtualizedProcessService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/KeyboardShortcutService.cs b/Services/KeyboardShortcutService.cs index e0306d6..db6073d 100644 --- a/Services/KeyboardShortcutService.cs +++ b/Services/KeyboardShortcutService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/LogFileManager.cs b/Services/LogFileManager.cs index fcd7596..9a0b1c5 100644 --- a/Services/LogFileManager.cs +++ b/Services/LogFileManager.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/NotificationService.cs b/Services/NotificationService.cs index 31d393e..07adf3d 100644 --- a/Services/NotificationService.cs +++ b/Services/NotificationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/PerformanceMonitoringService.cs b/Services/PerformanceMonitoringService.cs index 96a9a30..bf8e129 100644 --- a/Services/PerformanceMonitoringService.cs +++ b/Services/PerformanceMonitoringService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/PowerPlanService.cs b/Services/PowerPlanService.cs index 40e1f3f..d620b1d 100644 --- a/Services/PowerPlanService.cs +++ b/Services/PowerPlanService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ProcessManagement/IProcessManagementService.cs b/Services/ProcessManagement/IProcessManagementService.cs index f372a41..df1be52 100644 --- a/Services/ProcessManagement/IProcessManagementService.cs +++ b/Services/ProcessManagement/IProcessManagementService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ProcessMonitorManagerService.cs b/Services/ProcessMonitorManagerService.cs index ebb09c8..1ad9629 100644 --- a/Services/ProcessMonitorManagerService.cs +++ b/Services/ProcessMonitorManagerService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -295,7 +295,15 @@ namespace ThreadPilot.Services } } - private async void OnProcessStarted(object? sender, ProcessEventArgs e) + private void OnProcessStarted(object? sender, ProcessEventArgs e) + { + TaskSafety.FireAndForget(OnProcessStartedAsync(e), ex => + { + SetStatus(_isRunning, "Error handling process start", $"Error: {ex.Message}", ex); + }); + } + + private async Task OnProcessStartedAsync(ProcessEventArgs e) { if (!_isRunning || _configuration == null) return; @@ -348,7 +356,15 @@ namespace ThreadPilot.Services } } - private async void OnProcessStopped(object? sender, ProcessEventArgs e) + private void OnProcessStopped(object? sender, ProcessEventArgs e) + { + TaskSafety.FireAndForget(OnProcessStoppedAsync(e), ex => + { + SetStatus(_isRunning, "Error handling process stop", $"Error: {ex.Message}", ex); + }); + } + + private async Task OnProcessStoppedAsync(ProcessEventArgs e) { if (!_isRunning || _configuration == null) return; @@ -382,14 +398,25 @@ namespace ThreadPilot.Services if (_isRunning) { - Task.Run(async () => await EvaluateCurrentProcessesAsync()); + TaskSafety.FireAndForget(EvaluateCurrentProcessesAsync(), ex => + { + SetStatus(_isRunning, "Error evaluating processes", $"Error: {ex.Message}", ex); + }); } // Keep process monitor settings synchronized with configuration edits _processMonitorService.UpdateSettings(); } - private async void DelayedPowerPlanChangeCallback(object? state) + private void DelayedPowerPlanChangeCallback(object? state) + { + TaskSafety.FireAndForget(DelayedPowerPlanChangeCallbackAsync(), ex => + { + SetStatus(_isRunning, "Error in delayed power plan callback", $"Error: {ex.Message}", ex); + }); + } + + private async Task DelayedPowerPlanChangeCallbackAsync() { if (!_isRunning) return; @@ -485,19 +512,13 @@ namespace ThreadPilot.Services // Show error notification if there's an error if (error != null) { - Task.Run(async () => + TaskSafety.FireAndForget(_notificationService.ShowErrorNotificationAsync( + "Process Monitor Error", + details ?? status, + error), + ex => { - try - { - await _notificationService.ShowErrorNotificationAsync( - "Process Monitor Error", - details ?? status, - error); - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to show error notification"); - } + _logger.LogError(ex, "Failed to show error notification"); }); } } diff --git a/Services/ProcessMonitorService.cs b/Services/ProcessMonitorService.cs index cb406cb..bdd336b 100644 --- a/Services/ProcessMonitorService.cs +++ b/Services/ProcessMonitorService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -336,7 +336,15 @@ namespace ThreadPilot.Services Interlocked.Exchange(ref _isFallbackPollingInProgress, 0); } - private async void OnProcessStarted(object sender, EventArrivedEventArgs e) + private void OnProcessStarted(object sender, EventArrivedEventArgs e) + { + TaskSafety.FireAndForget(HandleProcessStartedAsync(e), ex => + { + OnMonitoringStatusChanged($"Error handling process start event: {ex.Message}", ex); + }); + } + + private async Task HandleProcessStartedAsync(EventArrivedEventArgs e) { if (!_isMonitoring || _disposed) { @@ -401,13 +409,22 @@ namespace ThreadPilot.Services return; } - _ = RunFallbackPollingAsync(); + var cancellationToken = _cancellationTokenSource?.Token ?? CancellationToken.None; + TaskSafety.FireAndForget(RunFallbackPollingAsync(cancellationToken), ex => + { + OnMonitoringStatusChanged($"Error in fallback polling: {ex.Message}", ex); + }); } - private async Task RunFallbackPollingAsync() + private async Task RunFallbackPollingAsync(CancellationToken cancellationToken) { try { + if (cancellationToken.IsCancellationRequested) + { + return; + } + var currentProcesses = await GetRunningProcessesAsync(); var currentProcessDict = currentProcesses.ToDictionary(p => p.ProcessId, p => p); @@ -530,7 +547,10 @@ namespace ThreadPilot.Services } else if (_enableWmiMonitoring && !previousWmiEnabled && !_isWmiAvailable) { - _ = Task.Run(async () => await TryStartWmiMonitoringAsync()); + TaskSafety.FireAndForget(TryStartWmiMonitoringAsync(), ex => + { + OnMonitoringStatusChanged($"Error recovering WMI monitoring: {ex.Message}", ex); + }); } if (!_enableFallbackPolling && _isFallbackPollingActive) @@ -566,7 +586,15 @@ namespace ThreadPilot.Services { if (_disposed) return; - StopMonitoringAsync().Wait(5000); // Wait up to 5 seconds for clean shutdown + try + { + StopMonitoringAsync().GetAwaiter().GetResult(); + } + catch (Exception ex) + { + OnMonitoringStatusChanged($"Error during process monitor disposal: {ex.Message}", ex); + } + _wmiStartSemaphore.Dispose(); _disposed = true; diff --git a/Services/ProcessPowerPlanAssociationService.cs b/Services/ProcessPowerPlanAssociationService.cs index 98a24a1..488bb37 100644 --- a/Services/ProcessPowerPlanAssociationService.cs +++ b/Services/ProcessPowerPlanAssociationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ProcessService.cs b/Services/ProcessService.cs index 7fb8c7e..ac77d41 100644 --- a/Services/ProcessService.cs +++ b/Services/ProcessService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/RetryPolicyService.cs b/Services/RetryPolicyService.cs index 97d98f9..994835d 100644 --- a/Services/RetryPolicyService.cs +++ b/Services/RetryPolicyService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; diff --git a/Services/SecurityService.cs b/Services/SecurityService.cs index 7906fc4..a7cb7f9 100644 --- a/Services/SecurityService.cs +++ b/Services/SecurityService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/ServiceConfiguration.cs b/Services/ServiceConfiguration.cs index 93bdf92..e8d0d53 100644 --- a/Services/ServiceConfiguration.cs +++ b/Services/ServiceConfiguration.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.DependencyInjection; diff --git a/Services/ServiceDisposalCoordinator.cs b/Services/ServiceDisposalCoordinator.cs index d33dab1..f15be64 100644 --- a/Services/ServiceDisposalCoordinator.cs +++ b/Services/ServiceDisposalCoordinator.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; diff --git a/Services/ServiceFactory.cs b/Services/ServiceFactory.cs index 435e110..592f8fd 100644 --- a/Services/ServiceFactory.cs +++ b/Services/ServiceFactory.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.DependencyInjection; diff --git a/Services/ServiceHealthMonitor.cs b/Services/ServiceHealthMonitor.cs index e211778..c3aacd9 100644 --- a/Services/ServiceHealthMonitor.cs +++ b/Services/ServiceHealthMonitor.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; diff --git a/Services/SmartNotificationService.cs b/Services/SmartNotificationService.cs index 42f9f12..3617707 100644 --- a/Services/SmartNotificationService.cs +++ b/Services/SmartNotificationService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Logging; @@ -334,7 +334,15 @@ namespace ThreadPilot.Services return await SendNotificationAsync(testNotification); } - private async void ProcessQueueCallback(object? state) + private void ProcessQueueCallback(object? state) + { + TaskSafety.FireAndForget(ProcessQueueCallbackAsync(), ex => + { + _logger.LogWarning(ex, "Error during notification queue processing"); + }); + } + + private async Task ProcessQueueCallbackAsync() { if (_disposed) return; @@ -536,19 +544,29 @@ namespace ThreadPilot.Services return preferences; } - private async Task LoadPreferencesAsync() + private Task LoadPreferencesAsync() { // Simplified - would load from actual storage _logger.LogDebug("Loaded notification preferences"); + return Task.CompletedTask; } - private async Task SavePreferencesAsync() + private Task SavePreferencesAsync() { // Simplified - would save to actual storage _logger.LogDebug("Saved notification preferences"); + return Task.CompletedTask; } - private async void CleanupCallback(object? state) + private void CleanupCallback(object? state) + { + TaskSafety.FireAndForget(CleanupCallbackAsync(), ex => + { + _logger.LogWarning(ex, "Error during notification cleanup"); + }); + } + + private async Task CleanupCallbackAsync() { try { diff --git a/Services/StoragePaths.cs b/Services/StoragePaths.cs index 7e13f3a..17f60a3 100644 --- a/Services/StoragePaths.cs +++ b/Services/StoragePaths.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/SystemTrayService.cs b/Services/SystemTrayService.cs index a1f8621..04c2ca8 100644 --- a/Services/SystemTrayService.cs +++ b/Services/SystemTrayService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/SystemTweaksService.cs b/Services/SystemTweaksService.cs index 3ae70f6..00ef430 100644 --- a/Services/SystemTweaksService.cs +++ b/Services/SystemTweaksService.cs @@ -3,18 +3,19 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Management; @@ -33,7 +34,16 @@ namespace ThreadPilot.Services { private static readonly string BcdEditExecutablePath = Path.Combine(Environment.SystemDirectory, "bcdedit.exe"); private static readonly string PowerCfgExecutablePath = Path.Combine(Environment.SystemDirectory, "powercfg.exe"); + private static readonly string ScExecutablePath = Path.Combine(Environment.SystemDirectory, "sc.exe"); + private static readonly HashSet AllowedExecutablePaths = new(StringComparer.OrdinalIgnoreCase) + { + Path.GetFullPath(BcdEditExecutablePath), + Path.GetFullPath(PowerCfgExecutablePath), + Path.GetFullPath(ScExecutablePath) + }; private static readonly Regex HexValueRegex = new("0x([0-9a-fA-F]+)", RegexOptions.Compiled); + private static readonly Regex ServiceNameRegex = new("^[A-Za-z0-9_.-]+$", RegexOptions.Compiled); + private static readonly TimeSpan ExternalCommandTimeout = TimeSpan.FromSeconds(20); private const string ProcessorSubgroupAlias = "SUB_PROCESSOR"; private const string CoreParkingSettingAlias = "CPMINCORES"; private const string CStatesSettingAlias = "IDLEDISABLE"; @@ -204,7 +214,7 @@ namespace ThreadPilot.Services } } - public async Task GetSysMainStatusAsync() + public Task GetSysMainStatusAsync() { try { @@ -213,17 +223,17 @@ namespace ThreadPilot.Services var isEnabled = serviceController.StartType != ServiceStartMode.Disabled; var isAvailable = true; - return new TweakStatus + return Task.FromResult(new TweakStatus { IsEnabled = isEnabled, IsAvailable = isAvailable, Description = "Windows Superfetch/SysMain service for memory management" - }; + }); } catch (Exception ex) { _logger.LogError(ex, "Error getting SysMain status"); - return new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }); } } @@ -238,7 +248,7 @@ namespace ThreadPilot.Services } using var serviceController = new ServiceController("SysMain"); - if (!SetServiceStartMode("SysMain", enabled ? ServiceStartMode.Automatic : ServiceStartMode.Disabled)) + if (!await SetServiceStartModeAsync("SysMain", enabled ? ServiceStartMode.Automatic : ServiceStartMode.Disabled)) { _logger.LogError("Failed to set SysMain startup mode"); return false; @@ -270,30 +280,30 @@ namespace ThreadPilot.Services } } - public async Task GetPrefetchStatusAsync() + public Task GetPrefetchStatusAsync() { try { using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters"); if (key == null) { - return new TweakStatus { IsAvailable = false, ErrorMessage = "Prefetch registry key not found" }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = "Prefetch registry key not found" }); } var enablePrefetcher = key.GetValue("EnablePrefetcher"); var isEnabled = enablePrefetcher?.ToString() != "0"; // 0 = disabled, 1-3 = enabled - return new TweakStatus + return Task.FromResult(new TweakStatus { IsEnabled = isEnabled, IsAvailable = true, Description = "Windows Prefetch feature for faster application loading" - }; + }); } catch (Exception ex) { _logger.LogError(ex, "Error getting Prefetch status"); - return new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }); } } @@ -330,31 +340,31 @@ namespace ThreadPilot.Services } } - public async Task GetPowerThrottlingStatusAsync() + public Task GetPowerThrottlingStatusAsync() { try { using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Power\PowerThrottling"); if (key == null) { - return new TweakStatus { IsAvailable = false, ErrorMessage = "Power Throttling not available on this system" }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = "Power Throttling not available on this system" }); } var powerThrottlingOff = ReadRegistryIntValue(key, "PowerThrottlingOff"); // ON = disable throttling (PowerThrottlingOff=1) var isEnabled = powerThrottlingOff.GetValueOrDefault(0) == 1; - return new TweakStatus + return Task.FromResult(new TweakStatus { IsEnabled = isEnabled, IsAvailable = true, Description = "ON disables Windows Power Throttling for sustained performance" - }; + }); } catch (Exception ex) { _logger.LogError(ex, "Error getting Power Throttling status"); - return new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }); } } @@ -395,24 +405,19 @@ namespace ThreadPilot.Services { try { - // Check HPET status via bcdedit - var processInfo = new ProcessStartInfo + var result = await RunProcessAsync(BcdEditExecutablePath, "/enum"); + if (result.ExitCode != 0) { - FileName = BcdEditExecutablePath, - Arguments = "/enum", - UseShellExecute = false, - RedirectStandardOutput = true, - CreateNoWindow = true - }; - - using var process = Process.Start(processInfo); - if (process == null) - { - return new TweakStatus { IsAvailable = false, ErrorMessage = "Could not start bcdedit process" }; + return new TweakStatus + { + IsAvailable = false, + ErrorMessage = string.IsNullOrWhiteSpace(result.StandardError) + ? "Could not query bcdedit status" + : result.StandardError + }; } - var output = await process.StandardOutput.ReadToEndAsync(); - await process.WaitForExitAsync(); + var output = result.StandardOutput; var platformClockLine = output.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries) .FirstOrDefault(l => l.TrimStart().StartsWith("useplatformclock", StringComparison.OrdinalIgnoreCase)); @@ -450,24 +455,8 @@ namespace ThreadPilot.Services // ON = disable HPET (/deletevalue), OFF = force HPET (/set true) var arguments = enabled ? "/deletevalue useplatformclock" : "/set useplatformclock true"; - var processInfo = new ProcessStartInfo - { - FileName = BcdEditExecutablePath, - Arguments = arguments, - UseShellExecute = false, - RedirectStandardOutput = true, - CreateNoWindow = true - }; - - using var process = Process.Start(processInfo); - if (process == null) - { - _logger.LogError("Could not start bcdedit process"); - return false; - } - - await process.WaitForExitAsync(); - var success = process.ExitCode == 0; + var commandResult = await RunProcessAsync(BcdEditExecutablePath, arguments); + var success = commandResult.ExitCode == 0; if (success) { @@ -475,6 +464,11 @@ namespace ThreadPilot.Services TweakStatusChanged?.Invoke(this, new TweakStatusChangedEventArgs("Hpet", status)); _logger.LogInformation("HPET {Status}", enabled ? "enabled" : "disabled"); } + else + { + _logger.LogWarning("Failed to set HPET. ExitCode={ExitCode}, Error={Error}", + commandResult.ExitCode, commandResult.StandardError); + } return success; } @@ -485,30 +479,30 @@ namespace ThreadPilot.Services } } - public async Task GetHighSchedulingCategoryStatusAsync() + public Task GetHighSchedulingCategoryStatusAsync() { try { using var key = Registry.LocalMachine.OpenSubKey(PriorityControlKeyPath); if (key == null) { - return new TweakStatus { IsAvailable = false, ErrorMessage = "PriorityControl registry key not found" }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = "PriorityControl registry key not found" }); } var rawValue = ReadRegistryIntValue(key, PrioritySeparationValueName); var isEnabled = rawValue.GetValueOrDefault(2) == 38; - return new TweakStatus + return Task.FromResult(new TweakStatus { IsEnabled = isEnabled, IsAvailable = true, Description = "ON applies high foreground boost (Win32PrioritySeparation=38)" - }; + }); } catch (Exception ex) { _logger.LogError(ex, "Error getting High Scheduling Category status"); - return new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }); } } @@ -545,8 +539,14 @@ namespace ThreadPilot.Services } } - private bool SetServiceStartMode(string serviceName, ServiceStartMode mode) + private async Task SetServiceStartModeAsync(string serviceName, ServiceStartMode mode) { + if (!ServiceNameRegex.IsMatch(serviceName)) + { + _logger.LogWarning("Rejected invalid service name format: {ServiceName}", serviceName); + return false; + } + var startModeValue = mode switch { ServiceStartMode.Automatic => "auto", @@ -555,29 +555,11 @@ namespace ThreadPilot.Services _ => "demand" }; - var processInfo = new ProcessStartInfo + var result = await RunProcessAsync(ScExecutablePath, $"config \"{serviceName}\" start= {startModeValue}"); + if (result.ExitCode != 0) { - FileName = Path.Combine(Environment.SystemDirectory, "sc.exe"), - Arguments = $"config \"{serviceName}\" start= {startModeValue}", - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true - }; - - using var process = Process.Start(processInfo); - if (process == null) - { - _logger.LogError("Could not start sc.exe to update service start mode for {ServiceName}", serviceName); - return false; - } - - process.WaitForExit(); - if (process.ExitCode != 0) - { - var error = process.StandardError.ReadToEnd(); _logger.LogWarning("Failed to update service start mode for {ServiceName}. ExitCode={ExitCode}, Error={Error}", - serviceName, process.ExitCode, error); + serviceName, result.ExitCode, result.StandardError); return false; } @@ -630,9 +612,14 @@ namespace ThreadPilot.Services private static async Task RunProcessAsync(string fileName, string arguments) { + if (!IsAllowedExecutable(fileName)) + { + return new ProcessResult(-1, string.Empty, $"Executable not allowed: {fileName}"); + } + var processInfo = new ProcessStartInfo { - FileName = fileName, + FileName = Path.GetFullPath(fileName), Arguments = arguments, UseShellExecute = false, RedirectStandardOutput = true, @@ -648,11 +635,38 @@ namespace ThreadPilot.Services var outputTask = process.StandardOutput.ReadToEndAsync(); var errorTask = process.StandardError.ReadToEndAsync(); - await process.WaitForExitAsync(); + var exitTask = process.WaitForExitAsync(); + var completedTask = await Task.WhenAny(exitTask, Task.Delay(ExternalCommandTimeout)); + if (completedTask != exitTask) + { + try + { + process.Kill(entireProcessTree: true); + } + catch + { + // Best-effort kill for stuck child processes. + } + + return new ProcessResult(-1, await outputTask, $"Process timed out after {ExternalCommandTimeout.TotalSeconds} seconds"); + } + + await exitTask; return new ProcessResult(process.ExitCode, await outputTask, await errorTask); } + private static bool IsAllowedExecutable(string fileName) + { + if (string.IsNullOrWhiteSpace(fileName) || !Path.IsPathRooted(fileName)) + { + return false; + } + + var fullPath = Path.GetFullPath(fileName); + return AllowedExecutablePaths.Contains(fullPath) && File.Exists(fullPath); + } + private static int? ReadRegistryIntValue(RegistryKey key, string valueName) { var raw = key.GetValue(valueName); @@ -666,32 +680,46 @@ namespace ThreadPilot.Services }; } - private readonly record struct ProcessResult(int ExitCode, string StandardOutput, string StandardError); + private readonly struct ProcessResult + { + public ProcessResult(int exitCode, string standardOutput, string standardError) + { + ExitCode = exitCode; + StandardOutput = standardOutput; + StandardError = standardError; + } - public async Task GetMenuShowDelayStatusAsync() + public int ExitCode { get; } + + public string StandardOutput { get; } + + public string StandardError { get; } + } + + public Task GetMenuShowDelayStatusAsync() { try { using var key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop"); if (key == null) { - return new TweakStatus { IsAvailable = false, ErrorMessage = "Desktop registry key not found" }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = "Desktop registry key not found" }); } var menuShowDelay = key.GetValue("MenuShowDelay"); var isEnabled = menuShowDelay?.ToString() != "0"; // 0 = no delay, >0 = delay enabled - return new TweakStatus + return Task.FromResult(new TweakStatus { IsEnabled = isEnabled, IsAvailable = true, Description = "Delay before showing context menus" - }; + }); } catch (Exception ex) { _logger.LogError(ex, "Error getting Menu Show Delay status"); - return new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }; + return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message }); } } diff --git a/Services/TaskSafety.cs b/Services/TaskSafety.cs new file mode 100644 index 0000000..8fc969a --- /dev/null +++ b/Services/TaskSafety.cs @@ -0,0 +1,45 @@ +/* + * ThreadPilot - Advanced Windows Process and Power Plan Manager + * Copyright (C) 2025 Prime Build + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 only. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +using System; +using System.Threading.Tasks; + +namespace ThreadPilot.Services +{ + internal static class TaskSafety + { + public static void FireAndForget(Task task, Action onError) + { + _ = ObserveAsync(task, onError); + } + + private static async Task ObserveAsync(Task task, Action onError) + { + try + { + await task.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + // Cancellation is expected in shutdown paths. + } + catch (Exception ex) + { + onError(ex); + } + } + } +} diff --git a/Services/ThemeService.cs b/Services/ThemeService.cs index 660c8a1..04f9e3d 100644 --- a/Services/ThemeService.cs +++ b/Services/ThemeService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Services/VirtualizedProcessService.cs b/Services/VirtualizedProcessService.cs index a2d6510..da2d24e 100644 --- a/Services/VirtualizedProcessService.cs +++ b/Services/VirtualizedProcessService.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.Caching.Memory; @@ -262,7 +262,15 @@ namespace ThreadPilot.Services return (int)Math.Ceiling((double)totalCount / Configuration.BatchSize); } - private async void BackgroundPreloadCallback(object? state) + private void BackgroundPreloadCallback(object? state) + { + TaskSafety.FireAndForget(BackgroundPreloadCallbackAsync(), ex => + { + _logger.LogWarning(ex, "Background process refresh failed"); + }); + } + + private async Task BackgroundPreloadCallbackAsync() { try { diff --git a/TRADEMARK.md b/TRADEMARK.md index 6e822da..6380c07 100644 --- a/TRADEMARK.md +++ b/TRADEMARK.md @@ -1,7 +1,7 @@ # Trademark Policy The name "ThreadPilot", the logo, and all branding elements associated with this project -are NOT licensed under the GNU General Public License v3.0. +are NOT licensed under the GNU Affero General Public License v3.0. ## Usage Restrictions diff --git a/Tests/ActiveApplicationsTest.cs b/Tests/ActiveApplicationsTest.cs index 69a5a82..94ba39a 100644 --- a/Tests/ActiveApplicationsTest.cs +++ b/Tests/ActiveApplicationsTest.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/CpuTopologyServiceTests.cs b/Tests/CpuTopologyServiceTests.cs index 0f66fe5..06b1248 100644 --- a/Tests/CpuTopologyServiceTests.cs +++ b/Tests/CpuTopologyServiceTests.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/ExecutableBrowseTest.cs b/Tests/ExecutableBrowseTest.cs index 38046c1..28754df 100644 --- a/Tests/ExecutableBrowseTest.cs +++ b/Tests/ExecutableBrowseTest.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/GameBoostIntegrationTest.cs b/Tests/GameBoostIntegrationTest.cs index 8c3685f..90f17fc 100644 --- a/Tests/GameBoostIntegrationTest.cs +++ b/Tests/GameBoostIntegrationTest.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/ProcessSelectionTest.cs b/Tests/ProcessSelectionTest.cs index 486fdad..443caf5 100644 --- a/Tests/ProcessSelectionTest.cs +++ b/Tests/ProcessSelectionTest.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/TestRunner.cs b/Tests/TestRunner.cs index e414485..4461b2d 100644 --- a/Tests/TestRunner.cs +++ b/Tests/TestRunner.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Tests/ThreadPilot.Core.Tests/AutostartServiceTests.cs b/Tests/ThreadPilot.Core.Tests/AutostartServiceTests.cs new file mode 100644 index 0000000..576313b --- /dev/null +++ b/Tests/ThreadPilot.Core.Tests/AutostartServiceTests.cs @@ -0,0 +1,49 @@ +/* + * ThreadPilot - autostart service unit tests. + */ +namespace ThreadPilot.Core.Tests +{ + using Microsoft.Extensions.Logging.Abstractions; + using Moq; + using ThreadPilot.Services; + + /// + /// Unit tests for non-registry behavior in . + /// + public sealed class AutostartServiceTests + { + /// + /// Ensures autostart arguments include both autostart and start-minimized flags when requested. + /// + [Fact] + public void GetAutostartArguments_IncludesStartMinimized_WhenRequested() + { + var service = CreateService(); + + var args = service.GetAutostartArguments(startMinimized: true); + + Assert.Contains("--start-minimized", args, StringComparison.Ordinal); + Assert.Contains("--autostart", args, StringComparison.Ordinal); + } + + /// + /// Ensures start-minimized is omitted when not requested. + /// + [Fact] + public void GetAutostartArguments_OmitsStartMinimized_WhenNotRequested() + { + var service = CreateService(); + + var args = service.GetAutostartArguments(startMinimized: false); + + Assert.DoesNotContain("--start-minimized", args, StringComparison.Ordinal); + Assert.Equal("--autostart", args); + } + + private static AutostartService CreateService() + { + var elevationService = new Mock(MockBehavior.Loose); + return new AutostartService(NullLogger.Instance, elevationService.Object); + } + } +} diff --git a/Tests/ThreadPilot.Core.Tests/TaskSafetyTests.cs b/Tests/ThreadPilot.Core.Tests/TaskSafetyTests.cs new file mode 100644 index 0000000..0a8eb97 --- /dev/null +++ b/Tests/ThreadPilot.Core.Tests/TaskSafetyTests.cs @@ -0,0 +1,47 @@ +/* + * ThreadPilot - async safety unit tests. + */ +namespace ThreadPilot.Core.Tests +{ + using ThreadPilot.Services; + + /// + /// Unit tests for . + /// + public sealed class TaskSafetyTests + { + /// + /// Ensures faulted tasks are observed and routed to the provided callback. + /// + [Fact] + public async Task FireAndForget_InvokesErrorCallback_ForFaultedTask() + { + var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var expected = new InvalidOperationException("boom"); + + TaskSafety.FireAndForget(Task.FromException(expected), ex => completion.TrySetResult(ex)); + + var finishedTask = await Task.WhenAny(completion.Task, Task.Delay(TimeSpan.FromSeconds(2))); + Assert.Same(completion.Task, finishedTask); + var observed = await completion.Task; + Assert.IsType(observed); + Assert.Equal("boom", observed.Message); + } + + /// + /// Ensures cancellation does not trigger the error callback. + /// + [Fact] + public async Task FireAndForget_DoesNotInvokeErrorCallback_ForCanceledTask() + { + var callbackInvoked = false; + using var cancellation = new CancellationTokenSource(); + cancellation.Cancel(); + + TaskSafety.FireAndForget(Task.FromCanceled(cancellation.Token), _ => callbackInvoked = true); + + await Task.Delay(150); + Assert.False(callbackInvoked); + } + } +} diff --git a/ViewModels/BaseViewModel.cs b/ViewModels/BaseViewModel.cs index 900a5f6..2fd42db 100644 --- a/ViewModels/BaseViewModel.cs +++ b/ViewModels/BaseViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using CommunityToolkit.Mvvm.ComponentModel; diff --git a/ViewModels/LogViewerViewModel.cs b/ViewModels/LogViewerViewModel.cs index e878a1f..0a14553 100644 --- a/ViewModels/LogViewerViewModel.cs +++ b/ViewModels/LogViewerViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index 0acb02d..0f3a0e5 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using CommunityToolkit.Mvvm.ComponentModel; diff --git a/ViewModels/MasksViewModel.cs b/ViewModels/MasksViewModel.cs index 1dcb735..c4f0fb7 100644 --- a/ViewModels/MasksViewModel.cs +++ b/ViewModels/MasksViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -329,7 +329,15 @@ namespace ThreadPilot.ViewModels } } - private async void OnBoolMaskCollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + private void OnBoolMaskCollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + TaskSafety.FireAndForget(OnBoolMaskCollectionChangedAsync(), ex => + { + _logger.LogWarning(ex, "Failed to handle mask collection change"); + }); + } + + private async Task OnBoolMaskCollectionChangedAsync() { // Auto-save when BoolMask changes (like CPUSetSetter's auto-save pattern) await SaveCurrentMaskAsync(); @@ -341,7 +349,15 @@ namespace ThreadPilot.ViewModels } } - private async void OnMaskPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + private void OnMaskPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + TaskSafety.FireAndForget(OnMaskPropertyChangedAsync(e), ex => + { + _logger.LogWarning(ex, "Failed to handle mask property change"); + }); + } + + private async Task OnMaskPropertyChangedAsync(System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(CoreMask.Name) || e.PropertyName == nameof(CoreMask.Description) || diff --git a/ViewModels/PerformanceViewModel.cs b/ViewModels/PerformanceViewModel.cs index 4664567..3f80aad 100644 --- a/ViewModels/PerformanceViewModel.cs +++ b/ViewModels/PerformanceViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/PowerPlanViewModel.cs b/ViewModels/PowerPlanViewModel.cs index 932f56b..9cab209 100644 --- a/ViewModels/PowerPlanViewModel.cs +++ b/ViewModels/PowerPlanViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/ProcessPowerPlanAssociationViewModel.cs b/ViewModels/ProcessPowerPlanAssociationViewModel.cs index 23ce4bd..e4c69f2 100644 --- a/ViewModels/ProcessPowerPlanAssociationViewModel.cs +++ b/ViewModels/ProcessPowerPlanAssociationViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/ProcessViewModel.cs b/ViewModels/ProcessViewModel.cs index 106df16..a33b57a 100644 --- a/ViewModels/ProcessViewModel.cs +++ b/ViewModels/ProcessViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -193,18 +193,18 @@ namespace ThreadPilot.ViewModels _virtualizedProcessService.BackgroundBatchLoaded += OnBackgroundBatchLoaded; } - private async void OnBatchLoadProgress(object? sender, BatchLoadProgressEventArgs e) + private void OnBatchLoadProgress(object? sender, BatchLoadProgressEventArgs e) { - await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => + _ = System.Windows.Application.Current.Dispatcher.InvokeAsync(() => { LoadingProgress = e.ProgressPercentage; LoadingStatusText = e.StatusMessage; }); } - private async void OnBackgroundBatchLoaded(object? sender, ProcessBatchResult e) + private void OnBackgroundBatchLoaded(object? sender, ProcessBatchResult e) { - await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => + _ = System.Windows.Application.Current.Dispatcher.InvokeAsync(() => { // Background batch loaded - could update UI if needed Logger.LogDebug("Background batch {BatchIndex} loaded with {ProcessCount} processes", @@ -302,82 +302,9 @@ namespace ThreadPilot.ViewModels { _hasPendingAffinityEdits = false; // Immediately fetch and display real-time process information - _ = Task.Run(async () => + TaskSafety.FireAndForget(HandleSelectedProcessChangedAsync(value), ex => { - try - { - // First check if the process is still running - bool isStillRunning = await _processService.IsProcessStillRunning(value); - if (!isStillRunning) - { - System.Windows.Application.Current.Dispatcher.Invoke(() => - { - SetStatus($"Process {value.Name} (PID: {value.ProcessId}) has terminated", false); - SelectedProcess = null; - ClearProcessSelection(); - }); - return; - } - - // Refresh process info to get current state from OS - await _processService.RefreshProcessInfo(value); - - // Update UI on main thread with fresh data - System.Windows.Application.Current.Dispatcher.Invoke(() => - { - // Update CPU affinity display - // If a Core Mask is selected, show that instead of the process's current affinity - // This ensures visual coherence between selected mask and Advanced CPU Affinity - if (SelectedCoreMask != null) - { - UpdateCoreSelectionsFromMask(SelectedCoreMask); - // Auto-apply the selected mask to the newly selected process - _ = ApplyCoreMaskToProcessAsync(SelectedCoreMask); - } - else - { - // No mask selected - show process's current affinity - UpdateCoreSelections(value.ProcessorAffinity); - - // Force ProcessorAffinity notification for DataGrid column - // Ensures Affinity column displays the correct current value immediately - value.ForceNotifyProcessorAffinityChanged(); - } - - // Update priority display - trigger property change to refresh ComboBox - OnPropertyChanged(nameof(SelectedProcess)); - - // Update feature states from the selected process - IsIdleServerDisabled = value.IsIdleServerDisabled; - IsRegistryPriorityEnabled = value.IsRegistryPriorityEnabled; - - // BUG FIX: Update status without setting busy state for process selection - SetStatus($"Selected process: {value.Name} (PID: {value.ProcessId}) - " + - $"Priority: {value.Priority}, Affinity: 0x{value.ProcessorAffinity:X}", false); - }); - - // Load current power plan association if available - await LoadProcessPowerPlanAssociation(value); - } - catch (InvalidOperationException ex) when (ex.Message.Contains("terminated") || ex.Message.Contains("exited") || ex.Message.Contains("no longer exists")) - { - // Process has terminated - Logger.LogInformation("Process {ProcessName} (PID: {ProcessId}) has terminated", value.Name, value.ProcessId); - System.Windows.Application.Current.Dispatcher.Invoke(() => - { - SetStatus($"Process {value.Name} (PID: {value.ProcessId}) has terminated", false); - SelectedProcess = null; - ClearProcessSelection(); - }); - } - catch (Exception ex) - { - Logger.LogWarning(ex, "Failed to refresh process info for {ProcessName}", value.Name); - System.Windows.Application.Current.Dispatcher.Invoke(() => - { - SetStatus($"Warning: Could not access process {value.Name} - it may have terminated or require elevated privileges", false); - }); - } + Logger.LogWarning(ex, "Failed while handling selected process change for {ProcessName}", value.Name); }); } else if (value == null) @@ -390,7 +317,93 @@ namespace ThreadPilot.ViewModels _systemTrayService.UpdateContextMenu(value?.Name, value != null); } - private async void OnTrayQuickApplyRequested(object? sender, EventArgs e) + private async Task HandleSelectedProcessChangedAsync(ProcessModel value) + { + try + { + // First check if the process is still running + bool isStillRunning = await _processService.IsProcessStillRunning(value); + if (!isStillRunning) + { + System.Windows.Application.Current.Dispatcher.Invoke(() => + { + SetStatus($"Process {value.Name} (PID: {value.ProcessId}) has terminated", false); + SelectedProcess = null; + ClearProcessSelection(); + }); + return; + } + + // Refresh process info to get current state from OS + await _processService.RefreshProcessInfo(value); + + // Update UI on main thread with fresh data + System.Windows.Application.Current.Dispatcher.Invoke(() => + { + // Update CPU affinity display + // If a Core Mask is selected, show that instead of the process's current affinity + // This ensures visual coherence between selected mask and Advanced CPU Affinity + if (SelectedCoreMask != null) + { + UpdateCoreSelectionsFromMask(SelectedCoreMask); + // Auto-apply the selected mask to the newly selected process + _ = ApplyCoreMaskToProcessAsync(SelectedCoreMask); + } + else + { + // No mask selected - show process's current affinity + UpdateCoreSelections(value.ProcessorAffinity); + + // Force ProcessorAffinity notification for DataGrid column + // Ensures Affinity column displays the correct current value immediately + value.ForceNotifyProcessorAffinityChanged(); + } + + // Update priority display - trigger property change to refresh ComboBox + OnPropertyChanged(nameof(SelectedProcess)); + + // Update feature states from the selected process + IsIdleServerDisabled = value.IsIdleServerDisabled; + IsRegistryPriorityEnabled = value.IsRegistryPriorityEnabled; + + // BUG FIX: Update status without setting busy state for process selection + SetStatus($"Selected process: {value.Name} (PID: {value.ProcessId}) - " + + $"Priority: {value.Priority}, Affinity: 0x{value.ProcessorAffinity:X}", false); + }); + + // Load current power plan association if available + await LoadProcessPowerPlanAssociation(value); + } + catch (InvalidOperationException ex) when (ex.Message.Contains("terminated") || ex.Message.Contains("exited") || ex.Message.Contains("no longer exists")) + { + // Process has terminated + Logger.LogInformation("Process {ProcessName} (PID: {ProcessId}) has terminated", value.Name, value.ProcessId); + System.Windows.Application.Current.Dispatcher.Invoke(() => + { + SetStatus($"Process {value.Name} (PID: {value.ProcessId}) has terminated", false); + SelectedProcess = null; + ClearProcessSelection(); + }); + } + catch (Exception ex) + { + Logger.LogWarning(ex, "Failed to refresh process info for {ProcessName}", value.Name); + System.Windows.Application.Current.Dispatcher.Invoke(() => + { + SetStatus($"Warning: Could not access process {value.Name} - it may have terminated or require elevated privileges", false); + }); + } + } + + private void OnTrayQuickApplyRequested(object? sender, EventArgs e) + { + TaskSafety.FireAndForget(OnTrayQuickApplyRequestedAsync(), ex => + { + Logger.LogWarning(ex, "Quick apply request failed"); + }); + } + + private async Task OnTrayQuickApplyRequestedAsync() { try { diff --git a/ViewModels/SettingsViewModel.cs b/ViewModels/SettingsViewModel.cs index daab2cd..45c619e 100644 --- a/ViewModels/SettingsViewModel.cs +++ b/ViewModels/SettingsViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/SystemTweaksViewModel.cs b/ViewModels/SystemTweaksViewModel.cs index 493f073..8517a27 100644 --- a/ViewModels/SystemTweaksViewModel.cs +++ b/ViewModels/SystemTweaksViewModel.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/ViewModels/ViewModelFactory.cs b/ViewModels/ViewModelFactory.cs index ca70777..a1e34e5 100644 --- a/ViewModels/ViewModelFactory.cs +++ b/ViewModels/ViewModelFactory.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using Microsoft.Extensions.DependencyInjection; diff --git a/Views/LogViewerView.xaml.cs b/Views/LogViewerView.xaml.cs index cbadeac..740bacf 100644 --- a/Views/LogViewerView.xaml.cs +++ b/Views/LogViewerView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; @@ -19,6 +19,7 @@ using System.Globalization; using System.Windows; using System.Windows.Controls; using System.Windows.Data; +using ThreadPilot.Services; using ThreadPilot.ViewModels; namespace ThreadPilot.Views @@ -34,7 +35,15 @@ namespace ThreadPilot.Views Loaded += OnLoaded; } - private async void OnLoaded(object sender, RoutedEventArgs e) + private void OnLoaded(object sender, RoutedEventArgs e) + { + TaskSafety.FireAndForget(OnLoadedAsync(), _ => + { + // Keep the view loaded even if background initialization fails. + }); + } + + private async Task OnLoadedAsync() { if (DataContext is LogViewerViewModel viewModel) { diff --git a/Views/MasksView.xaml.cs b/Views/MasksView.xaml.cs index 058e178..4862261 100644 --- a/Views/MasksView.xaml.cs +++ b/Views/MasksView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using ThreadPilot.Helpers; diff --git a/Views/PerformanceView.xaml.cs b/Views/PerformanceView.xaml.cs index a0f5c25..d576237 100644 --- a/Views/PerformanceView.xaml.cs +++ b/Views/PerformanceView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows.Controls; diff --git a/Views/PowerPlanView.xaml.cs b/Views/PowerPlanView.xaml.cs index 7588ac0..84d28a0 100644 --- a/Views/PowerPlanView.xaml.cs +++ b/Views/PowerPlanView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows.Controls; diff --git a/Views/ProcessPowerPlanAssociationView.xaml.cs b/Views/ProcessPowerPlanAssociationView.xaml.cs index 7ae51f7..726e7ae 100644 --- a/Views/ProcessPowerPlanAssociationView.xaml.cs +++ b/Views/ProcessPowerPlanAssociationView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using WpfUserControl = System.Windows.Controls.UserControl; diff --git a/Views/ProcessView.xaml.cs b/Views/ProcessView.xaml.cs index 6e15d86..a6395db 100644 --- a/Views/ProcessView.xaml.cs +++ b/Views/ProcessView.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows.Controls; diff --git a/Views/SettingsView.xaml b/Views/SettingsView.xaml index 3553cf3..d4779f9 100644 --- a/Views/SettingsView.xaml +++ b/Views/SettingsView.xaml @@ -317,7 +317,7 @@ - + diff --git a/Views/SettingsView.xaml.cs b/Views/SettingsView.xaml.cs index d19bd63..fd3dd9b 100644 --- a/Views/SettingsView.xaml.cs +++ b/Views/SettingsView.xaml.cs @@ -3,19 +3,20 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows; using System.Windows.Controls; +using ThreadPilot.Services; using ThreadPilot.ViewModels; namespace ThreadPilot.Views @@ -36,7 +37,15 @@ namespace ThreadPilot.Views DataContext = viewModel; } - private async void SettingsView_Loaded(object sender, RoutedEventArgs e) + private void SettingsView_Loaded(object sender, RoutedEventArgs e) + { + TaskSafety.FireAndForget(SettingsView_LoadedAsync(), _ => + { + // Non-critical load refresh failures are handled by the view model. + }); + } + + private async Task SettingsView_LoadedAsync() { if (DataContext is SettingsViewModel viewModel) { diff --git a/Views/SettingsWindow.xaml.cs b/Views/SettingsWindow.xaml.cs index 647f3fe..ebd849f 100644 --- a/Views/SettingsWindow.xaml.cs +++ b/Views/SettingsWindow.xaml.cs @@ -3,15 +3,15 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System; diff --git a/Views/SystemTweaksView.xaml.cs b/Views/SystemTweaksView.xaml.cs index 60586b8..0e1ce55 100644 --- a/Views/SystemTweaksView.xaml.cs +++ b/Views/SystemTweaksView.xaml.cs @@ -3,18 +3,19 @@ * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ using System.Windows.Controls; +using ThreadPilot.Services; using ThreadPilot.ViewModels; namespace ThreadPilot.Views @@ -29,7 +30,15 @@ namespace ThreadPilot.Views InitializeComponent(); } - private async void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) + private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) + { + TaskSafety.FireAndForget(UserControl_LoadedAsync(), _ => + { + // Ignore non-fatal loading errors to keep the view responsive. + }); + } + + private async Task UserControl_LoadedAsync() { if (DataContext is SystemTweaksViewModel viewModel) {