-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .NET 8 installation feature with admin privileges
Added a new command line argument `-installDotNetAdmin` to handle the installation of .NET 8 with administrative privileges. Introduced the `InstallDotNet` method in `UpdateApp.cs` to manage the installation process, including checking for admin rights and prompting for elevation. Created a new WPF window `DotNetInstallerWindow` in `DotNetInstallerWindow.xaml` and its code-behind file to provide a UI for the installation process, including multiple pages for user guidance. Updated `App.xaml.cs` to call `InstallDotNet` during initialization and handle the new argument. Added necessary using directives for security, process management, and UI components.
- Loading branch information
Showing
4 changed files
with
483 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221 changes: 221 additions & 0 deletions
221
vrcosc-magicchatbox/UI/Dialogs/DotNetInstallerWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
<Window | ||
x:Class="vrcosc_magicchatbox.UI.Dialogs.DotNetInstallerWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:vrcosc_magicchatbox.UI.Dialogs" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title=".NET 8 Installation" | ||
Width="700" | ||
Height="300" | ||
Background="#41375B" | ||
ResizeMode="NoResize" | ||
WindowStartupLocation="CenterScreen" | ||
mc:Ignorable="d"> | ||
|
||
<WindowChrome.WindowChrome> | ||
<WindowChrome | ||
CaptionHeight="55" | ||
CornerRadius="0" | ||
GlassFrameThickness="1" | ||
ResizeBorderThickness="8" | ||
UseAeroCaptionButtons="False" /> | ||
</WindowChrome.WindowChrome> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="35" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="50" /> | ||
</Grid.RowDefinitions> | ||
|
||
<!-- Header Area --> | ||
<Grid x:Name="Drag_area" Grid.Row="0"> | ||
<Grid.Background> | ||
<LinearGradientBrush StartPoint="0,1" EndPoint="0.5,1"> | ||
<LinearGradientBrush.RelativeTransform> | ||
<TransformGroup> | ||
<ScaleTransform CenterX="0.5" CenterY="0.5" /> | ||
<SkewTransform AngleX="-10" CenterX="0.5" CenterY="0.5" /> | ||
<RotateTransform CenterX="0.5" CenterY="0.5" /> | ||
<TranslateTransform /> | ||
</TransformGroup> | ||
</LinearGradientBrush.RelativeTransform> | ||
<GradientStop Offset="1" Color="#FF1A0842" /> | ||
<GradientStop Color="#FF240E54" /> | ||
<GradientStop Offset="0.539" Color="#FF630FA0" /> | ||
</LinearGradientBrush> | ||
</Grid.Background> | ||
<StackPanel Orientation="Horizontal"> | ||
<Image Margin="2" Source="/Img/MagicOSC_icon.png" /> | ||
<TextBlock | ||
Margin="6,1,0,0" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontFamily="Albert Sans Thin" | ||
FontSize="14" | ||
Foreground="White" | ||
Text=".NET 8 Setup"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="15" | ||
Direction="315" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="Black" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
</StackPanel> | ||
</Grid> | ||
|
||
<!-- Main Content Area --> | ||
<Grid Grid.Row="1"> | ||
<!-- First Page: Checking for .NET 8 --> | ||
<Grid x:Name="CheckDotNetPage"> | ||
<TextBlock | ||
Margin="25" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
FontFamily="Comfortaa Light" | ||
FontSize="20" | ||
Foreground="White" | ||
Text="Checking if .NET 8 is installed..." | ||
TextAlignment="Center"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="10" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="#251153" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
</Grid> | ||
|
||
<!-- Second Page: Ask to Install .NET 8 --> | ||
<Grid x:Name="AskInstallPage" Visibility="Hidden"> | ||
<TextBlock | ||
Margin="25" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
FontFamily="Comfortaa Light" | ||
FontSize="20" | ||
Foreground="White" | ||
Text=".NET 8 is not installed on your system." | ||
TextAlignment="Center"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="10" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="#251153" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
<TextBlock | ||
Margin="25,60,25,0" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
FontFamily="Comfortaa Light" | ||
FontSize="16" | ||
Foreground="LightYellow" | ||
Text="Would you like to install .NET 8 now?" | ||
TextAlignment="Center"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="10" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="#251153" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
</Grid> | ||
|
||
<!-- Third Page: Installing .NET 8 --> | ||
<Grid x:Name="InstallDotNetPage" Visibility="Hidden"> | ||
<TextBlock | ||
Margin="25" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
FontFamily="Comfortaa Light" | ||
FontSize="20" | ||
Foreground="White" | ||
Text="Installing .NET 8 in the background..." | ||
TextAlignment="Center"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="10" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="#251153" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
|
||
<ProgressBar | ||
Width="600" | ||
Height="30" | ||
Margin="0,60,0,0" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
IsIndeterminate="True" | ||
Foreground="YellowGreen" /> | ||
</Grid> | ||
|
||
<!-- Fourth Page: Confirmation --> | ||
<Grid x:Name="ConfirmDotNetPage" Visibility="Hidden"> | ||
<TextBlock | ||
Margin="25" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
FontFamily="Comfortaa Light" | ||
FontSize="20" | ||
Foreground="White" | ||
Text=".NET 8 is installed and ready for use!" | ||
TextAlignment="Center"> | ||
<TextBlock.Effect> | ||
<DropShadowEffect | ||
BlurRadius="10" | ||
Opacity="1" | ||
ShadowDepth="0" | ||
Color="#251153" /> | ||
</TextBlock.Effect> | ||
</TextBlock> | ||
|
||
<Button | ||
Width="250" | ||
Height="50" | ||
Margin="0,140,0,0" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
Click="CloseWindow_Click" | ||
Style="{StaticResource Status_Button_style}"> | ||
<TextBlock FontSize="20" Text="Close" /> | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
|
||
<!-- Footer with Navigation Buttons --> | ||
<Grid Grid.Row="2" HorizontalAlignment="Center" Margin="10,0"> | ||
<StackPanel Orientation="Horizontal"> | ||
<Button | ||
x:Name="CancelButton" | ||
Width="100" | ||
Height="40" | ||
Margin="10,0" | ||
Click="CancelButton_Click" | ||
Visibility="Hidden" | ||
Style="{StaticResource Status_Button_style}"> | ||
<TextBlock FontSize="16" Text="Cancel" /> | ||
</Button> | ||
<Button | ||
x:Name="NextButton" | ||
Width="100" | ||
Height="40" | ||
Margin="10,0" | ||
Click="NextButton_Click" | ||
Visibility="Hidden" | ||
Style="{StaticResource Status_Button_style}"> | ||
<TextBlock FontSize="16" Text="Next" /> | ||
</Button> | ||
</StackPanel> | ||
</Grid> | ||
</Grid> | ||
</Window> |
Oops, something went wrong.