ICustomPackageAction With ActionStage(Install)

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

2 Likes

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?

1 Like

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.

1 Like

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.

2 Likes

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?

1 Like

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.

2 Likes

Thanks for the information, wil try that

1 Like