download Custom Quick Support Module from script and recognize it as new version

I want to automate the distribution of the latest version of our Custom Quick Support Module.
When I open "https://get.teamviewer.com/OurCustomQSName" with any browser, the download starts immediately.
In my script I use curl. The download from the original URL does not work.
Which parameters do I have to specify to get the current version in my language?

I found that I can use the URL "https://customdesign.teamviewer.com/download/version_14x/ourqssupportid/TeamViewerQS.exe" and have to specify a UserAgent, e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" to get version 14.x.
I would like to have the script working with the next version without change.

After the download I want to check the version number of the downloaded file to make sure it is a newer version before making the new file available.

Comments

  • Have you had any replies? I'm wanting to do the same. Seems to redirect then expire the link.

  • KDV
    KDV Posts: 3

    Unfortunately I had no replies.

    My downlaod works when I use
    curl
    -h "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
    - f
    -s
    https://customdesign.teamviewer.com/download/version_14x/id_of_our_/TeamViewerQS.exe
    -o TeamViewerQS.exe

    but only if I tried the download whithin a browser a short time before.

  • christian-j
    christian-j Posts: 54 Staff member 🤠

    Hello,

    I've just tried it with the following Powershell script and I got the correct executable directly:

    Invoke-WebRequest -Uri https://customdesign.teamviewer.com/download/version_14x/%CUSTOMIZATIONID%/TeamViewerQS.exe -OutFile "$env:Temp\TeamViewer_QS.exe"

    You need to replace "%CUSTOMIZATIONID%" with your customization id.

    Team Lead Product Development (Enterprise)

    Did my reply answer your question? To help others, please accept it as solution. Thanks!
  • KDV
    KDV Posts: 3

    The funny thing about this:
    this link only works a short time after you tried to download the qs with your browser.
    It looks as it is build just in time and remains available only for a short time.

    A "cold" call of the link causes a 404 message:
    Invoke-WebRequest : Server Error - 404
    File or directory not found.

  • Same here. .which is kinda bad..

    Well hereby my script written in zsh.

    #!/bin/zsh

    ###
    #
    # Name: InstallLatestTeamViewerQS.sh
    # Description: Downloads and installs the latest Bol.com Teamviewer QuickSupport
    # Created: 20XX-12-17
    # Last Modified: 20XX-12-17
    # Version: 1.0
    #
    #
    # Copyright 2019 Thijs Xhaflaire - bol.com bv.
    #
    ###


    ########## variable-ing ##########

    tmpLocation="/tmp"
    appLocation="/Applications/TeamViewerQS.app"


    ########## main process ##########

    ## Touch TeamViewer QuickSupport URL to make it active

    echo "Touching TeamViewer URL"
    curl 'https://get.teamviewer.com/yourCOMPANYURL' -H 'authority: get.teamviewer.com' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'sec-fetch-site: none' -H 'sec-fetch-mode: navigate' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' --compressed

    ## Sleep a while
    echo "Sleeping 10 seconds"
    sleep 10

    ## Download latest TeamViewer QuickSupport linked to Bol.com TV tenant.
    echo "Downloading TeamViewer QS"
    curl -o $tmpLocation/TeamViewerQS.zip 'https://customdesign.teamviewer.com/download/version_15x/yourCOMPANYURL_mac/TeamViewerQS.zip' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'Sec-Fetch-Site: same-site' -H 'Sec-Fetch-Mode: navigate' -H 'Referer: https://get.teamviewer.com/yourCOMPANYURL' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' --compressed

    ## Unzip TeamViewer.zip
    #ditto -V -x -k --sequesterRsrc --rsrc /tmp/TeamViewerQS.zip /Applications
    echo "Extracting TeamViewer QS to /Applications"
    tar -xf $tmpLocation/TeamViewerQS.zip -C /Applications

    ## Wait till TeamViewer QuickSupport exists in correct location
    while [ ! -d $appLocation ] ;
    do
    echo "Waiting till Teamviewer QS exists in /Applications"
    sleep 1
    done

    ## Remove TeamViewerQS.zip
    echo "Clearing up TMP files"
    rm -f $tmpLocation/TeamViewerQS.zip

    ## Open TeamViewer QuickSupport
    #echo "Opening Teamviewer QuickSupport"
    #open -a $appLocation

    exit 0