-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
This PR still not work correctly yet. checking log... |
d19efa3
to
ec006bd
Compare
I'm checking the package behavior... |
I failed to install the package to |
I checked the log. $ msiexec /i fluent-package-5.0.1-x64.msi /l* installer.log
|
Are there |
Reproduced. got same log. |
assets/fluentd.bat cause it. |
I think this is completely another issue.
I think this is the smallest script to reproduce:
$ .\test.bat
\ was unexpected at this time. |
Continue to check the behavior when the installed path including spaces. |
I see!
Thanks!
@echo off
if "a" == "a" (
echo "%~dp0"
) $ .\test.bat
"C:\path\to\foo(bar)\" |
bca8ebf
to
f1dd645
Compare
Installed path: Something seems wrong with
C:\Windows\system32>fluentd --version
fluent-package 5.0.1 fluentd 1.16.2 (d5685ada81ac89a35a79965f1e94bbe5952a5d3a)
C:\Windows\system32>fluent-gem --version
'C:\Dummy' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
'C:\Dummy' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
C:\Windows\system32>fluent-gem --version
C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem fluentd (>= 0.a) with executable fluent-gem (Gem::GemNotFoundException)
from C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
from C:/Dummy Program Files/fluent/bin/fluent-gem:32:in `<main>'
C:\Windows\system32>fluentd --version
C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem fluentd (>= 0.a) with executable fluentd (Gem::GemNotFoundException)
from C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
from C:/Dummy Program Files/fluent/bin/fluentd:32:in `<main>' |
Yes fluent-gem also has same issue. |
Oh, is it the same issue? |
f1dd645 has still issues... |
6dea9fc
to
425c6b5
Compare
It should be |
Thanks. I'm checking the package. Finally, I understood the mechanism of
Is is simply because the In the above case, @echo off
if "a" == "b" (
echo /path/to/foo(bar)/
) The error occurs simlply becaues this script is broken. |
Hmm, I thought there was no problem, but I have noticed that I can not run Fluentd in Fluent Package Command Prompt... $ fluentd
C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `initialize': Invalid argument @ rb_sysopen - "C:/Dummy Program Files (FOO)/fluent//etc/fluent/fluentd.conf" (Errno::EINVAL)
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `open'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `build'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:682:in `setup_global_logger'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:624:in `configure'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/command/fluentd.rb:351:in `<top (required)>'
from <internal:C:/Dummy Program Files (FOO)/fluent/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:C:/Dummy Program Files (FOO)/fluent/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/bin/fluentd:15:in `<top (required)>'
from C:/Dummy Program Files (FOO)/fluent/bin/fluentd:32:in `load'
from C:/Dummy Program Files (FOO)/fluent/bin/fluentd:32:in `<main>' |
Thanks! I'll check it. |
d9b8999 causes msi rollback unexpectedly. |
Isn't it caused by not applying this? |
maybe that's it. Thanks. |
de10056
to
e26df3f
Compare
With e26df3f, surely unexpected rollback was fixed. And more, from fluent package prompt with admin also works. |
What do you think about #589 (comment)? |
6498551
to
f0f105f
Compare
It seems work as expected. |
Thanks! I will check the built package briefly, just in case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed that the build package works as expected! Thanks!
Could you update the title and initial comment?
About the title, since this fix is not only for paths containing space, which contains space or brackets
or something like that would be better, I think.
Thanks, I'll fix it. |
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>
f0f105f
to
2b90993
Compare
Revised commit message. |
Thanks! |
When installing fluent-package to c:\Program Files, the space
character must be escaped correctly.
sources.wxs
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
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.
escaped command literal explicitly.
passed
^""C:\..." ....^"
literal are evaluated ^""C:..."^".