Skip to content

Commit 7bfb7e5

Browse files
committed
If not exist a TEMP icon already
1 parent 35a6ade commit 7bfb7e5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/Winget-AutoUpdate/WAU-Settings-GUI.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,10 +1393,12 @@ if (Test-Path $wauIconPath) {
13931393
$systemTemp = [System.Environment]::GetEnvironmentVariable("TEMP", [System.EnvironmentVariableTarget]::Machine)
13941394
if (-not $systemTemp) { $systemTemp = "$env:SystemRoot\Temp" }
13951395
$iconDest = Join-Path $systemTemp "icon.ico"
1396-
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($iconSource)
1397-
$fs = [System.IO.File]::Open($iconDest, [System.IO.FileMode]::Create)
1398-
$icon.Save($fs)
1399-
$fs.Close()
1396+
if (-not (Test-Path $iconDest)) {
1397+
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($iconSource)
1398+
$fs = [System.IO.File]::Open($iconDest, [System.IO.FileMode]::Create)
1399+
$icon.Save($fs)
1400+
$fs.Close()
1401+
}
14001402
$Script:WAU_ICON = $iconDest
14011403
}
14021404

0 commit comments

Comments
 (0)