# ICustomPackageAction With ActionStage(Install)

**URL:** <https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137>\
**Category:** Technical\
**Tags:** plugin, bug\
**Created:** [November 25, 2020, 2:31am UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137 "2020-11-25T02:31:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin\_c\_i](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/justin_c_i/32/232_2.png) [@justin\_c\_i](https://forum.opentap.io/u/justin_c_i)\
**Post date:** [November 25, 2020, 2:31am UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/1 "2020-11-25T02:31:00Z")

</div>

Hi Team,

We created a plugin having a class that implements ICustomPackageAction,  
In the Execute method, we write a Log file and throws exception. (Original logic will be implemented later)

In another package , we made an XML entry of the previously created package.

Unfortunately Package Action is not working when we double click on the new package (.tappackage) file.Log file is not created and package is getting installed.

When we tried to install the .tappackage from command line (tap package install) we can see package execution failed message also we can see log file is created, but still package got installed.

We dont need package to get installed when there is an exception in Execute method.

Or Please suggest any other way that package should not get installed based on conditions.

Please suggest the changes.

TapVersion : 9.11

Regards  
Jestin CI

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [November 25, 2020, 1:16pm UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/2 "2020-11-25T13:16:02Z")

</div>

Hi Justin,

Maybe I don’t completely understand the issue.

I think package install should fail if one of the package actions fails and I also think it should try to roll back the changes. Are you installing with the --force argument?

In any case I don’t think it is an essential behavior - if you don’t want it installed, why are you installing it?

---

<div class="post-metadata">

**Author:** ![justin\_c\_i](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/justin_c_i/32/232_2.png) [@justin\_c\_i](https://forum.opentap.io/u/justin_c_i)\
**Post date:** [November 25, 2020, 1:55pm UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/3 "2020-11-25T13:55:25Z")

</div>

Sorry for the consfuion.  
we dont need package to get installed, this is one of the requirement from the team.  
client will click on the .tappackage, then we need to display a message telling like already an alternate package is installed.

If package action fails then also package is getting installed.

We tried double clicking the package, Package got installed.  
We tried using Command line, we are not using --force arguement.

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [November 25, 2020, 4:48pm UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/4 "2020-11-25T16:48:16Z")

</div>

Ah OK, this sounds a bit like a concept we have been evaluating earlier about mutually exclusive packages. So if package X is installed then Y must not be installed. This is not supported right now though.

Maybe you can emulate this behavior by having a file in both packages with the same name but different content. Then it should complain that installing the package will cause the file to be overwritten, thereby making the two packages becomes strongly incompatible.

---

<div class="post-metadata">

**Author:** ![justin\_c\_i](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/justin_c_i/32/232_2.png) [@justin\_c\_i](https://forum.opentap.io/u/justin_c_i)\
**Post date:** [November 25, 2020, 4:55pm UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/5 "2020-11-25T16:55:02Z")

</div>

> Then it should complain that installing the package will cause the file to be overwritten, thereby making the two packages becomes strongly incompatible.

if package X is aleady installed and we try to install package Y,  
by double clicking the package Y how can we check file is there or not and make Package Y from being not installed?

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [November 26, 2020, 8:05am UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/6 "2020-11-26T08:05:38Z")

</div>

If package X and Y both contains the same file, but with different content, then they cannot be installed at the same time without one of the packages being broken.

---

<div class="post-metadata">

**Author:** ![justin\_c\_i](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/justin_c_i/32/232_2.png) [@justin\_c\_i](https://forum.opentap.io/u/justin_c_i)\
**Post date:** [November 27, 2020, 1:02am UTC](https://forum.opentap.io/t/icustompackageaction-with-actionstage-install/137/7 "2020-11-27T01:02:51Z")

</div>

Thanks for the information, wil try that
