1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00
Files
OpenRCT2/scripts/install-nsis
Margen67 3188865313 Script improvements (#14452)
shebang:
 Move parameters from set.
 Add newline after for consistency.
curl:
 Add -f;
  Prevents output on error.
 Use -O where applicable;
  -o with the same filename as the URL is pointless.
 Add -S after -s:
  Makes curl still error despite being silent.
build-symbols:
 Add zip fallback.
get-discord-rpc:
 Move git clone parameters before repository for readability.
 Use --depth 1 to speed up cloning.
install-nsis:
 Use ProgramData environment variable.
build-appimage-docker.sh:
 Add -e to docker run.
 Run script directly.
build-appimage.sh:
 Make if more consistent.
Remove unused Travis scripts.
setenv:
 unset instead of blanking variables.
vstool.cmd:
 Use ProgramFiles(x86) environment variable.
2021-04-12 19:01:15 -03:00

44 lines
1.4 KiB
Bash
Executable File

#!/bin/bash -e
if [[ "$#" -ne 0 && "$#" -ne 2 ]]; then
echo 'Install a portable version of NSIS which can build the OpenRCT2 Windows installer.'
echo ''
echo 'Usage: install-nsis [-d <destination>]'
echo ''
echo ' -d <destination> download prebuilt zip'
exit 1
fi
if [[ "$1" == "-d" ]]; then
echo -e "\033[0;36mDownloading prebuilt NSIS from GitHub...\033[0m"
curl -sSfLO "https://github.com/OpenRCT2/Dependencies/releases/download/v20/nsis.zip"
7z -bd -y "-o$2" x nsis.zip
rm nsis.zip
echo -e "\033[0;32mNSIS downloaded, add "$2/bin" to PATH\033[0m"
exit 0
fi
# Download NSIS with chocolatey and then download extra plugins
nsisdir="$ProgramData/chocolatey/lib/nsis.portable"
if [[ -d $nsisdir ]]
then
echo -e "\033[0;36mNSIS already installed.\033[0m"
exit 0
fi
echo -e "\033[0;36mDownloading NSIS from chocolatey...\033[0m"
cinst nsis.portable --version=3.01-beta1
echo -e "\033[0;36mDownloading KillProcDLL for NSIS...\033[0m"
curl -sSfLo nsisxtra.zip "http://nsis.sourceforge.net/mediawiki/images/5/53/KillProcDll%26FindProcDll.zip"
7z x nsisxtra.zip
cp FindProcDLL.dll "$nsisdir/tools/nsis-3.0b1/Plugins/x86-ansi"
echo -e "\033[0;36mDownloading UAC plugin for NSIS...\033[0m"
curl -sSfLO "http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip"
7z x UAC.zip
cp UAC.nsh "$nsisdir/tools/nsis-3.0b1/Include"
cp -r Plugins "$nsisdir/tools/nsis-3.0b1"
echo -e "\033[0;32mNSIS installed!\033[0m"