1diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
2index adadbcdd..1b51bb9c 100644
3--- a/data/installed-tests/meson.build
4+++ b/data/installed-tests/meson.build
5@@ -65,5 +65,5 @@ configure_file(
6 output : 'fwupd-tests.conf',
7 configuration : con2,
8 install: true,
9- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
10+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
11 )
12diff --git a/meson.build b/meson.build
13index 772b7bbe..f59302cd 100644
14--- a/meson.build
15+++ b/meson.build
16@@ -177,8 +177,8 @@ else
17 datadir = join_paths(prefix, get_option('datadir'))
18 sysconfdir = join_paths(prefix, get_option('sysconfdir'))
19 localstatedir = join_paths(prefix, get_option('localstatedir'))
20- installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
21- installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
22+ installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
23+ installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
24 endif
25 mandir = join_paths(prefix, get_option('mandir'))
26 localedir = join_paths(prefix, get_option('localedir'))
27diff --git a/meson_options.txt b/meson_options.txt
28index 0a0e2853..5f68d78b 100644
29--- a/meson_options.txt
30+++ b/meson_options.txt
31@@ -25,6 +26,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable
32 option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
33 option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
34 option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
35+option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
36 option('tests', type : 'boolean', value : true, description : 'enable tests')
37 option('tpm', type : 'boolean', value : true, description : 'enable TPM support')
38 option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')