Can't remember if it adds a key to the appsettings part though but I think that the concept is illustrated in the source you just need to change the element where it needs to be added.
I think the action is already in PackageAction contrib? http://packageactioncontrib.codeplex.com/ but 9 out of 10 times it's the xml that is wrong when you run into issues. Check and double check if the xml is correct.
There is a newer package action tester that can be found here (works on 7.2.8). This package action tester tests to see if the XML is valid - it will return an error if the XML is not valid. However, it won't test to see if the action is a valid action.
If we take a look at the current Umbraco documentation (here), we can see what package actions are available. Unfortunately, pretty much all of the actions in the documentation (that Dennis Aaen linked us to) don't exist in the current Umbraco core.
in the package action tester, will create the following line in the applications node in the applications.config found in the Config folder of an Umbraco installation.
So, I guess this shows that package actions can be used to run changes on the site.
Going back to the link that Dennis Aaen gave us to the extra documentation, there is a link to some extra actions. If you download the DLL from that project and put it into your Umbraco site, then run the following action through the tester:
Then the following key will be added to the appSettings in the web config:
<add key="TestKey" value="TestValue" />
I have just tested and found that if you package that DLL into your package (jn the Package Files tab when creating your package through Umbraco), then add the actions to the Package Actions tab, you will be able to use the extra actions that the DLL adds.
I hope this helps anyone trying to figure out how to use package actions when creating a package!
Adding Actions to the Package Action tab
Hi there,
Ive added a few package actions that should add keys to the appsetting in umbraco 7.1.1 web.config with no success.
The package is installed but no keys are added to the web.config.
Any idea on how to make it work?
Regards,
Moshe
Hi Moshe,
DonĀ“t know if this documentation could be any help at a version 7 or if you have seen this?.
http://our.umbraco.org/wiki/how-tos/packages-and-projects/package-action-samples
/Dennis
That link is removed, I found this instead https://our.umbraco.com/Documentation/Reference/Packaging/
Hi Moshe
Try the link Dennis posted above - If you need some inspiration you can perhaps get some by having a peak at the source code of the installer for exponent cropup http://cropup.codeplex.com/SourceControl/latest#Eksponent.CropUp.UmbracoIV/Installer/AddHttpModule.cs
Can't remember if it adds a key to the appsettings part though but I think that the concept is illustrated in the source you just need to change the element where it needs to be added.
Hope this helps.
/Jan
Hi,
Many thanks for your reples!
Dennis, Ive tried that with no success.
Jan, Also tried your link but also here I wasnt able to get it right. It seems as if the Execute methos is not being called.
any idea?
Regards,
Moshe
Hi,
I think the action is already in PackageAction contrib? http://packageactioncontrib.codeplex.com/ but 9 out of 10 times it's the xml that is wrong when you run into issues. Check and double check if the xml is correct.
Cheers,
Richard
Sorry to drag up an old topic, but there is a really limited amount of documentation on this subject.
The link that Dennis Aaen gave us (http://our.umbraco.org/wiki/how-tos/packages-and-projects/package-action-samples) has a link to a package action tester (tswe.pat_4.0.0.zip). However, this package action tester does not work in later versions of Umbraco (tested on Umbraco 7.2.8) because of a missing core util that has been deprecated (GitHub link to missing util).
There is a newer package action tester that can be found here (works on 7.2.8). This package action tester tests to see if the XML is valid - it will return an error if the XML is not valid. However, it won't test to see if the action is a valid action.
If we take a look at the current Umbraco documentation (here), we can see what package actions are available. Unfortunately, pretty much all of the actions in the documentation (that Dennis Aaen linked us to) don't exist in the current Umbraco core.
Running:
in the package action tester, will create the following line in the applications node in the applications.config found in the Config folder of an Umbraco installation.
So, I guess this shows that package actions can be used to run changes on the site.
Going back to the link that Dennis Aaen gave us to the extra documentation, there is a link to some extra actions. If you download the DLL from that project and put it into your Umbraco site, then run the following action through the tester:
Then the following key will be added to the appSettings in the web config:
I have just tested and found that if you package that DLL into your package (jn the Package Files tab when creating your package through Umbraco), then add the actions to the Package Actions tab, you will be able to use the extra actions that the DLL adds.
I hope this helps anyone trying to figure out how to use package actions when creating a package!
If anyone is interested in adding further package actions to their package, I recommend doing what Merchello has done.
https://github.com/Merchello/Merchello/tree/c252625d56d0966d3d274a5fac3550b6359c9b37/src/Merchello.Web/PackageActions
is working on a reply...