fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
22 stars 26 forks source link

msi: migrate td-agent*.bat #484

Closed kenhys closed 1 year ago

kenhys commented 1 year ago

msi: migrate td-agent*.bat

Before:

c:\opt\td-agent\bin\td-agent.bat c:\opt\td-agent\bin\td-agent-gem.bat

After:

c:\opt\td-agent\fluentd.bat c:\opt\td-agent\fluent-gem.bat

If td-agent-gem.bat was renamed to fluent-gem.bat, it conflict with c:\opt\td-agent\fluent-gem.bat which fluentd gem provides. Not to cause such a situation, put them under c:\opt\td-agent.

To keep compatibility, td-agent.bat and td-agent-gem are provided as hardlink.

kenhys commented 1 year ago

failure:: assets/fluentd.bat is overriden.

ashie commented 1 year ago

So in this PR, changed to provide unique batch file - fluent.bat.

fluent means too wide nowaday. Although it's origianl name of fluentd, it means our organization name for now. So that it might be ambiguous for users what the fluent.bat does.

How about placing fluentd.bat and fluent-gem.bat just under /opt/td-agent(fluent), and add there to $PATH. I think it has some merits.

Or leaving td-agent.bat and td-agent-gem.bat as is and put symlinks with fluent prefix just under /opt/td-aget(fluent) might be better.

daipom commented 1 year ago

@ashie I see. I agree.

@kenhys About the link files:

$ td-agent.lnk --version
td-agent 5.0.0 fluentd 1.16.1 (0a6d706a9cee5882d751b2cc6169696709df0134)

$ td-agent --version
'td-agent' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
daipom commented 1 year ago

It seems that we can omit .bat but we can't omit .lnk. I don't know this Windows specification well though,,,

ashie commented 1 year ago

NOTE: There is no need to provide td-agent-gem.bat as asset because it is almost same as fluent-gem.bat which is installed by fluentd gem.

It might be better to modify to set GEM_HOME and GEM_PATH like the one on GNU/Linux. Setting them can suppress referring other directories unexpectedly configured by users.

kenhys commented 1 year ago

$ td-agent --version 'td-agent' は、内部コマンドまたは外部コマンド、 操作可能なプログラムまたはバッチ ファイルとして認識されていません。

Thank you for verifying it.

It seems that hardlink is better solution...

kenhys commented 1 year ago

How about placing fluentd.bat and fluent-gem.bat just under /opt/td-agent(fluent), and add there to $PATH. I think it has some merits.

Putting these files under /opt/td-agent is a good approach. I'll follow it.

kenhys commented 1 year ago

Even though without custom action, rollback occurs. checking...

kenhys commented 1 year ago

Even though without custom action, rollback occurs. checking...

withoutca.log

Terminated after property change:

MSI (c) (88:1C) [14:50:00:813]: PROPERTY CHANGE: Adding dir8D9828541E9745DA0C06D1FC23D6C150 property. Its value is 'c:\opt\

It seems that InstallInitialize is not called...

kenhys commented 1 year ago

Succeed to install again.

image

kenhys commented 1 year ago

Old bat is provided as hardlink.

image

kenhys commented 1 year ago

checking with/without ComponentGuidGenerationSeed behavior.

kenhys commented 1 year ago

dead hardlink issue was fixed.

kenhys commented 1 year ago

TODO: fix mismatched path issue

kenhys commented 1 year ago

TODO: fix mismatched path issue

Fixed it.

ashie commented 1 year ago

I'm still checking...

ashie commented 1 year ago

Thanks!