Changed shortcut to bat (no admin rights needed)

pull/678/head
Romain 2024-09-01 15:40:49 +02:00
parent 8c0c94cc4e
commit 8a41e74df4
3 changed files with 22 additions and 15 deletions

View File

@ -68,7 +68,7 @@ jobs:
- name: Overwrite Version.txt file
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: Sources/WAU/Winget-AutoUpdate/Version.txt
path: Sources/Winget-AutoUpdate/Version.txt
write-mode: overwrite
contents: ${{ steps.versioning.outputs.version }}
@ -88,8 +88,8 @@ jobs:
echo "### Extract MSI ###"
7z x MicrosoftDeploymentToolkit_x64.msi
echo "### Copy ServiceUI.exe to 'Sources/WAU/Winget-AutoUpdate' folder ###"
mv Modena_File206 Sources/WAU/Winget-AutoUpdate/ServiceUI.exe -v
echo "### Copy ServiceUI.exe to 'Sources/Winget-AutoUpdate' folder ###"
mv Modena_File206 Sources/Winget-AutoUpdate/ServiceUI.exe -v
echo "### Go to Sources ###"
cd Sources

View File

@ -41,7 +41,7 @@ jobs:
- name: Overwrite Version.txt file
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: Sources/WAU/Winget-AutoUpdate/Version.txt
path: Sources/Winget-AutoUpdate/Version.txt
write-mode: overwrite
contents: "${{ steps.versioning.outputs.version }}"
@ -61,8 +61,8 @@ jobs:
echo "### Extract MSI ###"
7z x MicrosoftDeploymentToolkit_x64.msi
echo "### Copy ServiceUI.exe to 'Sources/WAU/Winget-AutoUpdate' folder ###"
mv Modena_File206 Sources/WAU/Winget-AutoUpdate/ServiceUI.exe -v
echo "### Copy ServiceUI.exe to 'Sources/Winget-AutoUpdate' folder ###"
mv Modena_File206 Sources/Winget-AutoUpdate/ServiceUI.exe -v
echo "### Go to Sources ###"
cd Sources

View File

@ -1,3 +1,10 @@
@@:: This prolog allows a PowerShell script to be embedded in a .CMD file.
@@:: Any non-PowerShell content must be preceeded by "@@"
@@setlocal
@@set POWERSHELL_BAT_ARGS=%*
@@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:"=\"%
@@PowerShell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %POWERSHELL_BAT_ARGS%);'+[String]::Join([char]10,$((Get-Content '%~f0') -notmatch '^^@@'))) & goto :EOF
<#
.SYNOPSIS
Install and configure Winget-AutoUpdate
@ -21,7 +28,7 @@ if ( $psversionTable.PSEdition -eq "core" ) {
import-Module -name Appx -UseWIndowsPowershell -WarningAction:SilentlyContinue
}
$Script:WAUConfiguratorVersion = Get-Content "$PSScriptRoot\Winget-AutoUpdate\Version.txt"
$Script:WAUConfiguratorVersion = Get-Content ".\Winget-AutoUpdate\Version.txt"
<# FUNCTIONS #>
@ -176,12 +183,12 @@ function Start-Installations {
if ($WAUUseWhiteList) {
$WAUParameters += "-UseWhiteList "
if ($WAUListPath) {
Copy-Item $WAUListPath -Destination "$PSScriptRoot\included_apps.txt" -Force -ErrorAction SilentlyContinue
Copy-Item $WAUListPath -Destination ".\included_apps.txt" -Force -ErrorAction SilentlyContinue
}
}
else {
if ($WAUListPath) {
Copy-Item $WAUListPath -Destination "$PSScriptRoot\excluded_apps.txt" -Force -ErrorAction SilentlyContinue
Copy-Item $WAUListPath -Destination ".\excluded_apps.txt" -Force -ErrorAction SilentlyContinue
}
}
if ($WAUDesktopShortcut) {
@ -195,7 +202,7 @@ function Start-Installations {
}
#Install Winget-Autoupdate
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command ""& '$PSScriptRoot\Winget-AutoUpdate-Install.ps1' $WAUParameters""" -Wait -Verb RunAs
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command ""& '.\Winget-AutoUpdate-Install.ps1' $WAUParameters""" -Wait -Verb RunAs
}
@ -268,7 +275,7 @@ function Start-Uninstallations ($AppToUninstall) {
#Run Winget-Install -Uninstall
$AppsToUninstall = "'$($AppToUninstall -join "','")'"
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command `"$PSScriptRoot\Winget-AutoUpdate\Winget-Install.ps1 -AppIDs $AppsToUninstall -Uninstall`"" -Wait -Verb RunAs
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command `".\Winget-AutoUpdate\Winget-Install.ps1 -AppIDs $AppsToUninstall -Uninstall`"" -Wait -Verb RunAs
Close-PopUp
}