Search In
Can anyone see any reason why the following pacakge action would not work?
<Action runat="uninstall" undo="false" alias="ExecuteSql"><![CDATA[UPDATE umbracoAppTree SET treeHandlerAssembly = 'umbraco', treeHandlerType='loadMedia' WHERE treeAlias='media']]></Action>
I have an install action that is almost identical and works fine, I am simply trying to return the AppTree to its state before it was altered.
Umbraco 4.0.2
Any ideas? TIA
Did the package action make it into the xml for the installed package? Can be verified in the installedPackages folder (I'm thinking the action should be in the xml, otherwise it won't be fired)
/Dirk
Yes it is in the package XML, all present and correct, so I am still stumped. I also ran the actions through the Package Actions Tester with success.
On a seperate note, something else I have just discovered is that the zip files created by the Package Manager do not allow the files to extracted using Windows Explorer for some reason, in XP SP3 anyhow. I had to use another app for extracting the file to take a look.
Luckily, I have a similar install (i'm also doing the media trick - but don't include the uninstall action - which i will now) and i'll run a quick test on my local box.
Keep you updated!
Cheers,
Thanks Dirk, look forward to hearing your findings.
Hi Simon,
try to remove the undo="false" attribute. If that doesn't help you try to attach a debugger when uninstalling. What could have happened is that the dll is removed before the action is executed.
If that is the case it's a bug in the core. Then I reccommend to create a custom action for your needs and add the code above to the Undo method. Also make sure that you still remove the undo="false" attribute Otherwise the undo will never be hit.
Hope it helps you,
Richard
it could be the case Richard, when uninstall actions are being fired (there in the config for uninstalling), the action is checked against a list of the 'standard' package actions, where we'd expect the custom package action to be in the list as well!
Furthermore, the class has a static constructor that fires to find all actions that implement IPackageAction, so will only fire once. I'm not sure whether that static constructor fires again if you add a new dll (does that initiate a restart?)
@Simon ,did you include the package action contrib in the package (as a file), or was it already in the /bin folder before the install/uninstall. It would be great test if you could try that one (= PackageActionsContrib.dll in /bin folder, iis reset, and install/uninstall - do not include dll in package then)
If it still doesn't work, we need to create a new work item on Codeplex to change behaviour of the static constructir
Let us know what you can find.
I tried your suggestion Richard but to no avail!
I suppose I will need to go down the route of a custom package action to perform this task for the time being then.
Dirk, no I didn't have the PackageActionContrib.dll in my package, it was already in the installation. I have just a single dll in my package.
I think a custom package action is the best option then. Again make sure undo="false" is not in the xml. For some reason it fails
Even having created my own custom package action it does not seem to run when the package is uninstalled and I have not included my package action in the package yet I have just dropped it into the bin folder for the site. Has anyone ever successfully ran an uninstall action?