6 ms·
if it's trying to be a database, it's doing a terrible job. all the problems of not being files (can you do "find HKEY_CURRENT_USER -name mypackage" to see what
by Hello71 8y ago
if it's trying to be a database, it's doing a terrible job. all the problems of not being files (can you do "find HKEY_CURRENT_USER -name mypackage" to see what the uninstaller left behind?) with none of the benefits of a database (ACID).
- Analemma_ 8y ago> with none of the benefits of a database (ACID) This is not correct, Windows Registry updates are atomic and transactional. There may be other problems with the registry model, but it is a "real" database.
- krylon 8y agoACID means more than atomic updates, though. To be ACID-compliant, you'd have to be able to group several changes to the registry and have them take effect either all at once or not at all.
- eterm 8y agoA word for that is transactional.
- fulafel 8y agoIt's implied by the I (isolation).
- Const-me 8y ago> To be ACID-compliant, you'd have to be able to group several changes to the registry and have them take effect either all at once or not at all. You mean transactions? Windows registry supports them since Vista when they added Kernel Transaction Manager: https://msdn.microsoft.com/en-us/library/windows/desktop/bb986748(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb9... See CreateTransaction, RegCreateKeyTransacted, RegOpenKeyTransacted, CommitTransaction[Async], RollbackTransaction[Async] APIs.
- krylon 8y agoI stand corrected. Good to know, thank you!
- Const-me 8y agoTo be fair, I’ve never used KTM in my apps. In cases when I need to write several values atomically (e.g. in a program with persistent window positions, after user moved a window I want to write all 4 coordinates of the rectangle), I just keep them in a single value, either string or binary. Even without KTM, registry API already guarantees value writes are atomic.
- krylon 8y agoWhen they were working on Windows 7, Microsoft tried to be more open about the development process in order to repair some of the damage Vista had done. So one day, I came across this video, an interview of a few Windows developers. At one point, the person doing the interview asks, "So, what do you guys think of the Registry?". Awkward silence, followed by uncomfortable laughter. Finally, one of the programmers says, "I think it's fair to say it was far more [widely used] than any of its designers had anticipated." (Quoting from memory from a video I saw once, ~10 years ago, so the wording might not be perfectly accurate, but that's how I remember it.)
- ksk 8y agohttps://msdn.microsoft.com/en-us/library/windows/desktop/ms724875(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms7... Could you point out which of these doesn't work as intended?
- mappu 8y ago> can you do "find HKEY_CURRENT_USER -name mypackage" Powershell comes with a kind of FUSE mount for the registry: PS C:\> Set-Location HKCU: PS HKCU:\> Get-ChildItem -Recurse | where-object { $_.Name -match "HeidiSQL" }
- joeyaiello 8y agoJust to make sure everyone on HN knows you can get real pithy with PowerShell, this also works: PS C:\> cd hkcu: PS HKCU:\> ls -r | ? name -m 'HeidiSQL'
- Slackwise 8y agoOr for those who come from Unixland and see way too much typing, PowerShell has aliases that make this much shorter: cd HKCU: ls -r -i *HeidiSQL* Or if you really want to use the match operator, regex, or other expression, you can still pipe it through the Where-Object alias: ls -r | ? {$_.Name -match "HeidiSQL"}