Page 1 of 1

iTunes package

Published: January 21, 2019 - 10:23 AM
by Mathieu
- Installed WAPT version (1.6.2.7 Enterprise)
- Server OS (Linux) and version (Stretch)
- Operating system of the administration/package creation machine (Windows 10)

Good morning,

I'm having trouble using iTunes. I followed Apple's silent install method, but the software isn't working properly. When I go into the settings, iTunes crashes, and it doesn't work with my iPhone even though I've installed all the iTunes components.

I wanted to know if any of you have managed to get iTunes working properly.

Here is my script:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = ['{5881B877-CB42-4317-9411-96BA3CA39715}']
Property = get_file_properties('iTunes64Setup.exe')['ProductVersion']
waptdev = 'c:/waptdev/futur-Itunes_x64_PROD-wapt/Setup'

def install():
    print('installing futur-Itunes')
    install_msi_if_needed('AppleApplicationSupport64.msi', min_version='7.2')
    install_msi_if_needed('Bonjour64.msi', min_version='3.1.0.1')
    install_msi_if_needed('AppleMobileDeviceSupport64.msi', min_version='12.1.0.25')
    install_msi_if_needed('AppleSoftwareUpdate.msi')
##    install_msi_if_needed('iTunes64.msi',uninstallkeylist='{A9921EE9-86E5-402C-A934-4A8DBAD99E24}')
##    install_exe_if_needed('iTunes64Setup.exe', silentflags='/qn /norestart', key='{5881B877-CB42-4317-9411-96BA3CA39715}',min_version='12.9.2.6',killbefore=['iTunes.exe'])
    run('start /wait /i iTunes64Setup.exe /qn /norestart')


def uninstall():
    print('Uninstalling Itunes')
    print('Apple Application Support (64 bits)')
    run('MsiExec.exe /X {466D00D0-E7DE-47C2-8FE5-54A8009F5850} /quiet')
    print('iTunes')
    run('MsiExec.exe /X {5881B877-CB42-4317-9411-96BA3CA39715} /quiet')
    print('Apple Mobile Device Support')
    run('MsiExec.exe /X {5FA8C4BE-8C74-4B9C-9B49-EBF759230189} /quiet')
    print('Apple Application Support (32 bits)')
    run('MsiExec.exe /X {80B42CAA-28C0-4FBD-A46E-D61F45E2F9FC} /quiet')
    print('Apple Software Update')
    run('MsiExec.exe /X {A30EA700-5515-48F0-88B0-9E99DC356B88} /quiet')




def update_package():
    """ You can do a CTRL F9 in pyscripter to update the package """
    import re,requests,urlparse,glob

    url = requests.head('https://www.apple.com/itunes/download/win64',proxies={}).headers['Location']
    filename = urlparse.unquote(url.rsplit('/',1)[1])

    if not isfile(filename):
        print('Downloading %s from %s'%(filename,url))
        wget(url,filename)

    exes = glob.glob('*.exe')
    for fn in exes:
        if fn != filename:
            remove_file(fn)

    # change version of package
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = get_file_properties('iTunes64Setup.exe')['ProductVersion']+'-0'
    pe.save_control_to_wapt(os.getcwd())

    #Extraction fichier install
    run('iTunes64Setup.exe /extract')



if __name__ == '__main__':
    update_package()

Re: iTunes Package

Published: January 21, 2019 - 3:35 PM
by sfonteneau
Hi Mathieu,

I don't have a better suggestion.

When you look at the other solutions, they do the same thing:

wpkg: https://wpkg.org/ITunes
Chocolatey: https://chocolatey.org/packages/iTunes
SCCM: https://www.itsupportguides.com/knowled ... ll-itunes/

So, no better, :cry:

Simon

Re: iTunes Package

Published: January 28, 2019 - 12:16 PM
by Mathieu
Thanks for your reply.

I don't understand why I'm having this problem when the software is properly installed, because we have many people with iPhones who often come back to update iTunes.

Re: iTunes Package

Published: April 19, 2019 - 11:39 AM
by Mathieu
Good morning,

After several attempts, iTunes works perfectly.

Now I'm working on creating an update_packages

Code: Select all

def update_package():
    """ You can do a CTRL F9 in pyscripter to update the package """
    import re,requests,urlparse,glob

    url = requests.head('https://www.apple.com/itunes/download/win64',proxies={}).headers['Location']
    filename = urlparse.unquote(url.rsplit('/',1)[1])

    if not isfile(filename):
        print('Downloading %s from %s'%(filename,url))
        wget(url,filename)

    exes = glob.glob('*.exe')
    for fn in exes:
        if fn != filename:
            remove_file(fn)

    # change version of package
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = get_file_properties('iTunes64Setup.exe')['ProductVersion']+'-0'
    pe.save_control_to_wapt(os.getcwd())

    #Extraction fichier install
    run('iTunes64Setup.exe /extract')
    remove_file('AppleSoftwareUpdate.msi')
I tried to copy an existing code, but I can't perform a version check without downloading the executable.
For the update, I need to extract the .exe file and delete the application that checks for updates.

except that when I launch the update it only performs the extraction.

Re: iTunes Package

Published: May 24, 2019 - 1:46 PM
by sfonteneau
The version number does not appear on the website :-(

A simple trick that works is to use a Head request to find the Last-Modified value (the file's modification date)

Therefore, we can determine if the file has changed since the last request

Code: Select all

requests.head("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B01A08A05-06E7-18A2-ECC1-688FDED29A35%7D%26lang%3Dfr%26browser%3D3%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable/dl/chrome/install/googlechromestandaloneenterprise64.msi").headers['Last-Modified']