Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Test3 #8

Merged
merged 47 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b2dc605
Test 2024 01 25 (#1505)
ChrisTitusTech Jan 30, 2024
f472057
Test 2024 01 30 (#1541)
ChrisTitusTech Feb 2, 2024
4773cd6
Test 2023 02 02 (#1556)
ChrisTitusTech Feb 3, 2024
b7a86de
Update applications.json
ChrisTitusTech Feb 3, 2024
d0aa396
Test 2024 02 03 (#1583)
ChrisTitusTech Feb 6, 2024
f39deab
bug fixes
ChrisTitusTech Feb 7, 2024
92fa857
Update close-old-issues.yaml
ChrisTitusTech Feb 7, 2024
c842584
revert winget
ChrisTitusTech Feb 8, 2024
0ecc432
Compile Winutil
ChrisTitusTech Feb 8, 2024
e4fa099
Update Dev Toys URL (#1606)
AlexTu2 Feb 12, 2024
70ec481
Compile Winutil
ChrisTitusTech Feb 12, 2024
fc50587
Update close-old-issues.yaml
ChrisTitusTech Feb 20, 2024
8e00077
Compile Winutil
ChrisTitusTech Feb 20, 2024
07eeed3
Update close-old-issues.yaml
ChrisTitusTech Feb 20, 2024
a293649
Merge branch 'main' of https://github.com/ChrisTitusTech/winutil
ChrisTitusTech Feb 20, 2024
e745d79
Update close-old-issues.yaml
ChrisTitusTech Feb 20, 2024
31c6622
Update close-old-issues.yaml
ChrisTitusTech Feb 20, 2024
dd2e4fb
Merge branch 'test-2024-02-07-refactor-noapps' into main
ChrisTitusTech Feb 21, 2024
cfd2f54
Bring workflow to test (#1638)
ChrisTitusTech Feb 21, 2024
f6e9028
Compile Winutil
ChrisTitusTech Feb 21, 2024
f83d712
Change Dynamic xaml to static
ChrisTitusTech Feb 21, 2024
93d517d
Compile Winutil
ChrisTitusTech Feb 21, 2024
c2be437
Move features and tweaks to static compile
ChrisTitusTech Feb 21, 2024
caeb89f
Compile Winutil
ChrisTitusTech Feb 21, 2024
9291020
Add 'Run as administrator' to 'Invoke-WPFShortcut' Function and Use i…
og-mrk Feb 22, 2024
532e40b
Compile Winutil
ChrisTitusTech Feb 22, 2024
c6c3f0c
changed link to correct project (#1619)
shrimp332 Feb 22, 2024
420f37f
Compile Winutil
ChrisTitusTech Feb 22, 2024
4ac5b79
Improve handling of Adobe's CC Cleaner tool (#1635)
felgmar Feb 22, 2024
4de1ac3
Compile Winutil
ChrisTitusTech Feb 22, 2024
ca9c764
Merge branch 'test-2024-02-07-refactor-noapps' into main
ChrisTitusTech Mar 21, 2024
6e7c533
Compile Winutil
ChrisTitusTech Mar 21, 2024
5cd75c0
Test 2024 02 07 refactor noapps (#1717)
ChrisTitusTech Mar 21, 2024
7bfcd7c
compile refactor
ChrisTitusTech Mar 21, 2024
23af798
Compile Winutil
ChrisTitusTech Mar 21, 2024
54a5752
Test 2024 03 21 (#1748)
ChrisTitusTech Mar 28, 2024
f776717
Update .gitignore
ChrisTitusTech Mar 28, 2024
c3b12e8
Test 2024 03 21 (#1755)
ChrisTitusTech Mar 28, 2024
4a7c8a3
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
ChrisTitusTech Mar 30, 2024
88a622c
Test 2024 03 30 (#1852)
ChrisTitusTech Apr 20, 2024
9eceae6
Fix Unit Tests and Official Releases (#1854)
ChrisTitusTech Apr 20, 2024
57ff8b0
Fix auto releases
ChrisTitusTech Apr 20, 2024
fec5b68
Update release.yaml
ChrisTitusTech Apr 20, 2024
ad080f2
remove auto releases
ChrisTitusTech Apr 20, 2024
c8ae4a8
Update Invoke-WPFOOSU
ChrisTitusTech Apr 21, 2024
9ef0504
Compile Winutil
ChrisTitusTech Apr 21, 2024
2354645
Fix ALL Program Installs (#1856)
ChrisTitusTech Apr 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/close-old-issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Close Inactive Issues

on:
schedule:
- cron: '0 0 * * *' # Run daily
workflow_dispatch: # This line enables manual triggering
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write # Ensure necessary permissions for issues

steps:
- name: Close inactive issues
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const octokit = github;

// Get the repository owner and name
const { owner, repo } = context.repo;

// Define the inactivity period (14 days)
const inactivityPeriod = new Date();
inactivityPeriod.setDate(inactivityPeriod.getDate() - 14);

const labelKeepIssue = 'Keep Issue Open';

try {
// Get all open issues with pagination
for await (const response of octokit.paginate.iterator(octokit.rest.issues.listForRepo, {
owner,
repo,
state: 'open',
})) {
const issues = response.data;

// Close issues inactive for more than the inactivity period
for (const issue of issues) {
let closeIssue = true;

// Get all Labels of issue, and compared each label with the labelKeepIssue const variable
try {
const respondIssueLabels = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}/labels", {
owner: owner,
repo: repo,
issue_number: issue.number
});
const labels = respondIssueLabels.data;

for (let i = 0; i < labels.length; i++) {
const label = labels[i]
if (label.name === labelKeepIssue) {
console.log(`Issue #${issue.number} will not be closed`);
closeIssue = false;
break; // Break from the loop, no need to check the remaining Labels.
}
}
} catch (error) {
console.error(`Error while Fetching Labels for Issue #${issue.number}, Error: ${error}`);
}

if (!closeIssue) {
continue; // Skip the next bit of code
}

const lastCommentDate = issue.updated_at;
if (new Date(lastCommentDate) < inactivityPeriod) {
try {
// Close the issue
await octokit.rest.issues.update({
owner,
repo,
issue_number: issue.number,
state: 'closed',
});

// Add a comment
await octokit.rest.issues.createComment({
owner,
repo,
issue_number: issue.number,
body: 'Closed due to inactivity',
});
} catch (error) {
console.error(`Error updating or commenting on issue #${issue.number}: ${error}`);
}
}
}
}
} catch (error) {
console.error(`Error fetching issues: ${error}`);
}
11 changes: 7 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ jobs:
build-runspace:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Create local changes
- name: Compile project
shell: pwsh
run: |
powershell.exe -f Compile.ps1
- uses: stefanzweifel/git-auto-commit-action@v4.16.0
Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
continue-on-error: false # Directly fail the job on error, removing the need for a separate check
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Compile Winutil
if: success()
4 changes: 2 additions & 2 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
- name: Install Pester
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
Install-Module -Name Pester -Force -AllowClobber
Install-Module -Name Pester -Force -SkipPublisherCheck -AllowClobber
shell: pwsh

- name: Run Pester tests
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
Invoke-Pester -Path 'pester/*.Tests.ps1' -EnableExit
Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed

shell: pwsh
env:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ winutil.pdb
# Folder config file
[Dd]esktop.ini

# Ignore Generated XAML Files
xaml/inputApp.xaml
xaml/inputFeatures.xaml
xaml/inputTweaks.xaml

# Executables and Configs
winget.msixbundle
pester.ps1
Expand All @@ -23,6 +28,7 @@ ooshutup10.cfg
winutil.exe.config
Microsoft.UI.Xaml*
license1.xml
winutil.ps1

# Libraries
System.Management.Automation.dll
Expand All @@ -36,3 +42,5 @@ Microsoft.PowerShell.ConsoleHost.dll
# General
.DS_Store
microwin.log
True
test.ps1
66 changes: 60 additions & 6 deletions Compile.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
$OFS = "`r`n"
$scriptname = "winutil.ps1"

# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot
$sync.configs = @{}

if (Test-Path -Path "$($scriptname)")
{
Expand All @@ -21,15 +24,66 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}

Get-ChildItem .\xaml | ForEach-Object {
$xaml = (Get-Content $psitem.FullName).replace("'","''")
Write-output "`$$($psitem.BaseName) = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
}

Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
$json = (Get-Content $psitem.FullName).replace("'","''")

# 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)
# Some Type Convertion using Casting and Cleaning Up of the convertion result using 'Replace' Method
$jsonAsObject = $json | convertfrom-json
$firstLevelJsonList = ([System.String]$jsonAsObject).split('=;') | ForEach-Object {
$_.Replace('=}','').Replace('@{','').Replace(' ','')
}

for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
$firstLevelName = $firstLevelJsonList[$i]
# Note: Avoid using HTML Entity Codes (for example '&rdquo;' (stands for "Right Double Quotation Mark")), and use HTML decimal/hex codes instead.
# as using HTML Entity Codes will result in XML parse Error when running the compiled script.
if ($jsonAsObject.$firstLevelName.content -ne $null) {
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;')
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&#39;&#39;',"&#39;") # 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('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;')
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop
}
}
# The replace at the end is required, as without it the output of converto-json will be somewhat weird for Multiline String
# Most Notably is the scripts in json files, make=ing it harder for users who want to review these scripts that are found in the final compiled script
$json = ($jsonAsObject | convertto-json -Depth 3).replace('\r\n',"`r`n")

$sync.configs.$($psitem.BaseName) = $json | convertfrom-json
Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii
}

$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")

# Dot-source the Get-TabXaml function
. .\functions\private\Get-TabXaml.ps1

## Xaml Manipulation
$tabColumns = Get-TabXaml "applications" 5
$tabColumns | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii
$tabColumns = Get-TabXaml "tweaks"
$tabColumns | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii
$tabColumns = Get-TabXaml "feature"
$tabColumns | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii

# Assuming inputApp.xaml is in the same directory as main.ps1
$appXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputApp.xaml"
$tweaksXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputTweaks.xaml"
$featuresXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputFeatures.xaml"

# Load the XAML content from inputApp.xaml
$appXamlContent = Get-Content -Path $appXamlPath -Raw
$tweaksXamlContent = Get-Content -Path $tweaksXamlPath -Raw
$featuresXamlContent = Get-Content -Path $featuresXamlPath -Raw

# Replace the placeholder in $inputXML with the content of inputApp.xaml
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent

Write-output "`$inputXML = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii

Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ Winutil must be run in Admin mode because it performs system-wide tweaks. To ach
#### Simple way

```
iwr -useb https://christitus.com/win | iex
irm https://christitus.com/win | iex
```
Courtesy of the issue raised at: [#144](/../../issues/144)

or by executing:
```
irm https://christitus.com/win | iex
iwr -useb https://christitus.com/win | iex
```
Courtesy of the issue raised at: [#144](/../../issues/144)

if for some reason this site is not reachable from your country please try running it directly from github

Expand All @@ -45,12 +46,12 @@ Some features are avaliable through automation. This allows you to save your con
![GetInstalled](/wiki/Get-Installed.png)
2. Click on the Settings cog in the upper right corner and chose Export, chose file file and location, this will export the setting file.
![SettingsExport](/wiki/Settings-Export.png)
3. Copy this file to a USB or somewhere you can use after Windows installation
4. Use Microwin tab to create a cusom Windows image
5. Install the Windows image
6. In the new Windows, Open PowerShell in the admin mode and run command to automatically apply twekas and install apps from the config file
3. Copy this file to a USB or somewhere you can use after Windows installation.
4. Use Microwin tab to create a custom Windows image.
5. Install the Windows image.
6. In the new Windows, Open PowerShell in the admin mode and run command to automatically apply tweaks and install apps from the config file.
```
irm https://christitus.com/win -Config [path-to-your-config] -Run | iex
iex "& { $(irm christitus.com/win) } -Config [path-to-your-config] -Run"
```
7. Have a cup of coffee! Come back when it's done.

Expand Down Expand Up @@ -97,7 +98,9 @@ If you are still having issues try changing your DNS provider to 1.1.1.1 || 1.0.

- Essential Tweaks: Offers a collection of essential tweaks aimed at improving system performance, privacy, and resource utilization. These tweaks include creating a system restore point, disabling telemetry, Wi-Fi Sense, setting services to manual, disabling location tracking, and HomeGroup, among others.

- Misc. Tweaks: Encompasses a range of various tweaks to further optimize the system. These tweaks include enabling/disabling power throttling, enabling num lock on startup, removing Cortana and Edge, disabling User Account Control (UAC), notification panel, and configuring TPM during updates, among others.
- Advanced Tweaks: Encompasses a range of various advanced power user tweaks to further optimize the system. These tweaks include removing OneDrive and Edge, disabling User Account Control (UAC), notification panel, among others.

- Toggles: Adds easy to use, one click shortcuts for toggling dark mode, NumLock on startup, file extensions, sticky keys, among others.

- Additional Tweaks: Introduces various other tweaks such as enabling dark mode, changing DNS settings, adding an Ultimate Performance mode, and creating shortcuts for WinUtil tools. These tweaks provide users with additional customization options to tailor their system to their preferences.

Expand Down
Loading
Loading