Alex_Piggy
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору
Код: --- 5peciali5t.old 2018-11-24 14:23:10.379000000 +0200 +++ 5peciali5t.au3 2018-11-24 14:23:06.903000000 +0200 @@ -91,14 +91,11 @@ GUICtrlSetFont(-1, 15) GUICtrlSetTip(-1, "Установка выбранных компонентов") Global $hGroup2 = GUICtrlCreateGroup("Языки", 440, 185, 90, 220) - Global $hCheckbox7 = GUICtrlCreateCheckbox("zh-TW", 455, 325, 65, 15) - Global $hCheckbox6 = GUICtrlCreateCheckbox("zh-CN", 455, 305, 65, 15) - Global $hCheckbox5 = GUICtrlCreateCheckbox("fr-FR", 455, 285, 65, 15) - Global $hCheckbox4 = GUICtrlCreateCheckbox("de-DE", 455, 265, 65, 15) - Global $hCheckbox3 = GUICtrlCreateCheckbox("uk-UA", 455, 245, 65, 15) - Global $hCheckbox2 = GUICtrlCreateCheckbox("en-US", 455, 225, 65, 15) - Global $hCheckbox = GUICtrlCreateCheckbox("ru-RU", 455, 205, 65, 15) - + Local $cInstLangs = ["ru-RU","en-US","uk-UA","de-DE","fr-FR","zh-CN","zh-TW"] + Global $aInstLangs [UBound($cInstLangs)] + For $i = 0 to UBound($cInstLangs)-1 + $aInstLangs[$i] = GUICtrlCreateCheckbox($cInstLangs[$i], 455, 205 + 25 * $i, 65, 15) + Next Global $hRadio2 = GUICtrlCreateRadio("x64", 460, 155, 35, 15) Global $hRadio = GUICtrlCreateRadio("x86", 460, 135, 55, 15) Local $oIE = ObjCreate("Shell.Explorer.2") @@ -208,11 +205,66 @@ Local $hButton2 = GUICtrlCreateButton("Удаление Office 201x", 190, 500, 160, 30) GUICtrlSetTip(-1, "Используется для полного удаления из системы всех приложений Microsoft Office 201x") + If FileExists("result.xml") Then + Local $oXML = ObjCreate("MSXML2.DomDocument.3.0") + $oXML.load ("result.xml") + For $oNode in $oXML.documentElement.selectNodes("Add/Product/Language") + Local $oLng = InArray($cInstLangs, $oNode.getAttribute("ID")) + If $oLng > -1 Then GUICtrlSetState($aInstLangs[$oLng],$GUI_CHECKED) + Next + If IsObj($oXML.documentElement.selectSingleNode("Add/Product/ExcludeApp[@ID='OneDrive']")) Or InArray($CmdLine,"/excludeonedrive") > -1 Then GUICtrlSetState($hCheckbox65,$GUI_CHECKED) + For $i=0 to UBound($cInstLangs)-1 + If InArray($CmdLine, "/" & $cInstLangs[$i]) > -1 Then GUICtrlSetState($aInstLangs[$i],$GUI_CHECKED) + Next + EndIf + GUISetState() While 1 $hMsg = GUIGetMsg() Switch $hMsg - Case $GUI_EVENT_CLOSE + Case $GUI_EVENT_CLOSE ,$hButton3 Exit + Case $hButton + Local $oXML = ObjCreate("MSXML2.DomDocument.3.0") + $oXML.loadXML ("<Configuration/>") + Local $oAdd = CreateChild ($oXML.documentElement, "Add") + $oAdd.setAttribute ("SourcePath","D:\RePacks\") + $oAdd.setAttribute ("OfficeClientEdition","32") + $oAdd.setAttribute ("Channel","PerpetualVL2019") + $oAdd.setAttribute ("Version","16.0.10827.20138") + Local $oProduct = CreateChild ($oAdd, "Product") + $oProduct.setAttribute("ID","Proplus2019Volume") + For $i = 0 to UBound($aInstLangs)-1 + If GUICtrlRead($aInstLangs[$i])==$GUI_CHECKED Then + Local $oLang = CreateChild ($oProduct, "Language") + $oLang.setAttribute ("ID",GUICtrlRead($aInstLangs[$i],1)) + EndIf + Next + If GUICtrlRead($hCheckbox65)=$GUI_CHECKED Then + Local $oExcl = CreateChild($oProduct,"ExcludeApp") + $oExcl.setAttribute ("ID", GUICtrlRead($hCheckbox65,1)) + EndIf + If InArray($CmdLine, "/silent") > -1 Then + Local $oDisplay = CreateChild($oAdd,"Display") + $oDisplay.setAttribute ("Level","None") + $oDisplay.setAttribute ("AcceptEULA","True") + EndIf + $oXML.save("result.xml") EndSwitch WEnd + +Func CreateChild ($oParent, $vName, $vValue = "") + Local $oTMP + $oTMP = $oParent.ownerDocument.createElement($vName) + If $vValue <> "" Then $oTMP.Text = $vValue + $oParent.appendChild ($oTMP) + Return $oTMP +EndFunc + +Func InArray($Arr,$SEl) + Local $i + For $i = 0 to UBound($Arr)-1 + If $Arr[$i] == $SEl Then Return $i + Next + Return -1 +End Func |
|