Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michiel 137 posts 294 karma points
    Aug 13, 2013 @ 21:55
    Michiel
    0

    Can we automate the installation of Umbraco packages?

    If we have a package ZIP file, can we call a public API to install the package?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Aug 14, 2013 @ 09:33
    Jeroen Breuer
    0

    This is an interessting idea. Currently packages are installed if you press the install button. So just download the Umbraco source to see what it does behind that button. Maybe it's already possible, but nobody tried it ;-).

    Jeroen

  • Michiel 137 posts 294 karma points
    Aug 14, 2013 @ 10:01
    Michiel
    0

    Yeah, I'm definitely going to look into that, just wondering if someone has any experience.

  • Kevin Jump 1867 posts 11859 karma points MVP 4x c-trib
    Aug 14, 2013 @ 14:18
    Kevin Jump
    100

    I have a fairly complete bit of code for installing packages in one of the experimental bits of usync

    https://github.com/KevinJump/jumoo.usync/tree/master/jumoo.usync.packages

    The only real problem is that it doesn't work :(

    You can call the api elements to do a package install but a package can alter config and upload dlls . they can cause the application pool to restart 

     

    When the app pool restartsyou then have to resume the install and run through the package actions.

     

    Usync does this by running in the applicationstarted event. But at the moment attempting to run through the package actions as this point throws an error .

     

    Its a bit of code in the core or pulling lots of corecode out to get past that so I stopped for now as it was really me just being curious

     

  • Michiel 137 posts 294 karma points
    Aug 14, 2013 @ 15:05
    Michiel
    0

    Interesting... and thanks for sharing!

    Apart from package actions, I think a package install can be 'captured' in version control, it's just files being copied and config changes. If assemblies are copied, then you'd need to copy the assembly out into an 'external dll' folder and turn it into a reference in the Visual Studio project.

    Then any package actions would need to be run, once, at application start. Of course a package action can be custom code, right? So it could alter the database, or create even more files...

    I am now considering to allow only 'known' packages, for which the installed state can be captured in verison control. I believe for example that Courier and uComponents are such packages. Typical 'adds a doctype' packages probably are not...

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 14, 2013 @ 15:16
    Tim Geyssens
    1

    Here is a code snippet that might be usefull

    https://github.com/TimGeyssens/BundlingAndMinificationForTheMasses/blob/master/BundlingAndMinificationForTheMasses/Umbraco/Dialogs/ProviderInstaller.ascx.cs

    It's from Optimus, so basicly it allows you to install providers (that are also just umbraco packages) after the main package has been installed, it also executes packages actions...

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 14, 2013 @ 15:17
    Tim Geyssens
    0

    So you'll see that there is an API available in the umbraco.cms.businesslogic.packager namespace

  • Michiel 137 posts 294 karma points
    Aug 14, 2013 @ 20:31
    Michiel
    0

    @Tim: great, thanks!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies