Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msi: support path which contains space or parenthesis #589

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions fluent-package/msi/assets/fluent-gem.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@echo off
if "%~nx0" == "td-agent-gem.bat" (
set FLUENT_PACKAGE_TOPDIR=%~dp0..\
set "FLUENT_PACKAGE_TOPDIR=%~dp0..\"
) else (
set FLUENT_PACKAGE_TOPDIR=%~dp0
set "FLUENT_PACKAGE_TOPDIR=%~dp0"
)
set FLUENT_PACKAGE_BINDIR=%FLUENT_PACKAGE_TOPDIR%bin
set PATH="%FLUENT_PACKAGE_BINDIR%";%PATH%
for /f "usebackq" %%i in (`%FLUENT_PACKAGE_BINDIR%\ruby.exe -rrbconfig -e "print RbConfig::CONFIG['ruby_version']"`) do set RUBY_VERSION=%%i
set GEM_HOME=%FLUENT_PACKAGE_TOPDIR%lib\ruby\gems\%RUBY_VERSION%
set GEM_PATH=%FLUENT_PACKAGE_TOPDIR%lib\ruby\gems\%RUBY_VERSION%
%FLUENT_PACKAGE_BINDIR%\fluent-gem %*
set "FLUENT_PACKAGE_BINDIR=%FLUENT_PACKAGE_TOPDIR%bin"
set PATH=%FLUENT_PACKAGE_BINDIR%;%PATH%
for /f "usebackq" %%i in (`^""%FLUENT_PACKAGE_BINDIR%\ruby.exe" -rrbconfig -e "print RbConfig::CONFIG['ruby_version']"^"`) do set RUBY_VERSION=%%i
set "GEM_HOME=%FLUENT_PACKAGE_TOPDIR%lib\ruby\gems\%RUBY_VERSION%"
set "GEM_PATH=%FLUENT_PACKAGE_TOPDIR%lib\ruby\gems\%RUBY_VERSION%"
"%FLUENT_PACKAGE_BINDIR%\fluent-gem" %*
10 changes: 5 additions & 5 deletions fluent-package/msi/assets/fluentd.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
if "%~nx0" == "td-agent.bat" (
set FLUENT_PACKAGE_TOPDIR=%~dp0..\
set "FLUENT_PACKAGE_TOPDIR=%~dp0..\"
) else (
set FLUENT_PACKAGE_TOPDIR=%~dp0
set "FLUENT_PACKAGE_TOPDIR=%~dp0"
)

@rem Convert path separator from backslash to forwardslash
Expand All @@ -11,9 +11,9 @@ set FLUENT_PACKAGE_TOPDIR=!FLUENT_PACKAGE_TOPDIR:\=/!

set PATH=%FLUENT_PACKAGE_TOPDIR%bin;%PATH%
set PATH=%FLUENT_PACKAGE_TOPDIR%;%PATH%
set FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/fluentd.conf
set FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/plugin
set FLUENT_PACKAGE_VERSION=%FLUENT_PACKAGE_TOPDIR%/bin/fluent-package-version.rb
set "FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/fluentd.conf"
set "FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/plugin"
set "FLUENT_PACKAGE_VERSION=%FLUENT_PACKAGE_TOPDIR%/bin/fluent-package-version.rb"
for %%p in (%*) do (
if "%%p"=="--version" (
ruby "%FLUENT_PACKAGE_VERSION%"
Expand Down
10 changes: 5 additions & 5 deletions fluent-package/msi/source.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
<Property Id="InstallFluentdWinSvc" Value=" "/>
<CustomAction Id="SetInstallFluentdWinSvcCommand"
Property="InstallFluentdWinSvc"
Value="&quot;[FLUENTPROJECTLOCATION]fluentd.bat&quot; --reg-winsvc i --reg-winsvc-delay-start --reg-winsvc-fluentdopt &quot;-c [FLUENTPROJECTLOCATION]etc\fluent\fluentd.conf -o [FLUENTPROJECTLOCATION]fluentd.log&quot;"/>
Value="&quot;[FLUENTPROJECTLOCATION]fluentd.bat&quot; --reg-winsvc i --reg-winsvc-delay-start --reg-winsvc-fluentdopt &quot;-c '[FLUENTPROJECTLOCATION]etc\fluent\fluentd.conf' -o '[FLUENTPROJECTLOCATION]fluentd.log'&quot;"/>
<CustomAction Id="InstallFluentdWinSvc"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Expand All @@ -196,7 +196,7 @@
<Property Id="CreateCompatTdAgentBat" Value=" "/>
<CustomAction Id="SetCreateCompatTdAgentBat"
Property="CreateCompatTdAgentBat"
Value="&quot;cmd&quot; /c &quot;fsutil hardlink create [FLUENTPROJECTLOCATION]bin\td-agent.bat [FLUENTPROJECTLOCATION]fluentd.bat&quot;"/>
Value="&quot;cmd&quot; /c &quot;fsutil hardlink create ^&quot;[FLUENTPROJECTLOCATION]bin\td-agent.bat^&quot; ^&quot;[FLUENTPROJECTLOCATION]fluentd.bat^&quot;&quot;"/>
daipom marked this conversation as resolved.
Show resolved Hide resolved
<CustomAction Id="CreateCompatTdAgentBat"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Expand All @@ -206,7 +206,7 @@
<Property Id="CreateCompatTdAgentGemBat" Value=" "/>
<CustomAction Id="SetCreateCompatTdAgentGemBat"
Property="CreateCompatTdAgentGemBat"
Value="&quot;cmd&quot; /c &quot;fsutil hardlink create [FLUENTPROJECTLOCATION]bin\td-agent-gem.bat [FLUENTPROJECTLOCATION]fluent-gem.bat&quot;"/>
Value="&quot;cmd&quot; /c &quot;fsutil hardlink create ^&quot;[FLUENTPROJECTLOCATION]bin\td-agent-gem.bat^&quot; ^&quot;[FLUENTPROJECTLOCATION]fluent-gem.bat^&quot;&quot;"/>
<CustomAction Id="CreateCompatTdAgentGemBat"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Expand All @@ -217,7 +217,7 @@
<Property Id="DeleteCompatTdAgentBat" Value=" "/>
<CustomAction Id="SetDeleteCompatTdAgentBat"
Property="DeleteCompatTdAgentBat"
Value="&quot;cmd&quot; /c &quot;del [FLUENTPROJECTLOCATION]bin\td-agent.bat&quot;"/>
Value="&quot;cmd&quot; /c &quot;del ^&quot;[FLUENTPROJECTLOCATION]bin\td-agent.bat^&quot;&quot;"/>
<CustomAction Id="DeleteCompatTdAgentBat"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Expand All @@ -227,7 +227,7 @@
<Property Id="DeleteCompatTdAgentGemBat" Value=" "/>
<CustomAction Id="SetDeleteCompatTdAgentGemBat"
Property="DeleteCompatTdAgentGemBat"
Value="&quot;cmd&quot; /c &quot;del [FLUENTPROJECTLOCATION]bin\td-agent-gem.bat&quot;"/>
Value="&quot;cmd&quot; /c &quot;del ^&quot;[FLUENTPROJECTLOCATION]bin\td-agent-gem.bat^&quot;&quot;"/>
<CustomAction Id="DeleteCompatTdAgentGemBat"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Expand Down
Loading