First version of the package

This commit is contained in:
Daniel Berteaud 2018-12-06 13:04:56 +01:00
parent 273e2a1d69
commit 1bdf9a735e
3 changed files with 369 additions and 0 deletions

32
WAPT/control Normal file
View File

@ -0,0 +1,32 @@
package : fws-itunes
version : 12.9.2.6-1
architecture : all
section : base
priority : optional
maintainer : Daniel Berteaud
description : Apple iTunes
depends : fws-apple-application-support, fws-aple-mobile-device-support
conflicts :
maturity : DEV
locale : all
target_os : windows
min_os_version : 5.0
max_os_version :
min_wapt_version : 1.3.12
sources :
installed_size :
impacted_process : itunes.exe
description_fr :
description_pl :
description_de :
description_es :
audit_schedule : 4w
editor :
keywords :
licence :
homepage : https://www.apple.com/itunes/
package_uuid :
signer : Daniel Berteaud
signer_fingerprint:
signature_date :
signed_attributes :

295
WAPT/wapt.psproj Normal file
View File

@ -0,0 +1,295 @@
[PyScripter]
Version=3.3.2.0
[Project]
ClassName=TProjectRootNode
StoreRelativePaths=TRUE
ShowFileExtensions=FALSE
[Project\ChildNodes\Node0]
ClassName=TProjectFilesNode
[Project\ChildNodes\Node0\ChildNodes\Node0]
ClassName=TProjectFolderNode
Name=wapt
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\common.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\setuphelpers.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\wapt-get.ini
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\wapt-get.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\waptpackage.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes]
Count=5
[Project\ChildNodes\Node0\ChildNodes\Node1]
ClassName=TProjectFileNode
FileName=$[Project-Path]changelog.txt
[Project\ChildNodes\Node0\ChildNodes\Node2]
ClassName=TProjectFileNode
FileName=$[Project-Path]control
[Project\ChildNodes\Node0\ChildNodes\Node3]
ClassName=TProjectFileNode
FileName=$[Project-Path]..\setup.py
[Project\ChildNodes\Node0\ChildNodes]
Count=4
[Project\ChildNodes\Node1]
ClassName=TProjectRunConfiguationsNode
[Project\ChildNodes\Node1\ChildNodes\Node0]
ClassName=TProjectRunConfiguationNode
Name=install
[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=install "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node1]
ClassName=TProjectRunConfiguationNode
Name=remove
[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=remove "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node2]
ClassName=TProjectRunConfiguationNode
Name=session-setup
[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=session-setup "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node3]
ClassName=TProjectRunConfiguationNode
Name=update
[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=update
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node4]
ClassName=TProjectRunConfiguationNode
Name=upgrade
[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=-f upgrade
WorkingDir=$[ActiveScript-Dir]
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node5]
ClassName=TProjectRunConfiguationNode
Name=-i build-upload
[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=-i build-upload "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node6]
ClassName=TProjectRunConfiguationNode
Name=svn update
[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=sources "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node7]
ClassName=TProjectRunConfiguationNode
Name=uninstall
[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=uninstall "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[Project-Path]..
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node8]
ClassName=TProjectRunConfiguationNode
Name=update-package-sources
[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=update-package-sources "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node9]
ClassName=TProjectRunConfiguationNode
Name=audit
[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig]
ScriptName=C:\Program Files (x86)\wapt\wapt-get.py
EngineType=peRemote
ReinitializeBeforeRun=TRUE
Parameters=audit "$[Project-Path].."
WorkingDir=$[Project-Path]..
WriteOutputToFile=FALSE
OutputFileName=$[ActiveScript-NoExt].log
AppendToFile=FALSE
[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig\ExternalRun]
Caption=External Run
Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes]
Count=10
[Project\ChildNodes]
Count=2
[Project\ExtraPythonPath]
Count=0

42
setup.py Normal file
View File

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print('Installing Apple iTunes')
msi = 'iTunes64.msi' if iswin64() else 'iTunes.msi'
run(r'msiexec /qn /norestart /i%s SCHEDULE_ASUW=0' % msi,accept_returncodes=[0,3010])
for soft in installed_softwares('iTunes'):
# Only check for the exact name. Eg, not iTunes Awsome Addon
if soft['name'] == 'iTunes':
uninstallkey = soft['key']
# Disable auto updates, using the parental control
with reg_openkey_noredir(HKEY_LOCAL_MACHINE,r'SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default',sam=KEY_WRITE,create_if_missing=True) as reg_key:
reg_setvalue(reg_key, 'AdminFlags', 257, REG_DWORD)
# Remove desktop shortcut
remove_desktop_shortcut('iTunes')
def uninstall():
print('Uninstalling Apple iTunes')
for soft in installed_softwares('iTunes'):
if soft['name'] == 'iTunes':
run(r'msiexec /qn /norestart /x%s' % soft['key'])
def audit():
is_installed = False
for soft in installed_softwares('iTunes'):
is_installed = True
if is_installed == False :
print('iTunes is not installed')
return "ERROR"
parental_control = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default','AdminFlags')
if not parental_control:
print('Parental control is not enabled')
return "WARNING"
elif int(parental_control) != 257:
print('Parental control settings is not 257 as expected')
return "WARNING"
return "OK"