Browse Source

Update without substrate sample

pull/17/head
oZ-Zo 6 years ago
parent
commit
726781248f
  1. 70
      ToggleButtonsGenerator.ps1
  2. 2283
      VS/GUI-4/MainWindow.xaml
  3. 4
      Win-10-Setup-Script-GUI-Substrate.ps1
  4. 2283
      Win-10-Setup-Script-GUI.ps1

70
ToggleButtonsGenerator.ps1

@ -1,5 +1,5 @@
#region Privacy & Telemetry Normalized Text #region Privacy & Telemetry Normalized Text
$textPrivacy = "Change Windows Feedback frequency to "Never"", $text = "Change Windows Feedback frequency to "Never"",
"Turn off automatic installing suggested apps", "Turn off automatic installing suggested apps",
"Turn off "Connected User Experiences and Telemetry" service", "Turn off "Connected User Experiences and Telemetry" service",
"Turn off the SQMLogger session at the next computer restart", "Turn off the SQMLogger session at the next computer restart",
@ -63,7 +63,7 @@ $textUi = "Set the Control Panel view by large icons",
#endregion UI & Personalization Normalized Text #endregion UI & Personalization Normalized Text
#region System #region System
$text = "Group svchost.exe processes", $textSystem = "Group svchost.exe processes",
"Remove Windows capabilities", "Remove Windows capabilities",
"Turn on Num Lock at startup", "Turn on Num Lock at startup",
"Turn on the display of stop error information on the BSoD", "Turn on the display of stop error information on the BSoD",
@ -83,8 +83,7 @@ $text = "Group svchost.exe processes",
"Delete files in recycle bin if they have been there for over 30 days", "Delete files in recycle bin if they have been there for over 30 days",
"Open shortcut to the Command Prompt from Start menu as Administrator", "Open shortcut to the Command Prompt from Start menu as Administrator",
"Turn off app suggestions on Start menu", "Turn off app suggestions on Start menu",
"Turn "Turn on firewall & network protection",
on firewall & network protection",
"Remove printers", "Remove printers",
"Turn on Windows Sandbox", "Turn on Windows Sandbox",
"Turn off sticky Shift key after pressing 5 times", "Turn off sticky Shift key after pressing 5 times",
@ -92,16 +91,15 @@ on firewall & network protection",
"Turn off Windows Script Host", "Turn off Windows Script Host",
"Set "High performance" in graphics performance preference for apps", "Set "High performance" in graphics performance preference for apps",
"Automatically adjust active hours for me based on daily usage", "Automatically adjust active hours for me based on daily usage",
"Turn on automatic backup the system registry to the 'C:\Windows\System32\config\RegBack' folder", "Turn on automatic backup the system registry to the "C:\Windows\System32\config\RegBack" folder",
"Set location of the "Desktop", "Documents" "Downloads" "Music", "Pictures" and "Videos"", "Set location of the "Desktop", "Documents" "Downloads" "Music", "Pictures" and "Videos"",
"Use the PrtScn "Use the PrtScn button to open screen snipping",
button to open screen snipping", "Create old style shortcut for "Devices and Printers" in "%AppData%\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools"",
"Create old style shortcut for "Devices and Printers" in 'C:\Users\dmitriy.demin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools'",
"Turn off F1 Help key", "Turn off F1 Help key",
"Turn on Win32 long paths", "Turn on Win32 long paths",
"Turn on Retpoline patch against Spectre v2", "Turn on Retpoline patch against Spectre v2",
"Do not preserve zone information", "Do not preserve zone information",
"Change environment variable for 'C:\Temp' to 'C:\Temp'", "Change environment variable for "%Temp%" to "%SystemDrive%\Temp"",
"Run Storage Sense every month", "Run Storage Sense every month",
"Never delete files in "Downloads" folder", "Never delete files in "Downloads" folder",
"Turn off location for this device", "Turn off location for this device",
@ -110,8 +108,7 @@ button to open screen snipping",
"Turn on updates for other Microsoft products", "Turn on updates for other Microsoft products",
"Enable System Restore", "Enable System Restore",
"Do not allow Windows 10 to manage default printer", "Do not allow Windows 10 to manage default printer",
"Turn on access to mapped "Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled",
drives from app running with elevated permissions with Admin Approval Mode enabled",
"Set download mode for delivery optization on "HTTP only"", "Set download mode for delivery optization on "HTTP only"",
"Turn off Cortana" "Turn off Cortana"
#endregion System #endregion System
@ -121,49 +118,60 @@ if (Test-Path -Path "C:\Tmp\toggleButtons.txt") {
Remove-Item -Path "C:\Tmp\toggleButtons.txt" -Force -Confirm:$false Remove-Item -Path "C:\Tmp\toggleButtons.txt" -Force -Confirm:$false
} }
$toggleSwitchName = "ToggleSwitchSystem" # For UI & Personalization Settings $toggleSwitchName = "ToggleSwitchPrivacy"
#"ToggleSwitchPrivacy" # For Privacy & Telemetry Settings #"ToggleSwitchPrivacy" # For Privacy & Telemetry Settings
#"ToggleSwitchUi" # For UI & Personalization Settings #"ToggleSwitchUi" # For UI & Personalization Settings
#"ToggleSwitchSystem" # For System Settings #"ToggleSwitchSystem" # For System Settings
$texBoxName = "TexBlockSystem" # For UI & Personalization Settings $textBlockName = "TexBlockPrivacy"
#"TexBlockPrivacy" # For Privacy & Telemetry Settings #"TexBlockPrivacy" # For Privacy & Telemetry Settings
#"TexBlockUi" # For UI & Personalization Settings #"TexBlockUi" # For UI & Personalization Settings
#"TexBlockSystem" # For System Settings #"TexBlockSystem" # For System Settings
for ($i = 0; $i -lt $text.Length; $i++) { for ($i = 0; $i -lt $text.Length; $i++) {
$content = $text[$i].Replace("""", """) $content = $text[$i].Replace("""", """)
@" @"
<Border BorderBrush="{Binding ElementName=BorderPrivacy, Path=BorderBrush}" BorderThickness="{Binding ElementName=BorderPrivacy, Path=BorderThickness}" Margin="{Binding ElementName=BorderPrivacy, Path=Margin}" Style="{StaticResource BorderHoverStyle}"> <Grid HorizontalAlignment="Left" Margin="0 5 0 5">
<StackPanel Orientation="Horizontal" Margin="10">
<Grid HorizontalAlignment="Left">
<ToggleButton Name="$toggleSwitchName$i" Style="{DynamicResource ToggleSwitchLeftStyle}" IsChecked="False"/> <ToggleButton Name="$toggleSwitchName$i" Style="{DynamicResource ToggleSwitchLeftStyle}" IsChecked="False"/>
<TextBlock Name="$texBoxName$i" Text="$content" Margin="65 0 10 0" VerticalAlignment="Center" IsHitTestVisible="False"> <TextBlock Name="$textBlockName$i" Text="$content" Margin="65 0 10 0" VerticalAlignment="Center" IsHitTestVisible="False">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="{x:Type TextBlock}"> <Style TargetType="{x:Type TextBlock}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding ElementName=$toggleSwitchName$i, Path=IsChecked}" Value="True"> <DataTrigger Binding="{Binding ElementName=$toggleSwitchName$i, Path=IsChecked}" Value="True">
<Setter Property="Foreground" Value="{Binding ElementName=BorderWindow, Path=BorderBrush}"/> <Setter Property="Foreground" Value="{Binding ElementName=BorderWindow, Path=BorderBrush}"/>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding ElementName=$toggleSwitchName$i, Path=IsEnabled}" Value="false">
<Setter Property="Opacity" Value="0.2" />
</DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</TextBlock.Style> </TextBlock.Style>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel>
</Border>
"@ | Out-File -FilePath "C:\Tmp\toggleButtons.txt" -Append
# Add Placeholder Panel to Group End
if ($i -eq ($text.Length - 1)) {
@"
<!--Placeholder Panel-->
<StackPanel Margin="{Binding ElementName=BorderPrivacy, Path=Margin}" Height="{Binding ElementName=BorderPrivacy, Path=Height}" Background="Transparent"/>
"@ | Out-File -FilePath "C:\Tmp\toggleButtons.txt" -Append "@ | Out-File -FilePath "C:\Tmp\toggleButtons.txt" -Append
}
} }
#endregion Toggle Buttons Generator #endregion Toggle Buttons Generator
#region GUI with Substrate
# @"
# <Border BorderBrush="{Binding ElementName=BorderPrivacy, Path=BorderBrush}" BorderThickness="{Binding ElementName=BorderPrivacy, Path=BorderThickness}" Margin="{Binding ElementName=BorderPrivacy, Path=Margin}" Style="{StaticResource BorderHoverStyle}">
# <StackPanel Orientation="Horizontal" Margin="10">
# <Grid HorizontalAlignment="Left">
# <ToggleButton Name="$toggleSwitchName$i" Style="{DynamicResource ToggleSwitchLeftStyle}" IsChecked="False"/>
# <TextBlock Name="$texBoxName$i" Text="$content" Margin="65 0 10 0" VerticalAlignment="Center" IsHitTestVisible="False">
# <TextBlock.Style>
# <Style TargetType="{x:Type TextBlock}">
# <Style.Triggers>
# <DataTrigger Binding="{Binding ElementName=$toggleSwitchName$i, Path=IsChecked}" Value="True">
# <Setter Property="Foreground" Value="{Binding ElementName=BorderWindow, Path=BorderBrush}"/>
# </DataTrigger>
# <DataTrigger Binding="{Binding ElementName=$toggleSwitchName$i, Path=IsEnabled}" Value="false">
# <Setter Property="Opacity" Value="0.2" />
# </DataTrigger>
# </Style.Triggers>
# </Style>
# </TextBlock.Style>
# </TextBlock>
# </Grid>
# </StackPanel>
# </Border>
# "@
#endregion GUI with Substrate

2283
VS/GUI-4/MainWindow.xaml

File diff suppressed because it is too large

4
Win-10-Setup-Script-GUI-Without-Substrate.ps1 → Win-10-Setup-Script-GUI-Substrate.ps1

@ -698,7 +698,7 @@
<!--#region Privacy & Telemetry--> <!--#region Privacy & Telemetry-->
<StackPanel Orientation="Vertical" VerticalAlignment="Top"> <StackPanel Orientation="Vertical" VerticalAlignment="Top">
<Border Name="BorderPrivacy" BorderBrush="Transparent" BorderThickness="0" Margin="10 0 10 0" Height="43" Background="Transparent"> <Border Name="BorderPrivacy" BorderBrush="#DADADA" BorderThickness="1 0 1 1" Margin="10 0 10 0" Height="43" Background="#FFFFFF">
<TextBlock Text="Privacy &amp; Telemetry Settings" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="28 0 10 0"/> <TextBlock Text="Privacy &amp; Telemetry Settings" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="28 0 10 0"/>
</Border> </Border>
<Border BorderBrush="{Binding ElementName=BorderPrivacy, Path=BorderBrush}" BorderThickness="{Binding ElementName=BorderPrivacy, Path=BorderThickness}" Margin="{Binding ElementName=BorderPrivacy, Path=Margin}" Style="{StaticResource BorderHoverStyle}"> <Border BorderBrush="{Binding ElementName=BorderPrivacy, Path=BorderBrush}" BorderThickness="{Binding ElementName=BorderPrivacy, Path=BorderThickness}" Margin="{Binding ElementName=BorderPrivacy, Path=Margin}" Style="{StaticResource BorderHoverStyle}">
@ -2615,7 +2615,7 @@
<StackPanel Orientation="Horizontal" Margin="10"> <StackPanel Orientation="Horizontal" Margin="10">
<Grid HorizontalAlignment="Left"> <Grid HorizontalAlignment="Left">
<ToggleButton Name="ToggleSwitchSystem31" Style="{DynamicResource ToggleSwitchLeftStyle}" IsChecked="False"/> <ToggleButton Name="ToggleSwitchSystem31" Style="{DynamicResource ToggleSwitchLeftStyle}" IsChecked="False"/>
<TextBlock Name="TexBlockSystem31" Text="Create old style shortcut for &quot;Devices and Printers&quot; in '$env:\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools'" Margin="65 0 10 0" VerticalAlignment="Center" IsHitTestVisible="False"> <TextBlock Name="TexBlockSystem31" Text="Create old style shortcut for &quot;Devices and Printers&quot; in 'C:\Users\dmitriy.demin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools'" Margin="65 0 10 0" VerticalAlignment="Center" IsHitTestVisible="False">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="{x:Type TextBlock}"> <Style TargetType="{x:Type TextBlock}">
<Style.Triggers> <Style.Triggers>

2283
Win-10-Setup-Script-GUI.ps1

File diff suppressed because it is too large
Loading…
Cancel
Save