From a232e2c78c2aa26b63b1c6e22d42945e36fc3043 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 3 Dec 2023 13:15:14 -0800 Subject: [PATCH] Set ExecutionPolicy directly when invoking Powershell scripts --- README.md | 1 - meson.build | 5 ++++- packages/meson.build | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 892782993a..3961906ad9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ Prerequisites: 3. Python 3 4. Meson 5. CMake -6. Powershell execution policy set to Unrestricted There are a few optional dependencies that must be installed and on your PATH: diff --git a/meson.build b/meson.build index d1d8adb3d2..e9c966629d 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,10 @@ if host_machine.system() == 'windows' endif if host_machine.system() == 'windows' - version_sh = find_program('tools/version.ps1') + powershell_exe = find_program('powershell') + version_sh = [powershell_exe, + '-ExecutionPolicy', 'Bypass', + '-File', meson.current_source_dir() / 'tools' / 'version.ps1'] else version_sh = find_program('tools/version.sh') endif diff --git a/packages/meson.build b/packages/meson.build index 1e13be54ac..70575ed769 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -1,10 +1,15 @@ conf_pkg = configuration_data() if host_machine.system() == 'windows' - installer_setup = find_program(meson.project_source_root() / 'tools/win-installer-setup.ps1') + installer_setup = [powershell_exe, + '-ExecutionPolicy', 'Bypass', + '-File', meson.project_source_root() / 'tools/win-installer-setup.ps1'] run_target('win-installer', command: [installer_setup, meson.project_build_root(), meson.project_source_root()]) - portable_setup = find_program(meson.project_source_root() / 'packages/win_installer/portable/create-portable.ps1') + + portable_setup = [powershell_exe, + '-ExecutionPolicy', 'Bypass', + '-File', meson.project_source_root() / 'packages/win_installer/portable/create-portable.ps1'] run_target('win-portable', command: [portable_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() @@ -12,6 +17,7 @@ elif host_machine.system() == 'darwin' run_target('osx-bundle', command: [bundle_app_sh, meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', get_option('build_osx_bundle') ? 'TRUE' : 'FALSE']) + build_dmg_sh = find_program(meson.project_source_root() / 'tools/osx-dmg.sh') run_target('osx-build-dmg', command: [build_dmg_sh, meson.project_source_root(), meson.project_build_root(), meson.project_version()])