Frage

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

War es hilfreich?

Lösung

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

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top