What would be the best way to diagnose error 2762 "Cannot write script record. Transaction not started."?

Question

What would be the best way to diagnose error 2762 "Cannot write script record. Transaction not started."?

Answer

Usually means that your InstallExecuteSequence table isn't authored correctly. Actions that generate script opcodes have to be sequenced between InstallInitialize & InstallFinalize. Validation will catch this quite often (Orca's Tools menu has this option & cmd line version is msival2)

CustomAction table:

 CA_CommitHelpTransactionNoRB.3643236F_FC70_11D3_A536_0090278A1BB8 3137    BIN_File_46001  CommitTransaction

InstallExecuteTable:

 InstallInitialize        3000
InstallFinalize     8100
CA_CommitHelpTransactionNoRB.3643236F_FC70_11D3_A536_0090278A1BB8   ( RollbackDisabled )    8101

In this case, there is a custom action of type 3137 = 0xc41 = 0x800 + 0x400 + 0x40 + 0x1

 0x800 = msidbCustomActionTypeNoImpersonate
0x400 = msidbCustomActionTypeInScript
0x40 = msidbCustomActionTypeContinue
0x1 =  msidbCustomActionTypeDll

A deferred custom action was not sequenced between InstallInitialize and InstallFinalize.

Content credit also belongs to

[Author: Robert Flaming]

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm.