mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-16 01:40:35 -06:00
Compare commits
No commits in common. "5084b399d1a283e67b3225b2fee54a4699e31ff7" and "71db68ad8ea6325e6ee1f3204e5f98ea5eec7c4c" have entirely different histories.
5084b399d1
...
71db68ad8e
28
Compile.ps1
28
Compile.ps1
@ -64,14 +64,38 @@ Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
|
||||
}
|
||||
Update-Progress "Adding: Config *.json" 40
|
||||
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||
|
||||
$json = (Get-Content $psitem.FullName).replace("'","''")
|
||||
$jsonAsObject = $json | convertfrom-json
|
||||
|
||||
# Replace every XML Special Character so it'll render correctly in final build
|
||||
# Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
|
||||
# Make an Array List containing every name at first level of Json File
|
||||
$jsonAsObject = $json | convertfrom-json
|
||||
$firstLevelJsonList = [System.Collections.ArrayList]::new()
|
||||
$jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
|
||||
# Note:
|
||||
# Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
|
||||
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
|
||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||
$firstLevelName = $firstLevelJsonList[$i]
|
||||
if ($jsonAsObject.$firstLevelName.content -ne $null) {
|
||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||
}
|
||||
if ($jsonAsObject.$firstLevelName.description -ne $null) {
|
||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||
}
|
||||
}
|
||||
|
||||
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
||||
if ($psitem.Name -eq "applications.json") {
|
||||
foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
|
||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||
$appEntryName = $firstLevelJsonList[$i]
|
||||
$appEntryContent = $jsonAsObject.$appEntryName
|
||||
# Remove the entire app entry, so we could add it later with a different name
|
||||
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
||||
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
|
||||
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,10 @@ public class PowerManagement {
|
||||
# reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null
|
||||
|
||||
# When in Offline Image
|
||||
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
||||
if (Test-Path "HKLM:\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_")
|
||||
{
|
||||
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
||||
|
@ -284,12 +284,12 @@
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@ -707,7 +707,7 @@
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
Name="SearchBarClearButton"
|
||||
Style="{StaticResource SearchBarClearButtonStyle}"
|
||||
Margin="210,0,0,0" Visibility="Collapsed"/>
|
||||
Margin="205,0,0,0" Visibility="Collapsed"/>
|
||||
|
||||
<ProgressBar
|
||||
Grid.Column="1"
|
||||
|
Loading…
Reference in New Issue
Block a user