-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
msi: support path which contains space or parenthesis (#589)
When installing fluent-package to c:\Program Files, the space character must be escaped correctly. * sources.wxs * For xml, double quote (") must be " * to escape double quote in literal, you must escape with ^"e; it is treated as ^", so it is properly quoted to execute: "cmd" /c "fsutil ... "c:\Program Files .." "c:\Program Files..."" * fluentd.bat,fluent-gem.bat * set FOO="..." assign extra double quote, it's troublesome because extra double quote will be included when concatenating path. The only way to avoid this problem is set "FOO=..." to assign it. you can assign to FOO without extra double quote. * to get RUBY_VERSION, use "usebackq" and execute command with escaped command literal explicitly. passed `^""C:\..." ....^"` literal are evaluated ^""C:\..."^". Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
- Loading branch information
Showing
3 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters