Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I launch another process in XP compatibility mode?

Our application requires HASP SRM device driver to be installed in order for ours to install and run.

At this time, only their 5.50 drivers work consistently on all tested platforms (both their 5.75 (official) and 5.86 (beta) drivers crash on about 1 in 3 computers tested).

Hence, their 5.50 drivers are good, anything else currently available is broken, and the 5.50 drivers refuse to load under Vista and Windows 7. However, if I set the exe's properties to "XP compatibility mode" then their 5.50 driver installs and runs successfully.

I dug around in the registry under Windows 7, and I've found that there is at least one entry made when I ask for compatibility mode:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\
    full-path REG_SZ WINXPSP3

I should be able to add that key from our installer, before attempting to launch the 5.50 driver installer.

Questions:

  • Where I can find a more complete discussion of compatibility modes?
  • Are the keys/settings different under Vista vs. Windows 7?
  • Are the keys/settings different under 32 bit vs. 64 bit?
  • Is there a way to directly ask for this when I call CreateProcess()?
like image 849
Mordachai Avatar asked Jan 25 '10 19:01

Mordachai


1 Answers

You can set the __COMPAT_LAYER environment variable (By setting it in your process before calling CreateProcess, or build a new environment block for CreateProcess)

like image 169
Anders Avatar answered Sep 19 '22 02:09

Anders