Copied to clipboard

Flag this post as spam?

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


  • Umbraco 137 posts 294 karma points
    Aug 13, 2013 @ 21:55
    Umbraco
    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 4908 posts 12265 karma points MVP 4x 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

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

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

  • Kevin Jump 2310 posts 14695 karma points MVP 7x 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

     

  • Umbraco 137 posts 294 karma points
    Aug 14, 2013 @ 15:05
    Umbraco
    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...

  • Comment author was deleted

    Aug 14, 2013 @ 15:16

    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...

  • Comment author was deleted

    Aug 14, 2013 @ 15:17

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

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

    @Tim: great, thanks!

Please Sign in or register to post replies

Write your reply to:

Draft