3

これに違いはありますか(ネストされたインストーラー)

ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "MyService";

ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;

spi.Installers.Add(si);

this.Installers.Add(spi);  

この?(TransactedInstaller)

TransactedInstaller ti = new TransactedInstaller();

ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "MyService";
ti.Installers.Add(si);

ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ti.Installers.Add(spi);

this.Installers.Add(ti);   

ネストされたインストーラーはデフォルトで処理されますか? どのスタイルを優先する必要がありますか?

4

1 に答える 1

5

カスタム アクションが成功/失敗した場合、 TransactedInstallerは Commit/Rollback を自動的に呼び出します。

ネストされたインストーラーでは、エラーが発生した場合に自分自身でロールバック/コミットをシーケンスする必要があります。明示的に実行するように指示しなかった場合、それらは呼び出されません。

于 2009-03-30T10:07:53.977 に答える