iTunes package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

January 21, 2019 - 10:23

- 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()
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 21, 2019 - 3:35 PM

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
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

January 28, 2019 - 12:16

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

April 19, 2019 - 11:39

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

May 24, 2019 - 1:46 PM

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']
Locked