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

Better way of excluding the system drive from locking #1

Open
dleidert opened this issue Jan 30, 2019 · 1 comment
Open

Better way of excluding the system drive from locking #1

dleidert opened this issue Jan 30, 2019 · 1 comment

Comments

@dleidert
Copy link
Owner

The current method expects C: to be the system drive and therefor excludes this drive letter. There should be a better way that should not depend on the drive letter.

dleidert added a commit that referenced this issue Feb 18, 2019
This is a first step to solve #1
@dleidert
Copy link
Owner Author

I'm not sure, if manage-bde.exe will refuse to lock the system drive. I therefor added the condition

(...) AND NOT C:

to the AppliesTo registry property. For a more generic approach, I tried to use/test the properties [System.Volume.IsRoot](https://docs.microsoft.com/en-us/windows/desktop/properties/props-system-volume-isroot) and [System.Storage.SystemCritical](https://docs.microsoft.com/en-us/windows/desktop/properties/props-system-storage-systemcritical) instead of hardcoding the drive letter. I tried to compare the properties with System.StructuredQueryType.Boolean#True (or similar). But this didn't work at all. Unfortunately I did not find any useful reference/example for using these properties in the registry either.

So the next approach I tried was to rely on the system environment variable %SystemDrive%. I therefor tried to use

(...) AND NOT %SystemDrive%

which doesn't work either.

So my current workaround is, to read the environment variable during installation and create the AppliesTo key property depending on its value.

I'm thinking about adding another page to the installer, which lists all found drives + an item for removable media, where the user can select, which drives should be excluded from the lock option (with the system drive being checked by default).

dleidert added a commit that referenced this issue Feb 18, 2019
I forgot to fix the variable name after I tested the installer for the error case. See #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant