Installer UI (WIP)

This commit is contained in:
Elizabeth Cray 2023-07-09 00:15:23 -04:00
parent 92b943c4f6
commit 6f3627cb12
5 changed files with 303 additions and 7 deletions

View File

@ -2,8 +2,162 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Dexif_Installer" xmlns:local="clr-namespace:Dexif_Installer"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml"
<Application.Resources> xmlns:fa="http://schemas.fontawesome.io/icons/">
<Application.Resources>
</Application.Resources> <!--
TODO:
- Progressbar Style
- Checkbox Style
- Button Hover Style
- Button Pressed Style
- Checkbox Hover Style
-->
<Color x:Key="Yellow">#EBCB8B</Color>
<Color x:Key="Red">#BF616A</Color>
<Color x:Key="Orange">#D08770</Color>
<Color x:Key="Green">#A3BE8C</Color>
<Color x:Key="Violet">#B48EAD</Color>
<Color x:Key="PolarNight_0">#2E3440</Color>
<Color x:Key="PolarNight_1">#3B4252</Color>
<Color x:Key="PolarNight_2">#434C5E</Color>
<Color x:Key="PolarNight_3">#4C566A</Color>
<Color x:Key="SnowStorm_0">#D8DEE9</Color>
<Color x:Key="SnowStorm_1">#E5E9F0</Color>
<Color x:Key="SnowStorm_2">#ECEFF4</Color>
<Color x:Key="Frost_0">#8FBCBB</Color>
<Color x:Key="Frost_1">#88C0D0</Color>
<Color x:Key="Frost_2">#81A1C1</Color>
<Color x:Key="Frost_3">#5E81AC</Color>
<SolidColorBrush x:Key="Yellow_Brush" Color="{DynamicResource Yellow}"/>
<SolidColorBrush x:Key="Red_Brush" Color="{DynamicResource Red}"/>
<SolidColorBrush x:Key="Orange_Brush" Color="{DynamicResource Orange}"/>
<SolidColorBrush x:Key="Green_Brush" Color="{DynamicResource Green}"/>
<SolidColorBrush x:Key="Violet_Brush" Color="{DynamicResource Violet}"/>
<SolidColorBrush x:Key="PolarNight_0_Brush" Color="{DynamicResource PolarNight_0}"/>
<SolidColorBrush x:Key="PolarNight_1_Brush" Color="{DynamicResource PolarNight_1}"/>
<SolidColorBrush x:Key="PolarNight_2_Brush" Color="{DynamicResource PolarNight_2}"/>
<SolidColorBrush x:Key="PolarNight_3_Brush" Color="{DynamicResource PolarNight_3}"/>
<SolidColorBrush x:Key="SnowStorm_0_Brush" Color="{DynamicResource SnowStorm_0}"/>
<SolidColorBrush x:Key="SnowStorm_1_Brush" Color="{DynamicResource SnowStorm_1}"/>
<SolidColorBrush x:Key="SnowStorm_2_Brush" Color="{DynamicResource SnowStorm_2}"/>
<SolidColorBrush x:Key="Frost_0_Brush" Color="{DynamicResource Frost_0}"/>
<SolidColorBrush x:Key="Frost_1_Brush" Color="{DynamicResource Frost_1}"/>
<SolidColorBrush x:Key="Frost_2_Brush" Color="{DynamicResource Frost_2}"/>
<SolidColorBrush x:Key="Frost_3_Brush" Color="{DynamicResource Frost_3}"/>
<!-- STATUSES -->
<Style TargetType="{x:Type fa:FontAwesome}">
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="TextTrimming" Value="None"/>
<Style.Triggers>
<Trigger Property="Icon" Value="QuestionCircleOutline">
<Setter Property="Foreground" Value="{DynamicResource Yellow_Brush}"/>
</Trigger>
<Trigger Property="Icon" Value="CheckCircleOutline">
<Setter Property="Foreground" Value="{DynamicResource Green_Brush}"/>
</Trigger>
<Trigger Property="Icon" Value="TimesCircleOutline">
<Setter Property="Foreground" Value="{DynamicResource Red_Brush}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- LABELS -->
<Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{DynamicResource Button.Static.Foreground}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- BUTTONS -->
<SolidColorBrush x:Key="Button.Static.Background" Color="{DynamicResource PolarNight_0}"/>
<SolidColorBrush x:Key="Button.Static.Border" Color="{DynamicResource PolarNight_3}"/>
<SolidColorBrush x:Key="Button.Static.Foreground" Color="{DynamicResource SnowStorm_2}"/>
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="{DynamicResource PolarNight_0}"/>
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="{DynamicResource PolarNight_3}"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="{DynamicResource PolarNight_0}"/>
<SolidColorBrush x:Key="Button.Pressed.Border" Color="{DynamicResource PolarNight_3}"/>
<SolidColorBrush x:Key="Button.Disabled.Background" Color="{DynamicResource PolarNight_0}"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="{DynamicResource PolarNight_3}"/>
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="{DynamicResource PolarNight_3}"/>
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="{StaticResource Button.Static.Foreground}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- WINDOWS -->
<Style TargetType="{x:Type Window}">
<Setter Property="Background" Value="{DynamicResource PolarNight_0_Brush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContentControl}">
<ContentPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
</Application> </Application>

View File

@ -5,6 +5,11 @@
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="FontAwesome.WPF" Version="4.7.0.9" />
</ItemGroup>
</Project> </Project>

View File

@ -3,10 +3,53 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:local="clr-namespace:Dexif_Installer" xmlns:local="clr-namespace:Dexif_Installer"
mc:Ignorable="d" mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"> Title="DEXIF Installer" Height="300" Width="510" >
<Grid> <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" x:Name="Header"/>
<RowDefinition Height="1*" x:Name="Row_Chocolatey"/>
<RowDefinition Height="1*" x:Name="Row_EXIFTool"/>
<RowDefinition Height="1*" x:Name="Row_Executable"/>
<RowDefinition Height="1*" x:Name="Row_ContextMenu"/>
<RowDefinition Height="1*" x:Name="Footer"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" x:Name="Logo"/>
<ColumnDefinition Width="4*" x:Name="Title"/>
<ColumnDefinition Width="1.2*" x:Name="Status"/>
<ColumnDefinition Width="3*" x:Name="Locate"/>
</Grid.ColumnDefinitions>
<Label x:Name="L_Status" Content="Status" Margin="0,0,0,0" Grid.Row="0" Grid.Column="2" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Label x:Name="L_Chocolatey" Content="Chocolatey" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" FontSize="18"/>
<Label x:Name="L_Exiftool" Content="ExifTool" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" FontSize="18"/>
<Label x:Name="L_Executable" Content="Executable" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="3" Grid.Column="1" FontSize="18"/>
<Label x:Name="L_Contextmenu" Content="Context Menu" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="4" Grid.Column="1" FontSize="18"/>
</Grid> <Button x:Name="Locate_Chocolatey" Content="Locate" Margin="12,0,12,-0.2" VerticalAlignment="Center" Grid.Row="1" Grid.Column="3" FontSize="18"/>
<Button x:Name="Locate_Exiftool" Content="Locate" Margin="12,0,12,-0.2" VerticalAlignment="Center" Grid.Row="2" Grid.Column="3" FontSize="18"/>
<Button x:Name="Locate_Exec" Content="Locate" Margin="12,0,12,-0.2" VerticalAlignment="Center" Grid.Row="3" Grid.Column="3" FontSize="18"/>
<Button x:Name="Install" Content="Install" Margin="12,0,12,-0.2" VerticalAlignment="Center" Grid.Row="5" Grid.Column="3" FontSize="18"/>
<CheckBox x:Name="Enable_ConectMenu" Grid.Row="4" Grid.Column="3" FontSize="18" IsChecked="True" VerticalAlignment="Center" HorizontalAlignment="Center" VerticalContentAlignment="Center">
<TextBlock Text="Enable"/>
</CheckBox>
<fa:FontAwesome Icon="QuestionCircleOutline" x:Name="Status_Chocolatey" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" FontSize="36"/>
<fa:FontAwesome Icon="QuestionCircleOutline" x:Name="Status_Exiftool" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="2" Grid.Column="2" FontSize="36"/>
<fa:FontAwesome Icon="QuestionCircleOutline" x:Name="Status_Executable" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" FontSize="36"/>
<fa:FontAwesome Icon="QuestionCircleOutline" x:Name="Status_Contextmenu" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="4" Grid.Column="2" FontSize="36"/>
<fa:FontAwesome Icon="QuestionCircleOutline" x:Name="Status_Install" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Grid.Row="5" Grid.Column="2" FontSize="36"/>
<ProgressBar x:Name="Progress" Grid.Column="1" Grid.Row="5" VerticalAlignment="Center" Margin="12,0,12,0" Height="12"/>
<Image x:Name="Logo_Chocolatey" HorizontalAlignment="Center" Grid.Row="1" VerticalAlignment="Center"/>
<Image x:Name="Logo_Exiftool" HorizontalAlignment="Center" Grid.Row="2" VerticalAlignment="Center"/>
<Image x:Name="Logo_Executable" HorizontalAlignment="Center" Grid.Row="3" VerticalAlignment="Center"/>
<Image x:Name="Logo_Contextmenu" HorizontalAlignment="Center" Grid.Row="4" VerticalAlignment="Center"/>
<Label x:Name="AppTitle" Content="DEXIF" HorizontalAlignment="Left" Margin="0,0,0,0" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" FontSize="40" VerticalContentAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.114" FontFamily="Trajan Pro"/>
<Label x:Name="AppDescription" Content="Image metadata removal tool" HorizontalAlignment="Right" Margin="0,0,12,1" Grid.Column="1" Grid.Row="0" VerticalContentAlignment="Center" VerticalAlignment="Bottom" FontSize="9"/>
</Grid>
</Window> </Window>

View File

@ -13,6 +13,21 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
/* TODO:
* - Ensure Chocolatey
* - Ensure AutoHotKey (Questionable Requirement)
* - Ensure Exiftool
* - Install Exec
* - Install Reg Keys
* - Add to "Installed Programs"
*
* (Very Very Future TODO)
* - Recursion Support for Directories
* - GUI
* - Configurable Suffix / Etc. Opts
*/
namespace Dexif_Installer namespace Dexif_Installer
{ {
/// <summary> /// <summary>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>