fluent / fluent-package-builder

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

msi: migration to c:\opt\fluent #494

Closed kenhys closed 1 year ago

kenhys commented 1 year ago

msi: migrate to c:\opt\fluent

Before:

After:

kenhys commented 1 year ago

debug-msi.log

InstallExecuteSequence doesn't work as expected :thinking:

kenhys commented 1 year ago

newly install works as expected, not for upgrade. pr494-new-install.log pr494-upgrade.log

kenhys commented 1 year ago

Unexpectedly action was skipped this action should not executed during upgrade.

MSI (s) (50:1C) [16:52:42:112]: Note: 1: 2265 2:  3: -2147287035 
MSI (s) (50:1C) [16:52:42:112]: Server not locked: locking for product {4FEF158E-E67C-4D05-B7E2-55DA1B33AF9F}
Action ended 16:52:42: InstallInitialize. Return value 1.
MSI (s) (50:1C) [16:52:42:125]: Skipping action: SetDeleteCompatTdAgentBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: DeleteCompatTdAgentBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: SetDeleteCompatTdAgentGemBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Skipping action: DeleteCompatTdAgentGemBat (condition is false)
MSI (s) (50:1C) [16:52:42:125]: Doing action: ProcessComponents
MSI (s) (50:1C) [16:52:42:125]: Note: 1: 2205 2:  3: ActionText 
Action 16:52:42: ProcessComponents. Updating component registration
Action start 16:52:42: ProcessComponents.
kenhys commented 1 year ago

PostInstall action is called.

MSI (s) (50:1C) [16:53:06:342]: Executing op: ActionStart(Name=PostInstall,,)
Action 16:53:06: PostInstall. 
MSI (s) (50:1C) [16:53:06:344]: Executing op: CustomActionSchedule(Action=PostInstall,ActionType=3073,Source=BinaryData,Target=WixQuietExec64,CustomActionData="c:\opt\fluent\bin\fluent-package-post-install.bat")
MSI (s) (50:B4) [16:53:06:352]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSICEAC.tmp, Entrypoint: WixQuietExec64
WixQuietExec64:  Restoring gems to pristine condition...
WixQuietExec64:  Skipped error_highlight-0.5.1, it is a default gem
kenhys commented 1 year ago

postinstall's if exist "%~dp0..\..\td-agent" ( condition may not be evaluated expectedly :thinking:

kenhys commented 1 year ago

check error log: upgrade.take1.rollback.zip

kenhys commented 1 year ago

check error log: upgrade.take1.rollback.zip

Should align not expected WixQuietExec64 execution order.

kenhys commented 1 year ago

upgrade-echo-on.u8.log tracked via @echo on, but it seems that the second if exist ... sequence is not executed.

kenhys commented 1 year ago

It is out of scope, I've found that post-install was always called because of a mismatch...

WixQuietExec64:  C:\Windows\SysWOW64>if not "c:\opt\fluent\bin\" == "C:\opt\fluent\bin\" ("c:\opt\fluent\bin\gem" pristine --only-executables --all ) 
WixQuietExec64:  Restoring gems to pristine condition...
kenhys commented 1 year ago

When executing extracted bat file content to simplified msi, it will be kicked. (even though weird mojibake errror)

kenhys commented 1 year ago

with 7fb0059, WixQuietExec64 failure was fixed, but it works still unexpectdly, checking why...

kenhys commented 1 year ago

c:\opt\td-agent was linked to c:\opt\fluent.

image

kenhys commented 1 year ago

image

c:\opt\fluent\var\log\td-agent was linked to c:\opt\fluent\var\log\fluent.

daipom commented 1 year ago

Thanks for this fix! I will review this early next week.

kenhys commented 1 year ago

also updated commit log.

daipom commented 1 year ago

If the old td-agent service is running, this pop-up appears. (Maybe it's been that way before. I'll check it.)

2023-06-27_13h33_46

daipom commented 1 year ago

If the old td-agent service is running, this pop-up appears. (Maybe it's been that way before. I'll check it.)

2023-06-27_13h33_46

I confirmed it's been that way before. (This message appears though we don't need a reboot) We don't need to care about this in this PR.

kenhys commented 1 year ago

Try to reduce a risk of losing files.

kenhys commented 1 year ago

changing path separator issue may be solved with "v=!v:\=/!" expression.

kenhys commented 1 year ago

Need to fix:

WixQuietExec64:  ボリューム シリアル番号は 7830-FC66 です
WixQuietExec64:  C:\OPT\TD-AGENT
WixQuietExec64:  └─etc
WixQuietExec64:      └─td-agent
WixQuietExec64:  "Create symlink c:\opt\fluent\var\log\td-agent to c:\opt\fluent\var\log\fluent"
WixQuietExec64:  指定されたパスが見つかりません。
WixQuietExec64:  "Create symlink c:\opt\td-agent\etc\td-agent to c:\opt\fluent\etc\fluent"
WixQuietExec64:  既に存在するファイルを作成することはできません。
WixQuietExec64:  Error 0x80070001: Command line returned an error.
WixQuietExec64:  Error 0x80070001: QuietExec64 Failed
WixQuietExec64:  Error 0x80070001: Failed in ExecCommon method
kenhys commented 1 year ago

msi

daipom commented 1 year ago

Thanks! I will review this again!

daipom commented 1 year ago

I have rebased this to apply

ashie commented 1 year ago

Install test seems failed since ab9df591684fc63283da50df695f05f5ff0ac373

Installing C:\fluentd\fluent-package\msi\repositories\fluent-package-5.0.0-x64.msi 
Start-Service : Cannot find any service with service name 'fluentdwinsvc'. 
At C:\fluentd\fluent-package\msi\install-test.ps1:7 char:1
+ Start-Service fluentdwinsvc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fluentdwinsvc:String) [Start-Se  
   rvice], ServiceCommandException
    + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.  
   Commands.StartServiceCommand
kenhys commented 1 year ago

Redundant expression causes registration error. It will be fixed via 40bc79d.

daipom commented 1 year ago

Thanks! I will check the behavior of the package after CI finishes.