orbs

clarification required about pragma compatibility

2 posts in this topic

recently there was a fuss about the pragma compatibility directive, where when specified Win10 did not apply. this was fixed in latest release 3.3.14.2, but these are my questions:

1) why would i NOT want to have compatibility for all available Windows versions? what reason may be NOT to have this line at the top of every script:

#pragma compile(Compatibility, win10)

2) i assume Win10 compatibility implies compatibility to all earlier versions too (Vista to 8.1), is this correct? if not, should the directive actually be:

#pragma compile(Compatibility, vista, win7, win8, win81, win10)

thanks for any clarification!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It's a very niche option. The default is win10 so you should rarely need to use the option. There's an MSDN page somewhere that says what the compatibility changes are but I can only find the windows 8 one at the moment: https://msdn.microsoft.com/en-us/library/windows/desktop/hh848036(v=vs.85).aspx 

Yes, win10 implies 81, 8, 7, vista.

For example, In Windows 8 a change was made to the API so that you couldn't create a shortcut/.lnk file using a relative path. If your app was only manifested up to Windows 7 then this would still work because Windows faked it in the background. If you manifested Windows 8 then the OS would assume you knew what you were doing and using a relative path would fail. In the AutoIt built-in shortcut functions we made it so relative paths would work whatever the manifest so you don't need to worry about it.

But if you are using direct API calls then it's up to you to make sure that you use the API in a way that works on all OS versions. If not then you might decide that you need it to work in the same way as vista and manifest for that. AKA being lazy.

Edited by Jon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now