Skip to content

Instantly share code, notes, and snippets.

@ayanamist
Created July 1, 2025 05:23
Show Gist options
  • Select an option

  • Save ayanamist/940663c757ae63e45ab06c25ef71b58a to your computer and use it in GitHub Desktop.

Select an option

Save ayanamist/940663c757ae63e45ab06c25ef71b58a to your computer and use it in GitHub Desktop.

Revisions

  1. ayanamist created this gist Jul 1, 2025.
    19 changes: 19 additions & 0 deletions chrome-update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash
    # This script fetches the latest Google Chrome installer URL for Windows x64.

    XML_FILE=$(mktemp --suffix=.xml)

    { curl -s -d @- -o "$XML_FILE" -m 10 https://tools.google.com/service/update2 <<"EOF"
    <?xml version="1.0" encoding="UTF-8"?>
    <request protocol="3.0" updater="Omaha" updaterversion="1.3.36.372" shell_version="1.3.36.352" ismachine="0" sessionid="{11111111-1111-1111-1111-111111111111}" installsource="taggedmi" requestid="{11111111-1111-1111-1111-111111111111}" dedup="cr" domainjoined="0">
    <hw physmemory="16" sse="1" sse2="1" sse3="1" ssse3="1" sse41="1" sse42="1" avx="1"/>
    <os platform="win" version="10.0.26100.1742" arch="x64"/>
    <app version="" appid="{8A69D345-D564-463C-AFF1-A69D9E530F96}" ap="x64-stable">
    <updatecheck/>
    <data name="install" index="empty"/>
    </app>
    </request>
    EOF
    } && echo $(xmlstarlet sel -t -m "//url" -v "@codebase" -n "$XML_FILE" | grep '^https://dl.google.com/')$(xmlstarlet sel -t -m "//package" -v "@name" -n "$XML_FILE")

    rm -f "$XML_FILE"