Add manifest on Windows (#1405)

* fix(gitignore): add exclusion for manifest files

* feat(windows): add application manifest

* feat(build): use application manifest on windows

* refactor(build): use genrate_file to generate the manifest

* style(manifest): remove trailing whitespace
This commit is contained in:
Takase 2023-03-03 22:07:45 +08:00 committed by takase1121
parent 95611366bb
commit f685293417
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
5 changed files with 53 additions and 0 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ lite-xl*
LiteXL*
!resources/windows/*.diff
!resources/windows/*.exe.manifest.in

View File

@ -36,6 +36,7 @@ conf_data = configuration_data()
conf_data.set('PROJECT_BUILD_DIR', meson.current_build_dir())
conf_data.set('PROJECT_SOURCE_DIR', meson.current_source_dir())
conf_data.set('PROJECT_VERSION', version)
conf_data.set('PROJECT_ASSEMBLY_VERSION', meson.project_version() + '.0')
#===============================================================================
# Compiler Settings
@ -165,6 +166,11 @@ if get_option('portable') or host_machine.system() == 'windows'
lite_bindir = '/'
lite_docdir = '/doc'
lite_datadir = '/data'
configure_file(
input: 'resources/windows/lite-xl.exe.manifest.in',
output: 'lite-xl.exe.manifest',
configuration: conf_data
)
elif get_option('bundle') and host_machine.system() == 'darwin'
lite_cargs += '-DMACOS_USE_BUNDLE'
lite_bindir = 'Contents/MacOS'

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
type="win32"
name="LiteXL.LiteXL.LiteXL"
version="@PROJECT_ASSEMBLY_VERSION@"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates application support for Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!--The ID below indicates application support for Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>

View File

@ -0,0 +1,4 @@
#define IDR_RT_MANIFEST1 1
#define RT_MANIFEST 24
IDR_RT_MANIFEST1 RT_MANIFEST "lite-xl.exe.manifest"

View File

@ -50,6 +50,7 @@ lite_rc = []
if host_machine.system() == 'windows'
windows = import('windows')
lite_rc += windows.compile_resources('../resources/icons/icon.rc')
lite_rc += windows.compile_resources('../resources/windows/manifest.rc')
elif host_machine.system() == 'darwin'
lite_sources += 'bundle_open.m'
endif