mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-04 14:17:27 +00:00
Compare commits
5 Commits
26.04.30
...
a0887783f8
| Author | SHA1 | Date | |
|---|---|---|---|
| a0887783f8 | |||
| f3880b66bb | |||
| aa636926fa | |||
| ec3166bdc6 | |||
| a3f57532b6 |
@@ -8,7 +8,16 @@ body:
|
||||
value: |
|
||||
- Remember, we only support Windows 11. If you encounter problems on Windows 10, please consider upgrading to Windows 11.
|
||||
- For general questions, join our Community-driven [Discord Server](https://discord.gg/RUbZUZyByQ).
|
||||
|
||||
|
||||
- type: checkboxes
|
||||
id: read_issues
|
||||
attributes:
|
||||
label: "I have read the known issues"
|
||||
description: "You [better do](https://winutil.christitus.com/knownissues/), cause your issue can be already there"
|
||||
options:
|
||||
- label: Yes, I did
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: affected_part
|
||||
attributes:
|
||||
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
id: check_user
|
||||
if: env.command == 'true'
|
||||
run: |
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders" "GabiNun")
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders" "GabiNun2" "FluffyPunk")
|
||||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
||||
echo "user=true" >> $GITHUB_ENV
|
||||
else
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Close issue
|
||||
if: env.close_command == 'true'
|
||||
if: env.user == 'true' && env.close_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Reopen issue
|
||||
if: env.reopen_command == 'true'
|
||||
if: env.user == 'true' && env.reopen_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||
|
||||
- name: Label issue
|
||||
if: env.label_command == 'true'
|
||||
if: env.user == 'true' && env.label_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --add-label "${{ env.label_name }}"
|
||||
|
||||
- name: Remove labels
|
||||
if: env.unlabel_command == 'true'
|
||||
if: env.user == 'true' && env.unlabel_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
|
||||
+11
-4
@@ -5,11 +5,18 @@ description: ""
|
||||
|
||||
```powershell {filename="functions/private/Invoke-WinUtilInstallPSProfile.ps1",linenos=inline,linenostart=1}
|
||||
function Invoke-WinUtilInstallPSProfile {
|
||||
|
||||
if (Test-Path $Profile) {
|
||||
Rename-Item $Profile -NewName ($Profile + '.bak')
|
||||
if (-not (Get-Command wt)) {
|
||||
Write-Host "Windows Terminal not found installing..."
|
||||
Install-WinUtilWinget
|
||||
winget install Microsoft.WindowsTerminal --source winget --silent
|
||||
}
|
||||
|
||||
Start-Process pwsh -ArgumentList '-Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"'
|
||||
if (-not (Get-Command pwsh)) {
|
||||
Write-Host "Powershell 7 not found installing..."
|
||||
Install-WinUtilWinget
|
||||
winget install Microsoft.PowerShell --source winget --silent
|
||||
}
|
||||
|
||||
wt new-tab pwsh -NoExit -Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"
|
||||
}
|
||||
```
|
||||
|
||||
+5
-6
@@ -5,12 +5,11 @@ description: ""
|
||||
|
||||
```powershell {filename="functions/private/Invoke-WinUtilUninstallPSProfile.ps1",linenos=inline,linenostart=1}
|
||||
function Invoke-WinUtilUninstallPSProfile {
|
||||
if (Test-Path ($Profile + '.bak')) {
|
||||
Remove-Item $Profile
|
||||
Rename-Item ($Profile + '.bak') -NewName $Profile
|
||||
}
|
||||
else {
|
||||
Remove-Item $Profile
|
||||
|
||||
if (Test-Path ($Profile + ".bak")) {
|
||||
Move-Item -Path ($Profile + ".bak") -Destination $Profile
|
||||
} else {
|
||||
Remove-Item -Path $Profile
|
||||
}
|
||||
|
||||
Write-Host "Successfully uninstalled CTT PowerShell Profile." -ForegroundColor Green
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
function Get-WinUtilInstallerProcess {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Checks if the given process is running
|
||||
|
||||
.PARAMETER Process
|
||||
The process to check
|
||||
|
||||
.OUTPUTS
|
||||
Boolean - True if the process is running
|
||||
|
||||
#>
|
||||
|
||||
param($Process)
|
||||
|
||||
if ($Null -eq $Process) {
|
||||
return $false
|
||||
}
|
||||
if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue) {
|
||||
return $true
|
||||
}
|
||||
return $false
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
function Invoke-WinUtilInstallPSProfile {
|
||||
|
||||
if (Test-Path $Profile) {
|
||||
Rename-Item $Profile -NewName ($Profile + '.bak')
|
||||
if (-not (Get-Command wt)) {
|
||||
Write-Host "Windows Terminal not found installing..."
|
||||
Install-WinUtilWinget
|
||||
winget install Microsoft.WindowsTerminal --source winget --silent
|
||||
}
|
||||
|
||||
Start-Process pwsh -ArgumentList '-Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"'
|
||||
if (-not (Get-Command pwsh)) {
|
||||
Write-Host "Powershell 7 not found installing..."
|
||||
Install-WinUtilWinget
|
||||
winget install Microsoft.PowerShell --source winget --silent
|
||||
}
|
||||
|
||||
wt new-tab pwsh -NoExit -Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
function Invoke-WinUtilUninstallPSProfile {
|
||||
if (Test-Path ($Profile + '.bak')) {
|
||||
Remove-Item $Profile
|
||||
Rename-Item ($Profile + '.bak') -NewName $Profile
|
||||
}
|
||||
else {
|
||||
Remove-Item $Profile
|
||||
|
||||
if (Test-Path ($Profile + ".bak")) {
|
||||
Move-Item -Path ($Profile + ".bak") -Destination $Profile
|
||||
} else {
|
||||
Remove-Item -Path $Profile
|
||||
}
|
||||
|
||||
Write-Host "Successfully uninstalled CTT PowerShell Profile." -ForegroundColor Green
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
Function Update-WinUtilProgramWinget {
|
||||
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
This will update all programs using WinGet
|
||||
|
||||
#>
|
||||
|
||||
[ScriptBlock]$wingetinstall = {
|
||||
|
||||
$host.ui.RawUI.WindowTitle = """WinGet Install"""
|
||||
|
||||
Start-Transcript "$logdir\winget-update_$dateTime.log" -Append
|
||||
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
|
||||
|
||||
}
|
||||
|
||||
$global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
|
||||
|
||||
}
|
||||
@@ -1,36 +1,21 @@
|
||||
function Invoke-WPFInstallUpgrade {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Invokes the function that upgrades all installed programs
|
||||
|
||||
#>
|
||||
if ($sync.ChocoRadioButton.IsChecked) {
|
||||
Install-WinUtilChoco
|
||||
$chocoUpgradeStatus = (Start-Process "choco" -ArgumentList "upgrade all -y" -Wait -PassThru -NoNewWindow).ExitCode
|
||||
if ($chocoUpgradeStatus -eq 0) {
|
||||
Write-Host "Upgrade Successful"
|
||||
}
|
||||
else{
|
||||
Write-Host "Error Occurred. Return Code: $chocoUpgradeStatus"
|
||||
}
|
||||
}
|
||||
else{
|
||||
if((Test-WinUtilPackageManager -winget) -eq "not-installed") {
|
||||
return
|
||||
}
|
||||
|
||||
if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall) {
|
||||
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
|
||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
}
|
||||
|
||||
Update-WinUtilProgramWinget
|
||||
Install-WinUtilChoco # Ensure Chocolatey is installed before upgrading
|
||||
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Updates started ---"
|
||||
Write-Host "-- You can close this window if desired ---"
|
||||
Write-Host "==========================================="
|
||||
|
||||
Start-Process -FilePath powershell.exe -ArgumentList 'choco upgrade all -y'
|
||||
} else {
|
||||
Install-WinUtilWinget # Ensure WinGet is installed before upgrading
|
||||
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Updates started ---"
|
||||
Write-Host "-- You can close this window if desired ---"
|
||||
Write-Host "==========================================="
|
||||
|
||||
Start-Process -FilePath powershell.exe -ArgumentList 'winget upgrade --all --include-unknown --silent --accept-source-agreements --accept-package-agreements'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user