-1

I was trying to determine the installation directory of a SQL Server instance on a 64 bit machine from a 32bit .NET app, and got caught for a while trying to get the registry to work correctly as the regular registry accessed by my code was being virtualized or whatnot by the Windows OS.

I think I have an answer, but I was wondering if there was a better way.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
stackuser83
  • 1,714
  • 1
  • 21
  • 38

3 Answers3

0

Write a small 64-bit program that does the trick and call the .exe from your 32-bit application.

Todd Li
  • 3,129
  • 19
  • 19
0

I didn't finish checking my first answer's correctness because there is a somewhat better way, which is to use the WMI as described here: https://stackoverflow.com/a/5497319/832705

Community
  • 1
  • 1
stackuser83
  • 1,714
  • 1
  • 21
  • 38
-1

My solution is to ask SQLServer what the registry has for it's install directory because it is a 64bit app and can get to the regular 64bit registry and isn't stuck in the 32bit registry sandbox or notwhat.

That can be done using this fellow's answer: https://stackoverflow.com/a/533592/832705

Really great, thanks kindly, Mr. Ian

Community
  • 1
  • 1
stackuser83
  • 1,714
  • 1
  • 21
  • 38