Zvi
Zvi

Reputation: 97

How do I pass an accept license argument to the Apple iTMS Transporter installer?

I am trying to download and execute the iTMS Apple Transporter installer shell script on Linux. I am prompted to accept the license, but I want to pass the --accept parameter to the script so that I will not need to manually accept.

I ran

wget -O iTMSTransporter_installer_linux_3.2.sh "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/resources/download/public/Transporter__Linux/bin"

and then

./iTMSTransporter_installer_linux_3.2.sh --accept

Despite passing the --accept argument, I still get prompted to accept the license.

The source code from ./iTMSTransporter_installer_linux_3.2.sh reads:

initargs="$@"

while true
do
    case "$1" in
    -h | --help)
    MS_Help
    exit 0
    ;;
    -q | --quiet)
    quiet=y
    noprogress=y
    shift
    ;;
    --accept)
    accept=y
    shift
    ;;
    --info)

and then in the PrintLicense() method:


MS_PrintLicense()
{
  PAGER=${PAGER:=more}
  if test x"$licensetxt" != x; then
    PAGER_PATH=`exec <&- 2>&-; which $PAGER || command -v $PAGER || type $PAGER`
    if test -x "$PAGER_PATH"; then
      echo "$licensetxt" | $PAGER
    else
      echo "$licensetxt"
    fi
    if test x"$accept" != xy; then
      while true
      do
        MS_Printf "Please type y to accept, n otherwise: "
        read yn
        if test x"$yn" = xn; then
          keep=n
          eval $finish; exit 1
          break;
        elif test x"$yn" = xy; then
          break;
        fi
      done

Upvotes: 2

Views: 227

Answers (1)

David Petrik
David Petrik

Reputation: 53

iTMSTransporter installer is packed by makeself https://makeself.io/.

The --accept parameter is to agree with the license if it is part of makeself. However, Apple does not use this capability. So it only unzips the files that are inside the self-extracting script and runs another script inside.

Unfortunately, the internal script does not allow skipping the license. There are more problems with the internal script that can theoretically be solved (skip pagination, force yes from standard input, etc.).

For our purposes, we preferred to use the makeself parameters for archive extraction without execution. We then manually copied the itms folder. We use this method in the docker.

curl -sSL "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/resources/download/public/Transporter__Linux/bin" -o ~/installer_package.sh
chmod u+x ~/installer_package.sh
~/installer_package.sh --noexec --target ~/trasporter_install
rm ~/installer_package.sh
cp -r ~/trasporter_install/itms ~/itms
rm -rf ~/trasporter_install
chmod 555 ~/itms/bin/iTMSTransporter

Upvotes: 1

Related Questions