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 ;-).
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
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...
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...
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?
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
Yeah, I'm definitely going to look into that, just wondering if someone has any experience.
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
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
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
So you'll see that there is an API available in the umbraco.cms.businesslogic.packager namespace
@Tim: great, thanks!
is working on a reply...