Manifest for Windows in Project Options must be updated
Original Reporter info from Mantis: 007
-
Reporter name: lainz
Original Reporter info from Mantis: 007
- Reporter name: lainz
Description:
Hi,
With the IDE is possible to add a manifest to enable themes and other stuff. This manifest is outdated and need more sections.
Quote from microsoft article: "With Windows 10 VerifyVersionInfo is now subject to the same manifest-based behavior as GetVersion(Ex): by default IsWindows8OrGreater and earlier will return 'true' as expected on Windows 10, but both IsWindows8Point1OrGreater and IsWindows10OrGreater will return 'false' without the appropriate GUIDs present in the &LtPos;compatibility> section."
Article: http://blogs.msdn.com/b/chuckw/archive/2013/09/10/manifest-madness.aspx
Let me explain you:
GetVersionEx is used in Sysutils unit for win32: CheckWin32Version depend on this. So is mandatory to get this working well to add the &LtPos;compatibility> section.
Another usefull thing about adding the &LtPos;compatibility> section is that if you made a custom setup for your windows application with lazarus (like copying files under program files) when your setup finish you will not get an error message about compatibility.
Under additional information I give you a manifest file directly from Visual Studio 2015 project, with just the needed things for lazarus application and indenting well written.
Manifest should be added always! but you can separate into pieces:
- The to chose the execution level is OK, but please include it always, as default "asInvoker". UI Access checkbox is fine.
- Add a checkbox to chose each &LtPos;compatibility> windows version, checked all by default since is needed as I explained before.
- The dpi aware checkbox, the current works fine. New applications should be high dpi aware, else will look blurry, I've made a wiki article about this. Enable by default and add a link to the wiki article to help users implement this (it does not takes much time).
- Add the '&LtPos;dependency>' part checkbox: this will enable themes, if not checked themes will not shown, but the rest of the manifest will work the same.
If this is a lot of work, just add an option to include a custom manifest file. Provide the one I show you as default since it covers everything needed.
Additional information:
This is a final manifest file with everything well written:
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="lazarus.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
Mantis conversion info:
- Mantis ID: 28435
- OS: Windows
- OS Build: Any
- Build: 49524
- Platform: x86 / x64
- Version: 1.4.2
- Fixed in version: 1.4.4
- Fixed in revision: r49587 (#df966386)
- Target version: 1.4.4