File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Sources/Winget-AutoUpdate Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments