From c3dfc08f380750c9460059ab3a056b36e861f879 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Wed, 25 Mar 2020 22:07:16 +0900 Subject: [PATCH] MSI: Set correct ruby path after copying files Althouth the original MSI installer generated by omnbus-td-agent allows users to choose a folder to install, the installed fluentd command can't be launched when the user chooses non-default folder since nobody settles the ruby path embedded in the command. This patch addresses this issue by running `gem pristine` as a post install action. Signed-off-by: Takuro Ashie --- td-agent/Rakefile | 1 + td-agent/msi/source.wxs | 9 +++++++++ td-agent/msi/td-agent-post-install.bat | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 td-agent/msi/td-agent-post-install.bat diff --git a/td-agent/Rakefile b/td-agent/Rakefile index 31b26ef0c..af813c813 100644 --- a/td-agent/Rakefile +++ b/td-agent/Rakefile @@ -314,6 +314,7 @@ class BuildTask task :win_batch_files do ensure_directory(staging_bindir) cp("msi/td-agent-prompt.bat", td_agent_staging_dir) + cp("msi/td-agent-post-install.bat", staging_bindir) cp("msi/td-agent.bat", staging_bindir) cp("msi/td-agent-gem.bat", staging_bindir) end diff --git a/td-agent/msi/source.wxs b/td-agent/msi/source.wxs index 62db4cc42..86d443eea 100644 --- a/td-agent/msi/source.wxs +++ b/td-agent/msi/source.wxs @@ -90,5 +90,14 @@ + + + + + NOT Installed + + diff --git a/td-agent/msi/td-agent-post-install.bat b/td-agent/msi/td-agent-post-install.bat new file mode 100644 index 000000000..8a8cfe033 --- /dev/null +++ b/td-agent/msi/td-agent-post-install.bat @@ -0,0 +1,5 @@ +@echo off +title Td-agent post install script +if not "%~dp0" == "C:\opt\td-agent\bin\" ( + %~dp0gem pristine --only-executables --all +)