x First time here? Check out the FAQ
  • Avatar511posts920karma

    Package Action ExecuteSql on Uninstall not working

    Simon Dingley started this topic More than a year ago , this topic was edited at: Monday, November 09, 2009 7:02 AM, Go directly to the topic solution

    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


  • Replies

  • Avatar4255posts4651karma
    admin Comment with ID: 12400
    Dirk De Grave posted this reply More than a year ago

    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


  • Avatar511posts920karma
    Comment with ID: 12407
    Simon Dingley posted this reply More than a year ago

    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.


  • Avatar4255posts4651karma
    admin Comment with ID: 12408
    Dirk De Grave posted this reply More than a year ago

    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,

    /Dirk


  • Avatar511posts920karma
    Comment with ID: 12409
    Simon Dingley posted this reply More than a year ago

    Thanks Dirk, look forward to hearing your findings.


  • Avatar1725posts3733karma
    Comment with ID: 12410
    Richard Soeteman posted this reply More than a year ago

    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

     


  • Avatar4255posts4651karma
    admin Comment with ID: 12412
    Dirk De Grave posted this reply More than a year ago

    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.

     

    Cheers,

    /Dirk

     


  • Avatar511posts920karma
    Comment with ID: 12419
    Simon Dingley posted this reply More than a year ago

    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.


  • Avatar511posts920karma
    Comment with ID: 12420
    Simon Dingley posted this reply More than a year ago

    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.


  • Avatar1725posts3733karma
    Comment with ID: 12421
    Richard Soeteman posted this reply More than a year ago

    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


  • Avatar511posts920karma
    Comment with ID: 12512
    Simon Dingley posted this reply More than a year ago

    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?


Pages:

Please login or Sign up To post replies