From d27bd6b14debdbea65090c14779165cb8d80f507 Mon Sep 17 00:00:00 2001 From: Takase <20792268+takase1121@users.noreply.github.com> Date: Fri, 3 Mar 2023 22:07:45 +0800 Subject: [PATCH] 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 --- .gitignore | 1 + meson.build | 6 ++++ resources/windows/lite-xl.exe.manifest.in | 41 +++++++++++++++++++++++ resources/windows/manifest.rc | 4 +++ src/meson.build | 1 + 5 files changed, 53 insertions(+) create mode 100644 resources/windows/lite-xl.exe.manifest.in create mode 100644 resources/windows/manifest.rc diff --git a/.gitignore b/.gitignore index 1e112b8a..8753c6d1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ release_files !resources/windows/*.diff +!resources/windows/*.exe.manifest.in diff --git a/meson.build b/meson.build index 7bbecc68..cfef8ec8 100644 --- a/meson.build +++ b/meson.build @@ -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' diff --git a/resources/windows/lite-xl.exe.manifest.in b/resources/windows/lite-xl.exe.manifest.in new file mode 100644 index 00000000..9e787587 --- /dev/null +++ b/resources/windows/lite-xl.exe.manifest.in @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/windows/manifest.rc b/resources/windows/manifest.rc new file mode 100644 index 00000000..95b17e2d --- /dev/null +++ b/resources/windows/manifest.rc @@ -0,0 +1,4 @@ +#define IDR_RT_MANIFEST1 1 +#define RT_MANIFEST 24 + +IDR_RT_MANIFEST1 RT_MANIFEST "lite-xl.exe.manifest" diff --git a/src/meson.build b/src/meson.build index fee36d1d..a156ae3f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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