Compatibility mode


  1. Posts : 4
    Windows 10
       #1

    Compatibility mode


    I'm doing some research on an old application that I'm taking care of.
    As of Windows 8, it works if the Windows compatibility mode is se to "Windows 7" and I confirmed it also works if I set the compatibility mode on Windows 10.
    That problem I'm facing is that, I need to set the compatibility mode programatically, which I do in the installer for the app. Setting compatibility works properly on Windows 8 but not on Windows 10. It does not set anything. Suppose the same code simply does not work.
    So I was playing with the registry to confirm that if I set a proper value for my app in the HKLM„SOFTWARE„Microsoft„Windows NT„CurrentVersion„AppCompatFlags„Layers key, the compatiblity mode get set.
    This is straight forward and very easy to do.
    The issue I encountered is that, if I set the registry value manually or programatically, it does not get really applied. Looking at my application's property clearly shows the compatibility mode is correctly set. But until I manually click on "OK" button while showing the "Compatibility" tab, the setting does not get finalized as far as I see.
    If this is only way, basically the comapatibility mode needs to be set MANUALLY ONLY. It does not make sense for me.
    Even worse, I tried the same test on Windows 8.1 and I've got exact same behaviour. It only works if the "OK" button is click in the property dialog while showing the "Compatibility" tab.
    I'm really lost on how the capability mode works programatically.
    If anyone has any clue on this, please shed a light for me or direct me to a good reference(s).

    Thank you in advance.
      My Computer


  2. Posts : 3,257
    Windows 10 Pro
       #2

    Compatibility mode isn't supposed to work programmatically.

    You're supposed to fix your app, so it doesn't need compatibility. Compatibility mode is only for users who want to enable compatibility mode on apps that don't function correctly. If apps could set this behavior, then they would not fix their problems and just enable compatibility mode as their "fix" (which is what you're trying to do). Nobody would bother fixing anything.

    How about fixing your app instead?
      My Computer


  3. Posts : 1,255
    Windows 10 Pro
       #3

    Welcome to the forum.

    It was never intended that an application would set compatibility mode and this is unsupported. Much of compatibility mode operation is documented only as an implementation detail and subject to change without notice.

    This blog entry by Raymond Chen, a senior Microsoft developer, is relevant to this situation:
    http://blogs.msdn.com/b/oldnewthing/...1.aspx#9979973

    A quote:
    "Don't touch that knob; the knob is there for the customer, not for the program. And it's there to clean up after your mistakes, not to let you hide behind them."
      My Computer


  4. Posts : 3,502
    Win_8.1-Pro, Win_10.1607-Pro, Mint_17.3
       #4

    TedMtl said:
    I'm doing some research on an old application that I'm taking care of.
    As of Windows 8, it works if the Windows compatibility mode is se to "Windows 7" and I confirmed it also works if I set the compatibility mode on Windows 10.
    That problem I'm facing is that, I need to set the compatibility mode programatically, which I do in the installer for the app. Setting compatibility works properly on Windows 8 but not on Windows 10. It does not set anything. Suppose the same code simply does not work.
    See if anything here gets you heading in the right direction:

    Windows 8.1 App Compat Guide, Downloads | TechNet

    Application Compatibility Toolkit (ACT) Technical Reference

    If you can write a shim to work on Win 8.1, it should also work on Win 10

    That's all I have to offer, good luck
      My Computer


  5. Posts : 4
    Windows 10
    Thread Starter
       #5

    Thank you guys for your replies.

    I absolutely understand that I should fix the app. If I could, I'd have done it quite awhile ago.
    The biggest problem is that it is not my decision but my client's and all come to the cost, of course. Basically the client is looking for the quickest (and less expensive) way to prolonging the app's life as much as possible.
    There was the same type of discussion when Win8 came up. At the time, a workaround by modifying the installer and setting the compatibility mode to the app worked for Win8. So I was searching for very similar solution.

    After spending several hours to try to troubleshoot and complete updating Win 10 to the most recent state (couldn't believe it take so long with weird problems), it looks like the installer statred working in the the way works on Win8 by set the compatibility mode correctly and effective immediately (manually changing the registry does not take effect just like on Win8 but as long as the installer works, I'm okay).
    I still have to double check if this works properly on different machine but if it works, then I really feel fooled by MS.
    I will post a comment as soon as my test is done.

    Thank you again for you comment and time on this.
    Hopefully I can convine my client to allow me or someone to fix the app with recent dev tools and environment at least for Win11.
    Best regards,
      My Computer


  6. Posts : 7
    win 10
       #6

    Thanks for this!!
      My Computer


  7. Posts : 3,257
    Windows 10 Pro
       #7

    TedMtl said:
    I absolutely understand that I should fix the app. If I could, I'd have done it quite awhile ago.
    The biggest problem is that it is not my decision but my client's and all come to the cost, of course. Basically the client is looking for the quickest (and less expensive) way to prolonging the app's life as much as possible.
    In almost all cases, fixing the app is usually very simple, doesn't require rewriting the app, or changing your tools. It's just figuring out what is causing the incompatibility and fixing just the bit.

    For example, In many apps, they assume they can run as administrator, and therefore they try to open files in Read/Write mode when they may not have permission to do that (even when they only need read access).

    Have you even looked into why it's failing? It could be as simple as a tiny fix.. (or it might not, but without looking into it, you could be spending a LOT more time trying to hack compatibility than actually fixing it).
      My Computer


  8. Posts : 4
    Windows 10
    Thread Starter
       #8

    Mystere said:
    In almost all cases, fixing the app is usually very simple, doesn't require rewriting the app, or changing your tools. It's just figuring out what is causing the incompatibility and fixing just the bit.

    For example, In many apps, they assume they can run as administrator, and therefore they try to open files in Read/Write mode when they may not have permission to do that (even when they only need read access).

    Have you even looked into why it's failing? It could be as simple as a tiny fix.. (or it might not, but without looking into it, you could be spending a LOT more time trying to hack compatibility than actually fixing it).
    I have quite spend some time on what causing the issue but the original source and development environment is based on VC++ 6. So you can image anything can go wrong on the recent Windows environments.
    The app actually needs to be rewritten since it also has very long history (going back to 1998) and numerous improvements that I could read from the code.

    Some extra tests I have done with manipulating the compatibility mode, I found that on a freshly installed Windows 10, the installer was not actually working. All the properties are set but it still require manually process by opening the property dialog and click on "OK" while showing "Compatibility" tab.
    Once the application is complete set with the compatibility mode, if I uninstall and reinstall it, it works without involving the manual process.
    So I think the manual process set certain information somewhere.
    I have to give a bad news to my client that what they prefer cannot be realized (or at least easily/quickly) and either let the users manually take the last step or overhaul the app. Obviously I'm not going to spend much more time on this unless I get paid for that part of the job unfortunately.

    Thanks again for your help.
      My Computer


  9. Posts : 3,257
    Windows 10 Pro
       #9

    TedMtl said:
    I have quite spend some time on what causing the issue but the original source and development environment is based on VC++ 6. So you can image anything can go wrong on the recent Windows environments.
    The app actually needs to be rewritten since it also has very long history (going back to 1998) and numerous improvements that I could read from the code.
    It may be that the app needs rewriting, but that doesn't mean you need to rewrite it to fix the compatibility issues.

    VC++6 is not incompatible with Windows 10. It's something the app is doing that is incompatible, and more than likely this is a simple fix (at least it has in almost all cases I've seen). Unless your app's basic function relies on something that is no longer allowed (security reasons, for the most part), I'd bet you can figure out the problems easily enough by running it in a debugger and breaking on thrown exceptions.
      My Computer


  10. Posts : 4
    Windows 10
    Thread Starter
       #10

    Mystere said:
    It may be that the app needs rewriting, but that doesn't mean you need to rewrite it to fix the compatibility issues.

    VC++6 is not incompatible with Windows 10. It's something the app is doing that is incompatible, and more than likely this is a simple fix (at least it has in almost all cases I've seen). Unless your app's basic function relies on something that is no longer allowed (security reasons, for the most part), I'd bet you can figure out the problems easily enough by running it in a debugger and breaking on thrown exceptions.
    Further investigation on the issue I have, I have noticed at least one thing. A third party DLL which is bundled and used by the app seems to be a part of not working if the compatibility mode is not set.
    This may be a tip of the icebuerg and the DLL definitely needs to be replaced but no recent version than that is available. This means eaither look for similar one or write the equivalent one.
    Hopefully no other components, especially thirdparty DLLs, are becoming the cause.
    I guess the little more investigation will help convince my client to make his decision in one way or another. I just need to get done with this development/maintenace.

    Regards,
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:45.
Find Us




Windows 10 Forums