-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MicroWin] Fix Recall "Dependency" Misinformation #2947
[MicroWin] Fix Recall "Dependency" Misinformation #2947
Conversation
Fixed the misinformation caused by the Recall feature. Thanks @WitherOrNot and @thecatontheceiling for spotting the problem
# 3. Open the file and do the modification | ||
$appxManifest = Get-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" | ||
$originalLine = $appxManifest[13] | ||
$dependency = "`n <PackageDependency Name=`"Microsoft.WindowsAppRuntime.CBS`" MinVersion=`"1.0.0.0`" Publisher=`"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US`" />" | ||
$appxManifest[13] = "$originalLine$dependency" | ||
Set-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" -Value $appxManifest -Force -Encoding utf8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if modifying the app manifest through line numbering is a good idea.. but I can't tell/know a better approach to fix this problem, other then pattern matching using RegEx.. which'll require a bit testing, and some headaches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used this method because I had used it earlier for DT (more on that here) and it works there.
I can't think of another way to insert a line on PowerShell either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I suggest this?
# Set file name
$File = '.\appxmanifest.xml'
# Process lines of text from file and assign result to $NewContent variable
$NewContent = Get-Content -Path $File |
ForEach-Object {
# Output the existing line to pipeline in any case
$_
# If line matches regex
if($_ -match ('^' + [regex]::Escape(' <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.21340.0" MaxVersionTested="10.0.32767.0" />')))
{
# Add output additional line right after it
' <PackageDependency Name="Microsoft.WindowsAppRuntime.CBS" MinVersion="1.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />'
}
}
# Write content of $NewContent back to file
$NewContent | Out-File -FilePath $File -Encoding Default -Force
from https://superuser.com/questions/821112/add-line-to-text-file-after-specific-line-with-powershell
Applied here as
# 3. Open the file and do the modification
$appxManifest = Get-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" |
ForEach-Object {
# Output the existing line to pipeline in any case
$_
# If line matches regex
if($_ -match ('^' + [regex]::Escape(' <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.21340.0" MaxVersionTested="10.0.32767.0" />')))
{
# Add output additional line right after it
' <PackageDependency Name="Microsoft.WindowsAppRuntime.CBS" MinVersion="1.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />'
}
}
Set-Content -Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" -Value $appxManifest -Force -Encoding utf8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other then the suggestion in this review comment, these changes looks good to me, well done @CodingWonders 👍
I don't want to deal with Recall ever again... doing that was as awful as dealing with News and Interests on Windows 10 (which I eventually failed at for the anniversary PR) |
This change can get reverted by a windows update but it's fine since this is only necesarry during windows installation, if the change gets reverted after that then nothing will break |
Will this fix be added to WinUtil and MicroWin? I tested a new install yesterday and the recall feature still hasn't been removed. Thanks |
@Beats24-7, it's in the latest prerelease |
Has it been added to the latest update? Just tested it with a new fresh Micro Win install (WinUtil from October 7th update) and Recall still shows up (disabled though), unfortunately. Thanks again |
At the time of writing, it's still in prerelease (dev branch/channel), but it'll hopefully be available as the latest stable release in the next few days. Note If you want to test & use it, you can run dev branch of WinUtil by running Screenshots |
So I have just tested the pre-release version using |
It's removed there, and it doesn't alter the File Explorer look, if that's what you're talking about, @Beats24-7 |
But it's still finding Recall using |
On 24H2 and later, the Recall feature is still declared in the feature list, but it's disabled, and should not cause any problems with your experience |
Ok, but it was possible to disable Recall previously as well. And I didn't have any file explorer issues. I thought it would be removed completely with this fix. Or is it just still showing up because it's included in the 24H2 feature list, but it's actually removed? |
Ok thanks. |
Type of Change
Description
This PR removes the Recall exclusion and adds the true fix for #2697. Thanks to @WitherOrNot and @thecatontheceiling for spotting this problem, and thanks to Microsoft for not testing Jack.
Testing
Testing has concluded with no issues
Impact
Clarify that it's a Windows bug. This should not have any impact on end-users.
Issue related to PR
Additional Information
Please test this for any issues.
Checklist