relative path

pull/680/head
Romain 2024-09-01 23:11:08 +02:00
parent 4c9eb00d36
commit 93a076c46b
1 changed files with 7 additions and 7 deletions

View File

@ -28,13 +28,13 @@ if ( $psversionTable.PSEdition -eq "core" ) {
import-Module -name Appx -UseWIndowsPowershell -WarningAction:SilentlyContinue 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 #> <# FUNCTIONS #>
. "$PSScriptRoot\Winget-AutoUpdate\functions\Update-WinGet.ps1" . ".\Winget-AutoUpdate\functions\Update-WinGet.ps1"
. "$PSScriptRoot\Winget-AutoUpdate\functions\Get-WingetCmd.ps1" . ".\Winget-AutoUpdate\functions\Get-WingetCmd.ps1"
#Function to start or update popup #Function to start or update popup
Function Start-PopUp ($Message) { Function Start-PopUp ($Message) {
@ -183,12 +183,12 @@ function Start-Installations {
if ($WAUUseWhiteList) { if ($WAUUseWhiteList) {
$WAUParameters += "-UseWhiteList " $WAUParameters += "-UseWhiteList "
if ($WAUListPath) { if ($WAUListPath) {
Copy-Item $WAUListPath -Destination "$PSScriptRoot\included_apps.txt" -Force -ErrorAction SilentlyContinue Copy-Item $WAUListPath -Destination ".\included_apps.txt" -Force -ErrorAction SilentlyContinue
} }
} }
else { else {
if ($WAUListPath) { 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) { if ($WAUDesktopShortcut) {
@ -202,7 +202,7 @@ function Start-Installations {
} }
#Install Winget-Autoupdate #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
} }
@ -275,7 +275,7 @@ function Start-Uninstallations ($AppToUninstall) {
#Run Winget-Install -Uninstall #Run Winget-Install -Uninstall
$AppsToUninstall = "'$($AppToUninstall -join "','")'" $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 Close-PopUp
} }