0

I use VC2008 develop a 32bit app which will access 64bit registry via RegQueryValueEx, and I set samDesired parameter to KEY_READ | KEY_WOW64_64KEY

Under 64bit Windows 7, if I double-click the 32bit app, then it can access the 64bit registry successfully.

However, if I create an 32bit installer with Wise Installation System for the 32bit app, and the installer will invoke the app after the installation. Then each time after the installation is completed and the app is invoked by the installer, then the 32bit app will not be able to access the 64bit registry any more. The error code returned by RegQueryValueEx is 2(File not found error).

Even if I set to run the installer as administrator, the problem still exists.

How to solve it?

alancc
  • 487
  • 2
  • 24
  • 68
  • 1
    Such vague reproduction steps. – Lightness Races in Orbit Jul 08 '14 at 16:40
  • 1
    Having an installer also automatically start the program is a Big Mistake. The installer acquired an elevated security token from the UAC prompt to allow writing sensitive registry keys. Your program inherits that token when the installer starts it. But only once. After that it runs with a normal token and can no longer poke those keys anymore. The only real solution is to stop trying to write keys that you don't have access to. – Hans Passant Jul 08 '14 at 17:07
  • Sounds like your program has inherited some weird state from the installer, perhaps Windows has put it into some sort of compatibility mode. If you absolutely must run the program from the installer, [this answer](http://stackoverflow.com/a/2785337/886887) might help. – Harry Johnston Jul 08 '14 at 22:28

0 Answers0