  If VersionLessThan 1.1.2
	Message "Для установки требуется OBMM версии 1.1.2 или выше."
	FatalError
EndIf

AllowRunOnLines

DontInstallAnyPlugins
DontInstallAnyDataFiles

CopyPlugin "00 Unofficial Oblivion Patch\\Unofficial Oblivion Patch.esp" "Unofficial Oblivion Patch.esp"
CopyDataFolder "00 Unofficial Oblivion Patch\\Sound" "Sound" True
CopyDataFolder "00 Unofficial Oblivion Patch\\Textures" "Textures" True

If DataFileExists "DLCShiveringIsles.esp"
  	CopyPlugin "01 Unofficial Shivering Isles Patch\\Unofficial Shivering Isles Patch.esp" "Unofficial Shivering Isles Patch.esp"
	CopyDataFolder "01 Unofficial Shivering Isles Patch\\Sound" "Sound" True
	LoadAfter "Unofficial Shivering Isles Patch.esp" "Unofficial Oblivion Patch.esp"
EndIf

If DataFileExists "DLCHorseArmor.esp"
  	CopyPlugin "02 DLCHorseArmor - Unofficial Patch\\DLCHorseArmor - Unofficial Patch.esp" "DLCHorseArmor - Unofficial Patch.esp"
	LoadAfter "DLCHorseArmor - Unofficial Patch.esp" "DLCHorseArmor.esp"
EndIf

If DataFileExists "DLCOrrery.esp"
  	CopyPlugin "03 DLCOrrery - Unofficial Patch\\DLCOrrery - Unofficial Patch.esp" "DLCOrrery - Unofficial Patch.esp"
	CopyDataFolder "03 DLCOrrery - Unofficial Patch\\Sound" "Sound" True
	LoadAfter "DLCOrrery - Unofficial Patch.esp" "DLCOrrery.esp"
EndIf

If DataFileExists "DLCVileLair.esp"
  	CopyPlugin "04 DLCVileLair - Unofficial Patch\\DLCVileLair - Unofficial Patch.esp" "DLCVileLair - Unofficial Patch.esp"
	CopyDataFolder "04 DLCVileLair - Unofficial Patch\\Sound" "Sound" True
	LoadAfter "DLCVileLair - Unofficial Patch.esp" "DLCVileLair.esp"
EndIf

If DataFileExists "DLCMehrunesRazor.esp"
  	CopyPlugin "05 DLCMehrunesRazor - Unofficial Patch\\DLCMehrunesRazor - Unofficial Patch.esp" "DLCMehrunesRazor - Unofficial Patch.esp"
	LoadAfter "DLCMehrunesRazor - Unofficial Patch.esp" "DLCMehrunesRazor.esp"
EndIf

If DataFileExists "DLCSpellTomes.esp"
  	CopyPlugin "06 DLCSpellTomes - Unofficial Patch\\DLCSpellTomes - Unofficial Patch.esp" "DLCSpellTomes - Unofficial Patch.esp"
	LoadAfter "DLCSpellTomes - Unofficial Patch.esp" "DLCSpellTomes.esp"
EndIf

If DataFileExists "DLCThievesDen.esp"
  	CopyPlugin "07 DLCThievesDen - Unofficial Patch\\DLCThievesDen - Unofficial Patch.esp" "DLCThievesDen - Unofficial Patch.esp"
  	CopyPlugin "07 DLCThievesDen - Unofficial Patch\\DLCThievesDen - Unofficial Patch - SSSB.esp" "DLCThievesDen - Unofficial Patch - SSSB.esp"
	LoadAfter "DLCThievesDen - Unofficial Patch.esp" "DLCThievesDen.esp"
	LoadAfter "DLCThievesDen - Unofficial Patch - SSSB.esp" "DLCThievesDen - Unofficial Patch.esp"
EndIf

If DataFileExists "DLCBattlehornCastle.esp"
  	CopyPlugin "08 DLCBattlehornCastle - Unofficial Patch\\DLCBattlehornCastle - Unofficial Patch.esp" "DLCBattlehornCastle - Unofficial Patch.esp"
	CopyDataFolder "08 DLCBattlehornCastle - Unofficial Patch\\Textures" "Textures" True
	LoadAfter "DLCBattlehornCastle - Unofficial Patch.esp" "DLCBattlehornCastle.esp"
EndIf

If DataFileExists "DLCFrostcrag.esp"
  	CopyPlugin "09 DLCFrostcrag - Unofficial Patch\\DLCFrostcrag - Unofficial Patch.esp" "DLCFrostcrag - Unofficial Patch.esp"
	LoadAfter "DLCFrostcrag - Unofficial Patch.esp" "DLCFrostcrag.esp"
EndIf

If DataFileExists "Knights.esp"
  	CopyPlugin "10 Knights - Unofficial Patch\\Knights - Unofficial Patch.esp" "Knights - Unofficial Patch.esp"
	CopyDataFolder "10 Knights - Unofficial Patch\\Textures" "Textures" True
	CopyDataFolder "10 Knights - Unofficial Patch\\Sound" "Sound" True
	LoadAfter "Knights - Unofficial Patch.esp" "Knights.esp"
EndIf

SelectManyWithDescriptions "Компоненты Unofficial Oblivion Patch",\
	"|Oblivion Citadel Door Fix" "Исправляет отсутствие звука двери CitadelHallDoorAnim (пришлось изменить все образцы этой двери, т.ч. лучше не использовать если у вас есть другие моды, которые используют эту дверь)."
	Case Oblivion Citadel Door Fix
		CopyPlugin "00 Unofficial Oblivion Patch\\Oblivion Citadel Door Fix.esp" "Oblivion Citadel Door Fix.esp"
		LoadAfter "Oblivion Citadel Door Fix.esp" "Unofficial Oblivion Patch.esp"
	Break
EndSelect

Select "Мод 'Компаньон Рыжая Соня' (Опция)",\
	"Воин по умолчанию",\
	"Лучник по умолчанию",\
	"Ненада"
	Case Воин по умолчанию
		CopyPlugin "11 Sonia\\Sonia.esp" "Sonia.esp"
		CopyDataFile "11 Sonia\\Sonia.bsa" "Sonia.bsa"
	Break
	Case Лучник по умолчанию
		CopyPlugin "11 Sonia\\DefaultArcher\\Sonia.esp" "Sonia.esp"
		CopyDataFile "11 Sonia\\Sonia.bsa" "Sonia.bsa"
	Break
EndSelect
