# WindowsSdk: Fix finding the \_Instances directory when it's not in the default location · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/cf8f0cdae9f6ca844c60adad6ac45d203d8baf38)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: cf8f0cdae9f6ca844c60adad6ac45d203d8baf38

Requested commit: cf8f0cdae9f6ca844c60adad6ac45d203d8baf38

Commit: cf8f0cdae9f6ca844c60adad6ac45d203d8baf38

Tree: fe673fbb989e3948e0e8501210d6ddc1bedde6b2

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
WindowsSdk: Fix finding the _Instances directory when it's not in the default location

Information about installed MSVC instances are stored in `state.json` files within a `Packages/_Instances` directory. The default location for this is `%PROGRAMDATA%\Microsoft\VisualStudio\Packages\_Instances`. However, it is possible for the Packages directory to be put somewhere else. In that case, the registry value `HKLM\SOFTWARE\Microsoft\VisualStudio\Setup\CachePath` is set and contains the path to the Packages directory.

Previously, WindowsSdk did not check that registry value. After this commit, the registry value `HKLM\SOFTWARE\Microsoft\VisualStudio\Setup\CachePath` is checked first, which matches what ISetupEnumInstances does (according to a Procmon log).

```

## Parents

- [e69caaa39f06b7ddf00c1e439c3df91f4efbdef3](https://git.cafe/gitcafe/zig/commit/e69caaa39f06b7ddf00c1e439c3df91f4efbdef3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/cf8f0cdae9f6ca844c60adad6ac45d203d8baf38?format=markdown)
