mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-13 22:25:51 -06:00
Test 2024 02 03 (#1583)
* Compile Winutil * winget fixes and checks * Compile Winutil * fix Parsec winget id (#1558) * Compile Winutil * fix winget issues * Compile Winutil * cleanup winget * Compile Winutil * Updated README.md (#1570) Fixed typos in readme file ("cusom" -> "custom", "twekas" -. "tweaks". Also added full stops. * Compile Winutil * Create close-old-issues.yml * Compile Winutil * update issues --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: Saikrishnan K <53394202+K-Saikrishnan@users.noreply.github.com> Co-authored-by: Harry Perkin <68484588+HarryPerkin@users.noreply.github.com>
This commit is contained in:
parent
b7a86dea4d
commit
d0aa396c2a
52
.github/workflows/close-old-issues.yaml
vendored
Normal file
52
.github/workflows/close-old-issues.yaml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Close Inactive Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Run daily
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Close inactive issues
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const octokit = context.octokit;
|
||||
|
||||
// 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);
|
||||
|
||||
// Get all open issues
|
||||
const { data: issues } = await octokit.rest.issues.listForRepo({
|
||||
owner,
|
||||
repo,
|
||||
state: 'open',
|
||||
});
|
||||
|
||||
// Close issues inactive for more than the inactivity period
|
||||
for (const issue of issues) {
|
||||
const lastCommentDate = issue.updated_at;
|
||||
if (new Date(lastCommentDate) < inactivityPeriod) {
|
||||
// Close the issue and add a comment
|
||||
await octokit.rest.issues.update({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issue.number,
|
||||
state: 'closed',
|
||||
});
|
||||
|
||||
await octokit.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issue.number,
|
||||
body: 'Closed due to inactivity',
|
||||
});
|
||||
}
|
||||
}
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,3 +38,4 @@ Microsoft.PowerShell.ConsoleHost.dll
|
||||
.DS_Store
|
||||
microwin.log
|
||||
True
|
||||
test.ps1
|
||||
|
@ -45,10 +45,10 @@ 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
|
||||
```
|
||||
|
@ -1333,7 +1333,7 @@
|
||||
"content": "Parsec",
|
||||
"description": "Parsec is a low-latency, high-quality remote desktop sharing application for collaborating and gaming across devices.",
|
||||
"link": "https://parsec.app/",
|
||||
"winget": "Parsec.parsec"
|
||||
"winget": "Parsec.Parsec"
|
||||
},
|
||||
"WPFInstallpdf24creator": {
|
||||
"category": "Document",
|
||||
@ -2271,4 +2271,4 @@
|
||||
"link": "https://pyenv-win.github.io/pyenv-win/",
|
||||
"winget": "na"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ Function Install-WinUtilProgramWinget {
|
||||
|
||||
Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
||||
if($manage -eq "Installing"){
|
||||
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait
|
||||
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --ignore-security-hash --disable-interactivity --silent $Program" -NoNewWindow -Wait
|
||||
}
|
||||
if($manage -eq "Uninstalling"){
|
||||
Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait
|
||||
|
@ -22,6 +22,7 @@ function Install-WinUtilWinget {
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Already Installed"
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "winget settings --enable InstallerHashOverride" -Wait -NoNewWindow
|
||||
return
|
||||
}
|
||||
|
||||
@ -39,10 +40,47 @@ function Install-WinUtilWinget {
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "Running Alternative Installer and Direct Installing"
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget"
|
||||
|
||||
Write-Host "Winget Installed"
|
||||
Write-Host "Running Alternative Installers and Direct Installing"
|
||||
Write-Host "- Attempting first install method..."
|
||||
|
||||
$wingetURL = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
|
||||
$wingetFileName = Split-Path $wingetURL -Leaf
|
||||
$wingetInstallerPath = Join-Path $env:TEMP $wingetFileName
|
||||
|
||||
Invoke-WebRequest -Uri $wingetURL -OutFile $wingetInstallerPath
|
||||
Add-AppxPackage -Path $wingetInstallerPath
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via GitHub"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via GitHub"
|
||||
}
|
||||
# Second Method
|
||||
Write-Host "- Attempting second install method..."
|
||||
|
||||
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
|
||||
Install-Script -Name winget-install -Force
|
||||
$wingetArgument = "-ExecutionPolicy Bypass winget-install.ps1"
|
||||
Start-Process powershell -ArgumentList $wingetArgument -Wait
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via PowerShell Gallery Script"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via PowerShell Gallery Script"
|
||||
}
|
||||
# Third Method
|
||||
Write-Host "- Attempting third install method..."
|
||||
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget --force" -Wait -NoNewWindow
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via Chocolatey"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via Chocolatey"
|
||||
}
|
||||
}
|
||||
Catch{
|
||||
throw [WingetFailedInstall]::new('Failed to install')
|
||||
|
@ -17,14 +17,34 @@ function Test-WinUtilPackageManager {
|
||||
[System.Management.Automation.SwitchParameter]$choco
|
||||
)
|
||||
|
||||
if($winget){
|
||||
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
|
||||
# Install Winget if not detected
|
||||
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
||||
if ($wingetExists) {
|
||||
$wingetVersion = [System.Version]::Parse((winget --version).Trim('v'))
|
||||
$minimumWingetVersion = [System.Version]::new(1,2,10691) # Win 11 23H2 comes with bad winget v1.2.10691
|
||||
$wingetOutdated = $wingetVersion -le $minimumWingetVersion
|
||||
|
||||
Write-Host "Winget v$wingetVersion"
|
||||
}
|
||||
|
||||
if (!$wingetExists -or $wingetOutdated) {
|
||||
if (!$wingetExists) {
|
||||
Write-Host "Winget not detected"
|
||||
} else {
|
||||
Write-Host "- Winget out-dated"
|
||||
}
|
||||
}
|
||||
|
||||
if ($winget) {
|
||||
if ($wingetExists -and !$wingetOutdated) {
|
||||
Write-Host "- Winget up-to-date"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
if($choco){
|
||||
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
|
||||
Write-Host "Chocolatey v$chocoVersion"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
82
winutil.ps1
82
winutil.ps1
@ -10,7 +10,7 @@
|
||||
Author : Chris Titus @christitustech
|
||||
Runspace Author: @DeveloperDurp
|
||||
GitHub : https://github.com/ChrisTitusTech
|
||||
Version : 24.02.03
|
||||
Version : 24.02.06
|
||||
#>
|
||||
param (
|
||||
[switch]$Debug,
|
||||
@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms
|
||||
# Variable to sync between runspaces
|
||||
$sync = [Hashtable]::Synchronized(@{})
|
||||
$sync.PSScriptRoot = $PSScriptRoot
|
||||
$sync.version = "24.02.03"
|
||||
$sync.version = "24.02.06"
|
||||
$sync.configs = @{}
|
||||
$sync.ProcessRunning = $false
|
||||
|
||||
@ -576,7 +576,7 @@ Function Install-WinUtilProgramWinget {
|
||||
|
||||
Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
||||
if($manage -eq "Installing"){
|
||||
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait
|
||||
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --ignore-security-hash --disable-interactivity --silent $Program" -NoNewWindow -Wait
|
||||
}
|
||||
if($manage -eq "Uninstalling"){
|
||||
Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait
|
||||
@ -612,6 +612,7 @@ function Install-WinUtilWinget {
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Already Installed"
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "winget settings --enable InstallerHashOverride" -Wait -NoNewWindow
|
||||
return
|
||||
}
|
||||
|
||||
@ -629,10 +630,47 @@ function Install-WinUtilWinget {
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "Running Alternative Installer and Direct Installing"
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget"
|
||||
|
||||
Write-Host "Winget Installed"
|
||||
Write-Host "Running Alternative Installers and Direct Installing"
|
||||
Write-Host "- Attempting first install method..."
|
||||
|
||||
$wingetURL = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
|
||||
$wingetFileName = Split-Path $wingetURL -Leaf
|
||||
$wingetInstallerPath = Join-Path $env:TEMP $wingetFileName
|
||||
|
||||
Invoke-WebRequest -Uri $wingetURL -OutFile $wingetInstallerPath
|
||||
Add-AppxPackage -Path $wingetInstallerPath
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via GitHub"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via GitHub"
|
||||
}
|
||||
# Second Method
|
||||
Write-Host "- Attempting second install method..."
|
||||
|
||||
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
|
||||
Install-Script -Name winget-install -Force
|
||||
$wingetArgument = "-ExecutionPolicy Bypass winget-install.ps1"
|
||||
Start-Process powershell -ArgumentList $wingetArgument -Wait
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via PowerShell Gallery Script"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via PowerShell Gallery Script"
|
||||
}
|
||||
# Third Method
|
||||
Write-Host "- Attempting third install method..."
|
||||
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget --force" -Wait -NoNewWindow
|
||||
if (Test-WinUtilPackageManager -winget) {
|
||||
# Checks if winget executable exists and if the Windows Version is 1809 or higher
|
||||
Write-Host "Winget Installed via Chocolatey"
|
||||
return
|
||||
} else {
|
||||
Write-Host "- Failed to install Winget via Chocolatey"
|
||||
}
|
||||
}
|
||||
Catch{
|
||||
throw [WingetFailedInstall]::new('Failed to install')
|
||||
@ -2313,14 +2351,34 @@ function Test-WinUtilPackageManager {
|
||||
[System.Management.Automation.SwitchParameter]$choco
|
||||
)
|
||||
|
||||
if($winget){
|
||||
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
|
||||
# Install Winget if not detected
|
||||
$wingetExists = Get-Command -Name winget -ErrorAction SilentlyContinue
|
||||
if ($wingetExists) {
|
||||
$wingetVersion = [System.Version]::Parse((winget --version).Trim('v'))
|
||||
$minimumWingetVersion = [System.Version]::new(1,2,10691) # Win 11 23H2 comes with bad winget v1.2.10691
|
||||
$wingetOutdated = $wingetVersion -le $minimumWingetVersion
|
||||
|
||||
Write-Host "Winget v$wingetVersion"
|
||||
}
|
||||
|
||||
if (!$wingetExists -or $wingetOutdated) {
|
||||
if (!$wingetExists) {
|
||||
Write-Host "Winget not detected"
|
||||
} else {
|
||||
Write-Host "- Winget out-dated"
|
||||
}
|
||||
}
|
||||
|
||||
if ($winget) {
|
||||
if ($wingetExists -and !$wingetOutdated) {
|
||||
Write-Host "- Winget up-to-date"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
if($choco){
|
||||
if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
|
||||
Write-Host "Chocolatey v$chocoVersion"
|
||||
return $true
|
||||
}
|
||||
}
|
||||
@ -6748,7 +6806,7 @@ $sync.configs.applications = '{
|
||||
"content": "Parsec",
|
||||
"description": "Parsec is a low-latency, high-quality remote desktop sharing application for collaborating and gaming across devices.",
|
||||
"link": "https://parsec.app/",
|
||||
"winget": "Parsec.parsec"
|
||||
"winget": "Parsec.Parsec"
|
||||
},
|
||||
"WPFInstallpdf24creator": {
|
||||
"category": "Document",
|
||||
@ -7660,7 +7718,6 @@ $sync.configs.applications = '{
|
||||
"content": "Miniconda",
|
||||
"description": "Miniconda is a free minimal installer for conda. It is a small bootstrap version of Anaconda that includes only conda, Python, the packages they both depend on, and a small number of other useful packages (like pip, zlib, and a few others).",
|
||||
"link": "https://docs.conda.io/projects/miniconda",
|
||||
"panel": "1",
|
||||
"winget": "Anaconda.Miniconda3"
|
||||
},
|
||||
"WPFInstalltemurin": {
|
||||
@ -7669,7 +7726,6 @@ $sync.configs.applications = '{
|
||||
"content": "Eclipse Temurin",
|
||||
"description": "Eclipse Temurin is the open source Java SE build based upon OpenJDK.",
|
||||
"link": "https://adoptium.net/temurin/",
|
||||
"panel": "1",
|
||||
"winget": "EclipseAdoptium.Temurin.21.JDK"
|
||||
},
|
||||
"WPFInstallintelpresentmon": {
|
||||
@ -7678,7 +7734,6 @@ $sync.configs.applications = '{
|
||||
"content": "Intel?? PresentMon",
|
||||
"description": "A new gaming performance overlay and telemetry application to monitor and measure your gaming experience.",
|
||||
"link": "https://game.intel.com/us/stories/intel-presentmon/",
|
||||
"panel": "4",
|
||||
"winget": "Intel.PresentMon.Beta"
|
||||
},
|
||||
"WPFInstallpyenvwin": {
|
||||
@ -7687,7 +7742,6 @@ $sync.configs.applications = '{
|
||||
"content": "Python Version Manager (pyenv-win)",
|
||||
"description": "pyenv for Windows is a simple python version management tool. It lets you easily switch between multiple versions of Python.",
|
||||
"link": "https://pyenv-win.github.io/pyenv-win/",
|
||||
"panel": "1",
|
||||
"winget": "na"
|
||||
}
|
||||
}' | convertfrom-json
|
||||
|
Loading…
Reference in New Issue
Block a user