# # XenCenter Management Console turbo.me file # https://github.com/turboapps/turbome/tree/master/xensource/xencenter/turbo.me # # Created with Turbo CMD version 1.4.2242.0 # # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 ################################### # Requirements ################################### requires privilege:admin ################################### # Meta tags ################################### meta title="XenCenter Management Console" meta namespace="xensource" meta name="xencenter" ################################### # Pull dependency images ################################### # dotnet shouldbe layered, change after CLNT-7280 is fixed using turbo/turboscript-tools:2016.2.2, microsoft/dotnet:4.6.1 ################################### # Download and install ################################### # Set working directory cmd mkdir c:\Workspace workdir c:\Workspace # Get download link batch cmd echo [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 > getDownloadLink.ps1 echo $result = Invoke-WebRequest -Uri https://xenserver.org/overview-xenserver-open-source-virtualization/download.html >> getDownloadLink.ps1 echo if ($result -NotMatch 'a href="(?.*standard-edition.html)"^>XenCenter Management GUI') >> getDownloadLink.ps1 echo { throw "Failed to extract download site link" } >> getDownloadLink.ps1 echo $result = Invoke-WebRequest -Uri $Matches['downloadSite'] >> getDownloadLink.ps1 echo if ($result -NotMatch 'rel="(?.*-XenCenter.msi)"') >> getDownloadLink.ps1 echo { throw "Failed to extract download link" } >> getDownloadLink.ps1 echo Write-Host $Matches['downloadLink'] >> getDownloadLink.ps1 cmd powershell -File getDownloadLink.ps1 var url = last # Download cmd wget --no-verbose -O install.msi %url% # Install cmd install.msi /quiet # Get version var application="c:\Program Files (x86)\Citrix\XenCenter\XenCenter.exe" batch cmd copy c:\TurboBuildTools\PowerShell\Turbo c:\Workspace powershell -command ". .\Get-FileVersion.ps1; Get-FileVersion -Path ""%application%""" > image.txt cmd findstr "." image.txt var version = last # Turn off update notification batch cmd powershell -command "Start-Process ""%application%""" timeout 15 /nobreak taskkill /im XenCenterMain.exe /T /F batch cmd echo import xml.dom.minidom > turnOffUpdate.py echo import glob >> turnOffUpdate.py echo import os >> turnOffUpdate.py echo import xml.etree.ElementTree as ET >> turnOffUpdate.py echo settingsPath = glob.glob(r"{0}\citrix\xencentermain*\*\*".format(os.environ["appdata"]))[0] >> turnOffUpdate.py echo root = ET.parse(settingsPath) >> turnOffUpdate.py echo settings = root.findall(".//XenAdmin.Properties.Settings")[0] >> turnOffUpdate.py echo def add_setting(name, value): >> turnOffUpdate.py echo settingElem = ET.SubElement(settings, "setting", attrib={"serializeAs": "String", "name": name}) >> turnOffUpdate.py echo valueElem = ET.SubElement(settingElem, "value") >> turnOffUpdate.py echo valueElem.text = value >> turnOffUpdate.py echo add_setting("RequirePass", "False") >> turnOffUpdate.py echo add_setting("DoUpgrade", "False") >> turnOffUpdate.py echo add_setting("AllowXenCenterUpdates", "False") >> turnOffUpdate.py echo add_setting("AllowPatchesUpdates", "False") >> turnOffUpdate.py echo add_setting("SeenAllowUpdatesDialog", "True") >> turnOffUpdate.py echo root.write(settingsPath, encoding="utf-8") >> turnOffUpdate.py echo xml = xml.dom.minidom.parse(settingsPath) >> turnOffUpdate.py echo pretty_xml = xml.toprettyxml() >> turnOffUpdate.py echo with open(settingsPath, "w") as settings_file: >> turnOffUpdate.py echo print(pretty_xml, file=settings_file) >> turnOffUpdate.py cmd python turnOffUpdate.py ################################### # Clean up ################################### cmd copy c:\TurboBuildTools\PowerShell\Turbo c:\Workspace cmd powershell -command ". .\Remove-BuildTools.ps1; Remove-BuildTools" workdir c:\ cmd rmdir c:\Workspace /s /q cmd rmdir c:\TurboBuildTools /s /q ################################### # Version ################################### meta tag=version ################################### # Startup File ################################### startup file("@PROGRAMFILESX86@\Citrix\XenCenter\XenCenter.exe")