blog.minskio.co.uk

Content and theme behind minskio.co.uk
Log | Files | Refs

unattended-installation-of-webp-codec.md (1722B)


      1 ---
      2 title: "Unattended installation of WebP codec"
      3 date: 2020-05-26T16:48:00
      4 lastmod: 2020-07-05T19:19:00
      5 tags: ["Snippets", "Software", "Windows"]
      6 ---
      7 
      8 I wrote this up many, many moons ago. I wanted a way to install Google's WebP codec on Windows in an unattended fashion to complement my [just-install](https://just-install.github.io/) script.
      9 
     10 What I eventually came up with was the following:
     11 
     12 ```
     13 rem cd to temp
     14 cd %temp%
     15 
     16 rem clean up old folders
     17 del %temp%\WebpCodecSetup.exe %temp%\7z1701.msi %temp%\.data %temp%\.rdata %temp%\.reloc %temp%\.text
     18 rd /s /q %temp%\7z1701 %temp%\.rsrc
     19 
     20 rem download installer
     21 bitsadmin /transfer installerDownload /download /priority normal https://storage.googleapis.com/downloads.webmproject.org/releases/webp/WebpCodecSetup.exe %temp%\WebpCodecSetup.exe
     22 
     23 rem download 7zip
     24 bitsadmin /transfer unpackDownload /download /priority normal http://www.7-zip.org/a/7z1701.msi %temp%\7z1701.msi
     25 
     26 rem unpack 7zip
     27 msiexec /a %temp%\7z1701.msi /qb TARGETDIR=%temp%\7z1701\
     28 
     29 rem unpack installer
     30 %temp%\7z1701\Files\7-Zip\7z.exe x %temp%\WebpCodecSetup.exe
     31 
     32 rem rename and install source msis
     33 ren %temp%\.rsrc\0\MSIFILE\10 10.msi
     34 msiexec /i %temp%\.rsrc\0\MSIFILE\10.msi /quiet /qn /norestart
     35 
     36 rem clean up used folders
     37 del %temp%\WebpCodecSetup.exe %temp%\7z1701.msi %temp%\.data %temp%\.rdata %temp%\.reloc %temp%\.text
     38 rd /s /q %temp%\7z1701 %temp%\.rsrc
     39 ```
     40 
     41 The script will download the installer, and 7zip to do the unpacking, then delete everything afterwards.
     42 
     43 Note, this will only install the 64bit install `10.msi`, if you're still working on 32bit Windows, you want to rename and install `1.msi` instead.
     44 
     45 * **Edit 2020-07-05:** Changed instructions to only install 64bit version.