I'm creating my first v4 package, which is a simple image gallery.
It contains custom media document types and these can't be added using the package creation wizard inside Umbraco, so I'm creating them using an installer.ascx user control that runs when the package is installed.
My question is - if the user uninstalls the package, how do I remove these custom media document types? Can I create an uninstaller.ascx and how do I tell umbraco to run it?
To use them will involve you editing the package.xml file and adding an install/uninstall actions. I'm not sure if there's an action in the standard set which handles adding/removing of document types but it's not too difficult to create a custom package action to suit your needs. You could also replace your installer.ascx with a custom package action and make it a bit more seamless.
How to add uninstall actions to a package
Hi,
I'm creating my first v4 package, which is a simple image gallery.
It contains custom media document types and these can't be added using the package creation wizard inside Umbraco, so I'm creating them using an installer.ascx user control that runs when the package is installed.
My question is - if the user uninstalls the package, how do I remove these custom media document types? Can I create an uninstaller.ascx and how do I tell umbraco to run it?
Having had to do somthing similar recently for the uGlimpse package I created, I would imagine you'd want to take a look at using package actions:
http://our.umbraco.org/wiki/reference/packaging/package-actions
To use them will involve you editing the package.xml file and adding an install/uninstall actions. I'm not sure if there's an action in the standard set which handles adding/removing of document types but it's not too difficult to create a custom package action to suit your needs. You could also replace your installer.ascx with a custom package action and make it a bit more seamless.
If you check out the source for the packageactionscontrib on Codeplex you can find some good examples of custom package actions.
Hope this helps
Cheers
is working on a reply...