2

I'm trying to develop a small utility that installs an uploaded Sitecore package.
This tool should only install using the Merge-Append option.

This article uses Overwrite. Could you please help me understand what the first argument is for, in the BehaviourOptions method.

I want unavailable items to be created & existing items to be merged by adding a new version (Merge-Append).
For that, will this be the right code.

Sitecore.Install.Items.IItemInstallerEvents events =
       new Sitecore.Install.Items.DefaultItemInstallerEvents(
           new Sitecore.Install.Utils.BehaviourOptions(Sitecore.Install.Utils.InstallMode.Merge, 
 Sitecore.Install.Utils.MergeMode.Append));

1 Answer 1

3

First parameter is InstallMode which can be one of 3:

  • Overwrite
  • Merge
  • Skip

Second parameter is MergeMode, only valid for Merge InstallMode. Values can be:

  • Merge
  • Append
  • Overwrite

It's the same like if you choose options in UI. When you select Merge, you can select another option from the dropdown:

enter image description here

I found the image and more information here: https://sitecorecorner.wordpress.com/2015/04/29/sitecore-package-installation-learnings/

Or here:

https://www.partech.nl/nl/publicaties/2012/11/sitecore-package-installation-options-explained

2
  • In my understanding, both the arguments in the BehaviourOptions method are only for the case of existing items. Is that correct.
    – sukesh
    Jul 30, 2020 at 15:00
  • 1
    Yes, if an item is not there, the option doesn't matter.
    – Marek Musielak
    Jul 30, 2020 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.