fluent / fluent-package-builder

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

msi: keep fluentdopt when previous options is set #609

Open kenhys opened 6 months ago

kenhys commented 6 months ago
kenhys commented 6 months ago

TODO: check behavior.

kenhys commented 5 months ago

Need to fix it.

 Executing op: CustomActionSchedule(Action=InstallFluentdWinSvc,ActionType=3073,Source=BinaryData,Target=WixQ
uietExec64,CustomActionData="c:\opt\fluent\bin\ruby.exe" "c:\opt\fluent\bin\fluent-package-post-fluentdwinsvc.rb" "c:\opt\fluent\")
MSI (s) (BC:A8) [16:30:03:916]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI743F.tmp, Entrypoint: WixQuietExec64
WixQuietExec64:  c:\opt\fluent\bin\ruby.exe: No such file or directory -- c:/opt/fluent/bin/fluent-package-post-fluentdwinsvc.rb (LoadError)

WixQuietExec64:  Error 0x80070001: Command line returned an error.
WixQuietExec64:  Error 0x80070001: QuietExec64 Failed
WixQuietExec64:  Error 0x80070001: Failed in ExecCommon method
CustomAction InstallFluentdWinSvc returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
kenhys commented 5 months ago

I've forgot to bundle script.

kenhys commented 5 months ago
Action 10:47:25: InstallFluentdWinSvc. 
MSI (s) (8C:CC) [10:47:25:202]: Executing op: CustomActionSchedule(Action=InstallFluentdWinSvc,ActionType=3073,Source=BinaryData,Target=WixQ
uietExec64,CustomActionData="c:\opt\fluent\bin\ruby.exe" "c:\opt\fluent\bin\fluent-package-post-fluentdwinsvc.rb" "c:\opt\fluent\")
MSI (s) (8C:40) [10:47:25:202]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSICBB9.tmp, Entrypoint: WixQuietExec64
WixQuietExec64:  c:/opt/fluent/lib/ruby/3.2.0/win32/registry.rb:289:in `OpenKey': 指定されたファイルが見つかりません。 (Win32::Registry::Err
or)
WixQuietExec64:         from c:/opt/fluent/lib/ruby/3.2.0/win32/registry.rb:431:in `open'
WixQuietExec64:         from c:/opt/fluent/lib/ruby/3.2.0/win32/registry.rb:542:in `open'
WixQuietExec64:         from c:/opt/fluent/bin/fluent-package-post-fluentdwinsvc.rb:12:in `<main>'
WixQuietExec64:  Error 0x80070001: Command line returned an error.

should fix unexpected error.

kenhys commented 5 months ago

migration script itself works, but integrated with installer does not works as expected, Investigating now...

kenhys commented 5 months ago
MSI (s) (EC:1C) [13:42:56:766]: Executing op: CustomActionSchedule(Action=InstallFluentdWinSvcFluentdopt,ActionType=3073,Source=BinaryData,T
arget=WixQuietExec64,CustomActionData="c:\opt\fluent\bin\ruby.exe" "c:\opt\fluent\bin\fluent-package-post-fluentdwinsvc.rb" "c:\opt\fluent\")
MSI (s) (EC:74) [13:42:56:766]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIC4CF.tmp, Entrypoint: WixQuietExec64
WixQuietExec64:  fluentdwinsvc default: -c 'c:\opt\fluent"etc\fluent\fluentd.conf' -o 'c:\opt\fluent"fluentd.log'
WixQuietExec64:  fluentdwinsvc registry key was opened: SYSTEM\CurrentControlSet\Services\fluentdwinsvc
WixQuietExec64:  fluentdwinsvc: reset to default fluentdopt configuration

It is strange that appended install path seems corrupted and it raise Registry::Error when accessing fluentdopt.

kenhys commented 5 months ago

I've created minimum installer to assess the root cause, but it is not reproduced yet. hmm. (quoting bug is out of scope)

MSI (s) (80:C8) [14:31:16:745]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
WixQuietExec64:  fluentdwinsvc default: -c 'c:\opt\fluent"etc\fluent\fluentd.conf' -o 'c:\opt\fluent"fluentd.log'
WixQuietExec64:  fluentdwinsvc registry key was opened: SYSTEM\CurrentControlSet\Services\fluentdwinsvc
WixQuietExec64:  fluentdwinsvc current value: -c 'c:\opt\fluent"etc\fluent\fluentd.conf' -o 'c:\opt\fluent"fluentd.log'
WixQuietExec64:  fluentdwinsvc: fluentdopt configuration was same as default one: -c 'c:\opt\fluent"etc\fluent\fluentd.conf' -o 'c:\opt\flue
nt"fluentd.log'
daipom commented 4 months ago

Sorry I'm not check this in detail, but we should note that the service is reinstalled when updating.