File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -564,13 +564,20 @@ public static bool HasWritePermission()
564
564
{
565
565
try
566
566
{
567
+ var basePath = GetBaseDirectory ( ) ;
567
568
//When this file exists, it is equivalent to having no permission to read and write
568
- if ( File . Exists ( Path . Combine ( GetBaseDirectory ( ) , "NotStoreConfigHere.txt" ) ) )
569
+ if ( File . Exists ( Path . Combine ( basePath , "NotStoreConfigHere.txt" ) ) )
569
570
{
570
571
return false ;
571
572
}
572
573
573
- var tempPath = Path . Combine ( GetBaseDirectory ( ) , "guiTemps" ) ;
574
+ //Check if it is installed by Windows WinGet
575
+ if ( IsWindows ( ) && basePath . Contains ( "Users" ) && basePath . Contains ( "WinGet" ) )
576
+ {
577
+ return false ;
578
+ }
579
+
580
+ var tempPath = Path . Combine ( basePath , "guiTemps" ) ;
574
581
if ( ! Directory . Exists ( tempPath ) )
575
582
{
576
583
Directory . CreateDirectory ( tempPath ) ;
You can’t perform that action at this time.
0 commit comments