MSI Transaction not fully rolling back
Posted: Thu May 28, 2009 9:25 am
I am having a hard time getting MSI transactions to behave correctly. If I roll back a transaction when installing my product (after calling Apply Install), what I find is that my product still appears in ARP and the installer is cached in C:\\Documents and Settings\\All Users\\Application Data\\{some guid}.
When in this state, if I click "Remove" next to my product under ARP, it attempts to install (not uninstall) and fails with, "Installation failed: 'This action is only valid for products that are currently installed'.Please check your settings and try again."
I get the same thing if I try to run the copy of my installer that is cached under All Users\\Application Data. However, if I run the actual installer that I used to install it (not the cached one), it repairs the installation so that I can then uninstall it from ARP.
I have attached a very simple installer that demonstrates this. Basically, it does this:
If you answer "No" to "Do you want to commit," it rolls back the transaction. In the actual code, I check the return value from the Begin, Commit, and Discard transaction calls and none of them are failing. Yet, after discarding the transaction, the product shows up in ARP in a broken state.
I would greatly appreciate any help I can receive concerning this.
Thanks!
[/code]
When in this state, if I click "Remove" next to my product under ARP, it attempts to install (not uninstall) and fails with, "Installation failed: 'This action is only valid for products that are currently installed'.Please check your settings and try again."
I get the same thing if I try to run the copy of my installer that is cached under All Users\\Application Data. However, if I run the actual installer that I used to install it (not the cached one), it repairs the installation so that I can then uninstall it from ARP.
I have attached a very simple installer that demonstrates this. Basically, it does this:
Code: Select all
MSI Transaction : Begin New Transaction
Apply Install (get result into variable SUCCESS)
MessageBox: $TITLE$ Uninstall, Done installing new version. Do you want to commit the transaction?$NEWLINE$$NEWLINE$Yes to commit, No to roll back.
if Variable COMMITANSWER Equals NO
Set Variable SUCCESS to CANCEL
end
if Variable SUCCESS not Equals COMPLETE
MSI Transaction : Discard Changes
else
MSI Transaction : Commit Changes
end
I would greatly appreciate any help I can receive concerning this.
Thanks!
[/code]