@@ -1929,6 +1929,58 @@ public void WinGetUpdateRetriesWithTheLocalIdentifierWhenNoInstalledPackageMatch
19291929 Assert . Contains ( "--exact" , retryAttempt ) ;
19301930 }
19311931
1932+ [ Fact ]
1933+ public void WinGetLocalIdentifierRetryDropsTheScopeAndArchitectureThatHidTheInstalledEntry ( )
1934+ {
1935+ const string fanControlLocalIdentifier =
1936+ @"ARP\Machine\X86\{141A88F8-31AC-49EA-B428-2BE8C19DED83}_is1" ;
1937+ var manager = new WinGet ( ) ;
1938+ SetCliToolKind ( manager , WinGetCliToolKind . SystemWinGet ) ;
1939+ var package = new PackageBuilder ( )
1940+ . WithManager ( manager )
1941+ . WithId ( "Rem0o.FanControl" )
1942+ . WithVersion ( "251" )
1943+ . WithNewVersion ( "268" )
1944+ . Build ( ) ;
1945+ NativePackageHandler . AddLocalIdentifier ( package , fanControlLocalIdentifier ) ;
1946+ static InstallOptions UserScopeX64 ( ) =>
1947+ new ( ) { InstallationScope = PackageScope . User , Architecture = Architecture . x64 } ;
1948+
1949+ var firstAttempt = manager . OperationHelper . GetParameters (
1950+ package ,
1951+ UserScopeX64 ( ) ,
1952+ OperationType . Update
1953+ ) ;
1954+ Assert . Contains ( "--scope" , firstAttempt ) ;
1955+ Assert . Contains ( "--architecture" , firstAttempt ) ;
1956+
1957+ var veredict = manager . OperationHelper . GetResult (
1958+ package ,
1959+ OperationType . Update ,
1960+ [ ] ,
1961+ unchecked ( ( int ) 0x8A150014 )
1962+ ) ;
1963+ OperationAssert . HasVeredict ( veredict , OperationVeredict . AutoRetry ) ;
1964+
1965+ var retryAttempt = manager . OperationHelper . GetParameters (
1966+ package ,
1967+ UserScopeX64 ( ) ,
1968+ OperationType . Update
1969+ ) ;
1970+ Assert . Contains ( $ "\" { fanControlLocalIdentifier } \" ", retryAttempt ) ;
1971+ Assert . DoesNotContain ( "--scope" , retryAttempt ) ;
1972+ Assert . DoesNotContain ( "--architecture" , retryAttempt ) ;
1973+
1974+ var manualCommand = manager . OperationHelper . GetStandaloneParameters (
1975+ package ,
1976+ UserScopeX64 ( ) ,
1977+ OperationType . Update
1978+ ) ;
1979+ Assert . Contains ( $ "\" { fanControlLocalIdentifier } \" ", manualCommand ) ;
1980+ Assert . DoesNotContain ( "--scope" , manualCommand ) ;
1981+ Assert . DoesNotContain ( "--architecture" , manualCommand ) ;
1982+ }
1983+
19321984 [ Fact ]
19331985 public void WinGetUninstallRetriesWithTheLocalIdentifierWhenNoInstalledPackageMatches ( )
19341986 {
0 commit comments