[EnvVar][Hosts][RegPrev]Decouple and refactor to make it "packable" as nuget package (#32604)

* WIP Hosts - remove deps

* Add consumer app

* Move App and MainWindow to Consumer app. Make Hosts dll

* Try consume it

* Fix errors

* Make it work with custom build targets

* Dependency injection
Refactor
Explicit page creation
Wire missing dependencies

* Fix installer

* Remove unneeded stuff

* Fix build again

* Extract UI and logic from MainWindow to RegistryPreviewMainPage

* Convert to lib
Change namespace to RegistryPreviewUILib
Remove PT deps

* Add exe app and move App.xaml and MainWindow.xaml

* Consume the lib

* Update Hosts package creation

* Fix RegistryPreview package creation

* Rename RegistryPreviewUI back to RegistryPreview

* Back to consuming lib

* Ship icons and assets in nuget packages

* Rename to EnvironmentVariablesUILib and convert to lib

* Add app and consume

* Telemetry

* GPO

* nuget

* Rename HostsPackageConsumer to Hosts and Hosts lib to HostsUILib

* Assets cleanup

* nuget struct

* v0

* assets

* [Hosts] Re-add AppList to Lib Assets, [RegPrev] Copy lib assets to out dir

* Sign UI dlls

* Revert WinUIEx bump

* Cleanup

* Align deps

* version exception dll

* Fix RegistryPreview crashes

* XAML format

* XAML format 2

* Pack .pri files in lib/ dir

---------

Co-authored-by: Darshak Bhatti <dabhatti@microsoft.com>
This commit is contained in:
Stefan Markovic
2024-04-26 19:41:44 +02:00
committed by GitHub
parent 28ba2bd301
commit 41a0114efe
125 changed files with 2097 additions and 1212 deletions

View File

@@ -0,0 +1,286 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DefaultSetsLabel.Text" xml:space="preserve">
<value>Default variables</value>
</data>
<data name="DefaultVariablesLbl.Text" xml:space="preserve">
<value>Default variables</value>
</data>
<data name="NewProfileBtn.Text" xml:space="preserve">
<value>New profile</value>
</data>
<data name="ProfilesDescriptionLbl.Text" xml:space="preserve">
<value>You can create profiles to quickly apply a set of preconfigured variables</value>
</data>
<data name="ProfilesLbl.Text" xml:space="preserve">
<value>Profiles</value>
</data>
<data name="System" xml:space="preserve">
<value>System</value>
</data>
<data name="User" xml:space="preserve">
<value>User</value>
</data>
<data name="WindowTitle" xml:space="preserve">
<value>Environment Variables</value>
<comment>Title of the window when running as user</comment>
</data>
<data name="EditDialog.CloseButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="EditVariableDialog_Title" xml:space="preserve">
<value>Edit variable</value>
</data>
<data name="NewProfileNameTxtBox.Header" xml:space="preserve">
<value>Name</value>
</data>
<data name="SaveBtn" xml:space="preserve">
<value>Save</value>
</data>
<data name="ValueTxtBox.Header" xml:space="preserve">
<value>Value</value>
</data>
<data name="AddBtn" xml:space="preserve">
<value>Save</value>
</data>
<data name="AddNewProfileDialog_Title" xml:space="preserve">
<value>New profile</value>
</data>
<data name="NewProfileEnabled.Header" xml:space="preserve">
<value>Enabled</value>
</data>
<data name="AddVariableBtn.Text" xml:space="preserve">
<value>Add variable</value>
</data>
<data name="AddNewVariableName.Header" xml:space="preserve">
<value>Name</value>
<comment>Name as in Environment variable name</comment>
</data>
<data name="AddNewVariableValue.Header" xml:space="preserve">
<value>Value</value>
<comment>Value as in Environment variable value</comment>
</data>
<data name="ExistingVariableSegmentedButton.Content" xml:space="preserve">
<value>Existing</value>
</data>
<data name="NewVariableSegmentedButton.Content" xml:space="preserve">
<value>New</value>
</data>
<data name="WindowAdminTitle" xml:space="preserve">
<value>Administrator: Environment Variables</value>
<comment>Title of the window when running as administrator</comment>
</data>
<data name="CancelAddVariableBtn.Content" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ConfirmAddVariableBtn.Content" xml:space="preserve">
<value>Add</value>
</data>
<data name="AppliedVariablesDescriptionLbl.Text" xml:space="preserve">
<value>List of applied variables</value>
</data>
<data name="AppliedVariablesLbl.Text" xml:space="preserve">
<value>Applied variables</value>
</data>
<data name="NewProfileVariablesListViewHeader.Text" xml:space="preserve">
<value>Variables</value>
</data>
<data name="DeleteMenuItem.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="Delete_Dialog_Description" xml:space="preserve">
<value>Are you sure you want to delete this profile? Deleting applied profile will remove all profile variables.</value>
</data>
<data name="EditSystemDefaultSetInfoBar.Text" xml:space="preserve">
<value>Administrator permissions are required to edit System variables</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>
<data name="StateNotUpToDateTitle" xml:space="preserve">
<value>Changes were made outside of this app.</value>
</data>
<data name="StateNotUpToDateOnStartupMsg" xml:space="preserve">
<value>Variables included in applied profile have been modified. Review the latest changes before applying the profile again.</value>
</data>
<data name="CancelBtn" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="StateNotUpToDateEnvironmentMessageReceivedMsg" xml:space="preserve">
<value>Variables have been modified. Reload to get the latest changes.</value>
</data>
<data name="AddVariable_Title" xml:space="preserve">
<value>Add variable</value>
</data>
<data name="Delete_Variable_Description" xml:space="preserve">
<value>Are you sure you want to delete this variable?</value>
</data>
<data name="EditProfileDialog_Title" xml:space="preserve">
<value>Edit profile</value>
</data>
<data name="AddVariableTooltip.Text" xml:space="preserve">
<value>Add variable</value>
</data>
<data name="DefaultVariablesDescriptionLbl.Text" xml:space="preserve">
<value>Add, remove or edit USER and SYSTEM variables</value>
</data>
<data name="EditItem.Text" xml:space="preserve">
<value>Edit</value>
</data>
<data name="More_Options_ButtonTooltip.Text" xml:space="preserve">
<value>More options</value>
</data>
<data name="MoveDown.Text" xml:space="preserve">
<value>Move down</value>
</data>
<data name="MoveUp.Text" xml:space="preserve">
<value>Move up</value>
</data>
<data name="InsertListEntryBefore.Text" xml:space="preserve">
<value>Insert Before</value>
</data>
<data name="InsertListEntryAfter.Text" xml:space="preserve">
<value>Insert After</value>
</data>
<data name="NewProfileVariablesListViewApplyToSystemHeader.Text" xml:space="preserve">
<value>Apply to SYSTEM?</value>
</data>
<data name="RemoveListItem.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="RemoveItem.Text" xml:space="preserve">
<value>Remove</value>
</data>
<data name="AddVariableContent.Content" xml:space="preserve">
<value>Add variable</value>
</data>
<data name="ProfileNotApplicableTitle" xml:space="preserve">
<value>Profile can not be applied.</value>
</data>
<data name="StateProfileNotApplicableMsg" xml:space="preserve">
<value>Variables or backup variables are invalid.</value>
</data>
<data name="VariableIsAppliedByActiveProfileTooltip.Text" xml:space="preserve">
<value>This variable is written by the active profile</value>
</data>
</root>