Skip to content

Instantly share code, notes, and snippets.

@ar-lex
Last active July 24, 2017 20:29
Show Gist options
  • Save ar-lex/3a34f3917f02bb106d32e25fb1093bb3 to your computer and use it in GitHub Desktop.
Save ar-lex/3a34f3917f02bb106d32e25fb1093bb3 to your computer and use it in GitHub Desktop.
lightroom-setup.sh
#!/bin/bash
WPREFIX=$HOME/.wine-lightroom
LR_URL=http://download.adobe.com/pub/adobe/lightroom/win/5.x/Lightroom_5_LS11_win_5_7_1.exe
LR_SHA256=72bbe9c488bc685dc21ac0f9833276d552df231df4284740e7fb5b780ec95b3a
SRGB_URL=https://raw.githubusercontent.com/xorgy/graphicsmagick/master/profiles/sRGB%20Color%20Space%20Profile.ICM
SRGB_SHA256=2b3aa1645779a9e634744faf9b01e9102b0c9b88fd6deced7934df86b949af7e
CACHE_DIR=$HOME/.cache/Lightroom5
LR_FILE=$CACHE_DIR/$(basename $LR_URL)
SRGB_FILE=$CACHE_DIR/sRGB\ Color\ Space\ Profile.icm
download=""
[ -f "$LR_FILE" ] && echo "Checking existing installer ..." && [ $LR_SHA256 = $(sha256sum "$LR_FILE" | cut -d\ -f1) ] && download=ok
[ z$download != "zok" ] && echo "Downloading installer ..." && mkdir -p $CACHE_DIR/unpacked && wget -c $LR_URL -O "$LR_FILE"
echo "Unpacking installer ..."
LC_ALL=C WINEARCH=win32 WINEPREFIX=$WPREFIX wine "$LR_FILE" /q /a /x /s /d $CACHE_DIR/unpacked
[ $? != 0 ] && exit 1
echo "Installing Lightroom ..."
LC_ALL=C WINEPREFIX=$WPREFIX wine $CACHE_DIR/unpacked/Adobe\ Photoshop\ Lightroom\ 5/setup32.exe /s /v"/qb"
[ $? != 0 ] && exit 1
rm -rf $CACHE_DIR/unpacked/*
echo "Unset locale in desktop file ..."
sed -i -e "s/Exec=env WINEPREFIX/Exec=env LANG=C WINEPREFIX/g" $HOME/.local/share/applications/wine/Programs/Adobe\ Photoshop\ Lightroom\ 5*.desktop
echo "Installing gdiplus and corefonts ..."
WINEPREFIX=$WPREFIX winetricks -q gdiplus corefonts
echo "Disabling automatic updates ..."
echo -e "prefs = {\nnoAutomaticallyCheckUpdates = true\n}" > $WPREFIX/drive_c/users/$USER/Application\ Data/Adobe/Lightroom/Preferences/Lightroom\ 5\ Preferences.agprefs
download=""
[ -f "$SRGB_FILE" ] && echo "Checking existing sRGB color space profile ..." && [ $SRGB_SHA256 = $(sha256sum "$SRGB_FILE" | cut -d\ -f1) ] && download=ok
[ z$download != "zok" ] && echo "Downloading sRGB color space profile ..." && wget -c $SRGB_URL -O "$SRGB_FILE"
echo "Installing sRGB color space profile ..."
cp -f "$SRGB_FILE" $WPREFIX/drive_c/windows/system32/spool/drivers/color/
echo "All done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment