0

I have an Office Addin. It launches an app with runas=admin when it needs to set the license key in HKLM. up to Office 2007 Office is 32-bit. However Office 2010 comes in both a 32-bit or 64-bit version. That version determines if an HKLM key is in WoW or note.

Therefore I need to launch the application in the bitness that matches Office (and my AddIn). How can I do that?

Or in the alternative, how can I access both the WoW registry when running in 64-bit mode and the 64-bit (regular) registry when running in WoW?

I am on .NET 3.5.

thanks - dave

David Thielen
  • 28,723
  • 34
  • 119
  • 193

2 Answers2

8

You can modify the .exe with CorFlags:

CorFlags.exe MyAssembly.exe /32Bit+

Will force 32bit, and:

CorFlags.exe MyAssembly.exe /32Bit-

Will turn it off again. There are some alternatives in this blog post.

robertc
  • 74,533
  • 18
  • 193
  • 177
0

You need to have two different exe's compiled respectively. You can't force the bitness of the exe beforehand.

Joel Lucsy
  • 8,520
  • 1
  • 29
  • 35