Skip to content
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

[Bug]: Error when applying the Disable Windows feedback collection tweak #381

Closed
guihkx opened this issue Jul 5, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@guihkx
Copy link

guihkx commented Jul 5, 2024

Description

I got the following error on a clean install of Windows 11 Pro 24H2 (build 26100.1000), using privacy.sexy version 0.13.5:

--- Disable Windows feedback collection
The operation completed successfully.
out-file : FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream
constructors that take an OS handle as an IntPtr.
At line:1 char:1
+ reg delete "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "PeriodInNanoSecon ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], NotSupportedException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

The operation completed successfully.
The operation completed successfully.

How can the bug be recreated?

  1. Apply the Disable Windows feedback collection tweak

Operating system

Windows 11 Pro 24H2 (build 26100.1000)

Script file

No response

Screenshots

No response

Additional information

No response

@guihkx guihkx added the bug Something isn't working label Jul 5, 2024
@undergroundwires
Copy link
Owner

I can reproduce this.

Just like #380, it was introduced as part of 0.13.4 in commit cec0b4b. It runs the command reg delete "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /f 2>nul which is correct, but runs this incorrectly as PowerShell (using RunPowerShell) meanwhile it's a batch command (should have used RunInlineCode function).

I will go for the bigger solution for this too. Instead of running reg delete.. commands I will create a shared function in windows.yaml called DeleteRegistryValue or similar, and refactor all code that runs reg delete .. to that function. This will protect against typos in reg delete commands and this kind of mistakes in future.

This will take some time but will be fixed as part of next patch.

Thank you for the great bug reports @guihkx, making our software better, feel free to inform us if you encounter anything else or any suggestion to implement in new issues.

@undergroundwires
Copy link
Owner

Since 0.13.6, all registry operations are standardized/streamlined fixing this bug and preventing future bugs. I also added reversibility to everything possible. It was marathon going through all registry operations and testing but its done now 🚀🎉🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants