This is an automated email from the git hooks/post-receive script.
boklm pushed a commit to branch master in repository builders/tor-browser-build.
commit a61134f3c64734f6b8f8243ba5cb85eb79c3c55c Author: Nicolas Vigier boklm@torproject.org AuthorDate: Tue Jun 14 16:49:52 2022 +0200
Bug 40500: Update projects/browser for base-browser --- projects/browser/RelativeLink/execdesktop | 2 +- .../{start-tor-browser => start-browser} | 86 ++++----- .../browser/RelativeLink/start-browser.desktop | 34 ++++ .../browser/RelativeLink/start-tor-browser.desktop | 34 ---- projects/browser/build | 199 ++++++++++++--------- projects/browser/build.android | 4 +- projects/browser/config | 26 +-- projects/browser/pe_checksum_fix.py | 4 +- projects/browser/windows-installer/basebrowser.ico | Bin 0 -> 23934 bytes projects/browser/windows-installer/basebrowser.nsi | 185 +++++++++++++++++++ 10 files changed, 395 insertions(+), 179 deletions(-)
diff --git a/projects/browser/RelativeLink/execdesktop b/projects/browser/RelativeLink/execdesktop index fa6dc0a..5e3e65e 100755 --- a/projects/browser/RelativeLink/execdesktop +++ b/projects/browser/RelativeLink/execdesktop @@ -1,6 +1,6 @@ #!/usr/bin/env bash
-TBB_START_PROG="$(grep '^X-TorBrowser-ExecShell' $1 | tail -1 | sed 's/^X-TorBrowser-ExecShell=//' | sed 's/%.//')" +TBB_START_PROG="$(grep '^X-[% c("var/ProjectName") %]-ExecShell' $1 | tail -1 | sed 's/^X-[% c("var/ProjectName") %]-ExecShell=//' | sed 's/%.//')"
shift
diff --git a/projects/browser/RelativeLink/start-tor-browser b/projects/browser/RelativeLink/start-browser similarity index 72% rename from projects/browser/RelativeLink/start-tor-browser rename to projects/browser/RelativeLink/start-browser index 8f0764c..b7b96d2 100755 --- a/projects/browser/RelativeLink/start-tor-browser +++ b/projects/browser/RelativeLink/start-browser @@ -5,11 +5,11 @@ # # Copyright 2017 The Tor Project. See LICENSE for licensing information.
-complain_dialog_title="Tor Browser" +complain_dialog_title="[% c('var/Project_Name') %]"
-# Make sure this script wasn't started as 'sh start-tor-browser' or similar. +# Make sure this script wasn't started as 'sh start-[% c('var/project-name') %]' or similar. if [ "x$BASH" = "x" ]; then - echo "$complain_dialog_title should be started as './start-tor-browser'" + echo "$complain_dialog_title should be started as './start-[% c('var/project-name') %]'" echo "Exiting." >&2 exit 1; fi @@ -83,22 +83,22 @@ complain () { }
if [ "`id -u`" -eq 0 ]; then - complain "The Tor Browser Bundle should not be run as root. Exiting." + complain "The [% c('var/Project_Name') %] should not be run as root. Exiting." exit 1 fi
if test -r /proc/cpuinfo && ! grep -q '^flags\s*:.* sse2' /proc/cpuinfo; then - complain "Tor Browser requires a CPU with SSE2 support. Exiting." + complain "[% c('var/Project_Name') %] requires a CPU with SSE2 support. Exiting." exit 1 fi
tbb_usage () { - printf "\nTor Browser Script Options\n" + printf "\n[% c('var/Project_Name') %] Script Options\n" printf " --verbose Display Tor and Firefox output in the terminal\n" - printf " --log [file] Record Tor and Firefox output in file (default: tor-browser.log)\n" - printf " --detach Detach from terminal and run Tor Browser in the background.\n" - printf " --register-app Register Tor Browser as a desktop app for this user\n" - printf " --unregister-app Unregister Tor Browser as a desktop app for this user\n" + printf " --log [file] Record Tor and Firefox output in file (default: [% c('var/project-name') %].log)\n" + printf " --detach Detach from terminal and run [% c('var/Project_Name') %] in the background.\n" + printf " --register-app Register [% c('var/Project_Name') %] as a desktop app for this user\n" + printf " --unregister-app Unregister [% c('var/Project_Name') %] as a desktop app for this user\n" } log_output=0 show_output=0 @@ -125,14 +125,14 @@ do ;; -l | --log) if [ -z "$2" -o "${2:0:1}" == "-" ]; then - printf "Logging Tor Browser debug information to tor-browser.log\n" - logfile="../tor-browser.log" + printf "Logging [% c('var/Project_Name') %] debug information to [% c('var/project-name') %].log\n" + logfile="../[% c('var/project-name') %].log" elif [ "${2:0:1}" == "/" -o "${2:0:1}" == "~" ]; then - printf "Logging Tor Browser debug information to %s\n" "$2" + printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2" logfile="$2" shift else - printf "Logging Tor Browser debug information to %s\n" "$2" + printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2" logfile="../$2" shift fi @@ -203,7 +203,7 @@ if [ -L "$myname" ]; then myname="`readlink -f "$myname" 2>/dev/null`" if [ "$?" -ne 0 ]; then # Ugh. - complain "start-tor-browser cannot be run using a symlink on this operating system." + complain "start-[% c('var/project-name') %] cannot be run using a symlink on this operating system." fi fi fi @@ -229,26 +229,26 @@ fi
# Fix up .desktop Icon and Exec Paths, and update the .desktop file from the # canonical version if it was changed by the updater. -cp start-tor-browser.desktop ../ -sed -i -e "s,^Name=.*,Name=Tor Browser,g" ../start-tor-browser.desktop -sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" ../start-tor-browser.desktop -sed -i -e "s,^Exec=.*,Exec=sh -c '"$PWD/start-tor-browser" --detach || ([ ! -x "$PWD/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k,g" ../start-tor-browser.desktop +cp start-[% c('var/project-name') %].desktop ../ +sed -i -e "s,^Name=.*,Name=[% c('var/Project_Name') %],g" ../start-[% c('var/project-name') %].desktop +sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" ../start-[% c('var/project-name') %].desktop +sed -i -e "s,^Exec=.*,Exec=sh -c '"$PWD/start-[% c('var/project-name') %]" --detach || ([ ! -x "$PWD/start-[% c('var/project-name') %]" ] && "$(dirname "$*")"/Browser/start-[% c('var/project-name') %] --detach)' dummy %k,g" ../start-[% c('var/project-name') %].desktop
if [ "$register_desktop_app" -eq 1 ]; then mkdir -p "$HOME/.local/share/applications/" - cp ../start-tor-browser.desktop "$HOME/.local/share/applications/" + cp ../start-[% c('var/project-name') %].desktop "$HOME/.local/share/applications/" update-desktop-database "$HOME/.local/share/applications/" - printf "Tor Browser has been registered as a desktop app for this user in ~/.local/share/applications/\n" + printf "[% c('var/Project_Name') %] has been registered as a desktop app for this user in ~/.local/share/applications/\n" exit 0 fi
if [ "$register_desktop_app" -eq -1 ]; then - if [ -e "$HOME/.local/share/applications/start-tor-browser.desktop" ]; then - rm -f "$HOME/.local/share/applications/start-tor-browser.desktop" + if [ -e "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop" ]; then + rm -f "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop" update-desktop-database "$HOME/.local/share/applications/" - printf "Tor Browser has been removed as a user desktop app (from ~/.local/share/applications/)\n" + printf "[% c('var/Project_Name') %] has been removed as a user desktop app (from ~/.local/share/applications/)\n" else - printf "Tor Browser does not appear to be a desktop app (not present in ~/.local/share/applications/)\n" + printf "[% c('var/Project_Name') %] does not appear to be a desktop app (not present in ~/.local/share/applications/)\n" fi exit 0 fi @@ -256,6 +256,7 @@ fi HOME="${PWD}" export HOME
+[% IF c("var/tor-browser") -%] SYSARCHITECTURE=$(getconf LONG_BIT) TORARCHITECTURE=$(expr "$(file TorBrowser/Tor/tor)" : '.*ELF ([[:digit:]]*)')
@@ -263,6 +264,7 @@ if [ $SYSARCHITECTURE -ne $TORARCHITECTURE ]; then complain "Wrong architecture? 32-bit vs. 64-bit." exit 1 fi +[% END -%]
[% IF c("var/asan") -%] # We need to disable LSan which is enabled by default now. Otherwise we'll get @@ -271,6 +273,7 @@ ASAN_OPTIONS="detect_leaks=0" export ASAN_OPTIONS [% END -%]
+[% IF c("var/tor-browser") -%] function setControlPortPasswd() { local ctrlPasswd=$1
@@ -332,9 +335,10 @@ TOR_CONTROL_PASSWD environment variable." # Either set `TOR_CONTROL_PASSWD` before running ./start-tor-browser, or put # your password in the following line where the word “secret” is: setControlPortPasswd ${TOR_CONTROL_PASSWD:='"secret"'} +[% END -%]
# Set up custom bundled fonts. See fonts-conf(5). -export FONTCONFIG_PATH="${HOME}/TorBrowser/Data/fontconfig" +export FONTCONFIG_PATH="${HOME}/[% c('var/ProjectName') %]/Data/fontconfig" export FONTCONFIG_FILE="fonts.conf"
# Avoid overwriting user's dconf values. Fixes #27903. @@ -352,28 +356,28 @@ cd "${HOME}"
if [ "$show_usage" -eq 1 ]; then # Display Firefox help, then our help - TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox \ - --class "Tor Browser" --name "Tor Browser" \ - -profile TorBrowser/Data/Browser/profile.default --help 2>/dev/null + [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./firefox \ + --class "[% c('var/Project_Name') %]" --name "[% c('var/Project_Name') %]" \ + -profile [% c('var/ProjectName') %]/Data/Browser/profile.default --help 2>/dev/null tbb_usage elif [ "$detach" -eq 1 ] ; then - TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox \ - --class "Tor Browser" --name "Tor Browser" \ - -profile TorBrowser/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null & + [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./firefox \ + --class "[% c('var/Project_Name') %]" --name "[% c('var/Project_Name') %]" \ + -profile [% c('var/ProjectName') %]/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null & disown "$!" elif [ "$log_output" -eq 1 -a "$show_output" -eq 1 ]; then - TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox \ - --class "Tor Browser" --name "Tor Browser" \ - -profile TorBrowser/Data/Browser/profile.default "${@}" 2>&1 </dev/null | \ + [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./firefox \ + --class "[% c('var/Project_Name') %]" --name "[% c('var/Project_Name') %]" \ + -profile [% c('var/ProjectName') %]/Data/Browser/profile.default "${@}" 2>&1 </dev/null | \ tee "$logfile" elif [ "$show_output" -eq 1 ]; then - TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox \ - --class "Tor Browser" --name "Tor Browser" \ - -profile TorBrowser/Data/Browser/profile.default "${@}" < /dev/null + [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./firefox \ + --class "[% c('var/Project_Name') %]" --name "[% c('var/Project_Name') %]" \ + -profile [% c('var/ProjectName') %]/Data/Browser/profile.default "${@}" < /dev/null else - TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox \ - --class "Tor Browser" --name "Tor Browser" \ - -profile TorBrowser/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null + [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./firefox \ + --class "[% c('var/Project_Name') %]" --name "[% c('var/Project_Name') %]" \ + -profile [% c('var/ProjectName') %]/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null fi
exit $? diff --git a/projects/browser/RelativeLink/start-browser.desktop b/projects/browser/RelativeLink/start-browser.desktop new file mode 100755 index 0000000..68f0075 --- /dev/null +++ b/projects/browser/RelativeLink/start-browser.desktop @@ -0,0 +1,34 @@ +#!/usr/bin/env ./Browser/execdesktop +# +# This file is a self-modifying .desktop file that can be run from the shell. +# It preserves arguments and environment for the start-[% c("var/project-name") %] script. +# +# Run './start-[% c("var/project-name") %].desktop --help' to display the full set of options. +# +# When invoked from the shell, this file must always be in a [% c("var/Project_Name") %] root +# directory. When run from the file manager or desktop GUI, it is relocatable. +# +# After first invocation, it will update itself with the absolute path to the +# current [% c("var/Project_Name") %] location, to support relocation of this .desktop file for GUI +# invocation. You can also add [% c("var/Project_Name") %] to your desktop's application menu +# by running './start-[% c("var/project-name") %].desktop --register-app' +# +# If you use --register-app, and then relocate your [% c("var/Project_Name") %] directory, [% c("var/Project_Name") %] +# will no longer launch from your desktop's app launcher/dock. However, if you +# re-run --register-app from inside that new directory, the script +# will correct the absolute paths and re-register itself. +# +# This file will also still function if the path changes when [% c("var/Project_Name") %] is used as a +# portable app, so long as it is run directly from that new directory, either +# via the shell or via the file manager. + +[Desktop Entry] +Type=Application +Name=[% c("var/Project_Name") %] Setup +GenericName=Web Browser +Comment=[% c("var/Project_Name") %] is +1 for privacy and −1 for mass surveillance +Categories=Network;WebBrowser;Security; +Exec=sh -c '"$(dirname "$*")"/Browser/start-[% c("var/project-name") %] --detach || ([ ! -x "$(dirname "$*")"/Browser/start-[% c("var/project-name") %] ] && "$(dirname "$*")"/start-[% c("var/project-name") %] --detach)' dummy %k +X-[% c("var/ProjectName") %]-ExecShell=./Browser/start-[% c("var/project-name") %] --detach +Icon=web-browser +StartupWMClass=[% c("var/Project_Name") %] diff --git a/projects/browser/RelativeLink/start-tor-browser.desktop b/projects/browser/RelativeLink/start-tor-browser.desktop deleted file mode 100755 index c02a59f..0000000 --- a/projects/browser/RelativeLink/start-tor-browser.desktop +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env ./Browser/execdesktop -# -# This file is a self-modifying .desktop file that can be run from the shell. -# It preserves arguments and environment for the start-tor-browser script. -# -# Run './start-tor-browser.desktop --help' to display the full set of options. -# -# When invoked from the shell, this file must always be in a Tor Browser root -# directory. When run from the file manager or desktop GUI, it is relocatable. -# -# After first invocation, it will update itself with the absolute path to the -# current TBB location, to support relocation of this .desktop file for GUI -# invocation. You can also add Tor Browser to your desktop's application menu -# by running './start-tor-browser.desktop --register-app' -# -# If you use --register-app, and then relocate your TBB directory, Tor Browser -# will no longer launch from your desktop's app launcher/dock. However, if you -# re-run --register-app from inside that new directory, the script -# will correct the absolute paths and re-register itself. -# -# This file will also still function if the path changes when TBB is used as a -# portable app, so long as it is run directly from that new directory, either -# via the shell or via the file manager. - -[Desktop Entry] -Type=Application -Name=Tor Browser Setup -GenericName=Web Browser -Comment=Tor Browser is +1 for privacy and −1 for mass surveillance -Categories=Network;WebBrowser;Security; -Exec=sh -c '"$(dirname "$*")"/Browser/start-tor-browser --detach || ([ ! -x "$(dirname "$*")"/Browser/start-tor-browser ] && "$(dirname "$*")"/start-tor-browser --detach)' dummy %k -X-TorBrowser-ExecShell=./Browser/start-tor-browser --detach -Icon=web-browser -StartupWMClass=Tor Browser diff --git a/projects/browser/build b/projects/browser/build index 750883c..9c7e4a0 100644 --- a/projects/browser/build +++ b/projects/browser/build @@ -20,9 +20,9 @@ GENERATEDPREFSPATH=$rootdir/Bundle-Data/PTConfigs/generated-prefs.js touch "$GENERATEDPREFSPATH"
[% IF c("var/osx") %] - TBDIR="$TB_STAGE_DIR/Tor Browser.app" + TBDIR="$TB_STAGE_DIR/[% c("var/Project_Name") %].app"
- DOCSPATH=Contents/Resources/TorBrowser/Docs + DOCSPATH=Contents/Resources/[% c('var/ProjectName') %]/Docs EXTSPATH=Contents/Resources/distribution/extensions TORBINPATH=Contents/MacOS/Tor TORCONFIGPATH=Contents/Resources/TorBrowser/Tor @@ -32,11 +32,11 @@ touch "$GENERATEDPREFSPATH" [% ELSE %] TBDIR=$TB_STAGE_DIR/Browser
- DOCSPATH=TorBrowser/Docs - EXTSPATH=TorBrowser/Data/Browser/profile.default/extensions + DOCSPATH=[% c('var/ProjectName') %]/Docs + EXTSPATH=[% c('var/ProjectName') %]/Data/Browser/profile.default/extensions TORCONFIGPATH=TorBrowser/Data/Tor
- mkdir -p "$TBDIR/TorBrowser/Data/Browser/Caches" + mkdir -p "$TBDIR/[% c('var/ProjectName') %]/Data/Browser/Caches" [% END %]
mkdir -p "$TBDIR/$EXTSPATH" @@ -47,42 +47,57 @@ MARTOOLS=$rootdir/mar-tools
mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
-tar -C "$TBDIR" -xf [% c('input_files_by_name/obfs4') %] -tar -C "$TBDIR" -xf [% c('input_files_by_name/snowflake') -%] +[% IF c("var/tor-browser") -%] + tar -C "$TBDIR" -xf [% c('input_files_by_name/obfs4') %] + tar -C "$TBDIR" -xf [% c('input_files_by_name/snowflake') -%] +[% END -%]
tar -C "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]" -xf [% c('input_files_by_name/fonts') %]
[% IF c("var/linux") %] - cp RelativeLink/* ${TB_STAGE_DIR}/Browser/ - cp RelativeLink/start-tor-browser.desktop ${TB_STAGE_DIR}/ - cat > ${TB_STAGE_DIR}/Browser/start-tor-browser << 'RBM_TB_EOF' -[% INCLUDE 'RelativeLink/start-tor-browser' -%] + cat > ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop << 'RBM_TB_EOF' +[% INCLUDE 'RelativeLink/start-browser.desktop' -%] +RBM_TB_EOF + cat > ${TB_STAGE_DIR}/Browser/start-[% c("var/project-name") %] << 'RBM_TB_EOF' +[% INCLUDE 'RelativeLink/start-browser' -%] RBM_TB_EOF + cat > ${TB_STAGE_DIR}/Browser/execdesktop << 'RBM_TB_EOF' +[% INCLUDE 'RelativeLink/execdesktop' -%] +RBM_TB_EOF + chmod +x ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop \ + ${TB_STAGE_DIR}/Browser/start-[% c("var/project-name") %] \ + ${TB_STAGE_DIR}/Browser/execdesktop + cp ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop \ + ${TB_STAGE_DIR}/Browser [% IF c("var/namecoin") %] pushd ${TB_STAGE_DIR}/Browser/ patch -p1 < $rootdir/namecoin.patch popd [% END %] - chmod +x ${TB_STAGE_DIR}/Browser/start-tor-browser # Make sure we get the desired scrollbar behavior with Gtk3, see bug 27546. GTK_SETTINGS_DIR=${TB_STAGE_DIR}/Browser/.config/gtk-3.0 mkdir -p $GTK_SETTINGS_DIR cp $rootdir/gtk3-settings.ini $GTK_SETTINGS_DIR/settings.ini [% END %]
-tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/tor-browser.tar.gz +tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.gz
-# Include the Tor Browser manual -TMP_MANUAL_PATH=$rootdir/tmp_manual/ -mkdir $TMP_MANUAL_PATH -pushd $TMP_MANUAL_PATH -tar -xf $rootdir/[% c('input_files_by_name/manual') %] -find . -exec [% c("touch") %] {} ; -find chrome/ | sort | zip -X -@ "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]/browser/omni.ja" -popd -rm -rf $TMP_MANUAL_PATH +[% IF c("var/tor-browser") -%] + # Include the Tor Browser manual + TMP_MANUAL_PATH=$rootdir/tmp_manual/ + mkdir $TMP_MANUAL_PATH + pushd $TMP_MANUAL_PATH + tar -xf $rootdir/[% c('input_files_by_name/manual') %] + find . -exec [% c("touch") %] {} ; + find chrome/ | sort | zip -X -@ "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]/browser/omni.ja" + popd + rm -rf $TMP_MANUAL_PATH +[% END -%] + +[% IF c("var/tor-browser") -%] + tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -xf [% c('input_files_by_name/tor') %]/tor.tar.gz +[% END -%]
-tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -xf [% c('input_files_by_name/tor') %]/tor.tar.gz [% IF c("var/namecoin") %] # Extract Electrum-NMC tar -C "$TBDIR/TorBrowser" -xf [% c('input_files_by_name/electrum-nmc') %] @@ -112,48 +127,56 @@ tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -xf [% c('input_files mkdir -p $SKELETON_TMP_RESOURCES/browser echo "[XRE]" > $SKELETON_TMP_RESOURCES/browser/override.ini echo "EnableProfileMigrator=0" >> $SKELETON_TMP_RESOURCES/browser/override.ini - mkdir -p $SKELETON_TMP_RESOURCES/TorBrowser/Tor - cp -p Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults $SKELETON_TMP_RESOURCES/TorBrowser/Tor/ + [% IF c("var/tor-browser") -%] + mkdir -p $SKELETON_TMP_RESOURCES/TorBrowser/Tor + cp -p Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults $SKELETON_TMP_RESOURCES/TorBrowser/Tor/ + [% END -%] # Place a copy of the bookmarks.html file at the top. It will be moved into # browser/omni.ja later cp -p Bundle-Data/mac/TorBrowser/Data/Browser/profile.default/bookmarks.html $rootdir rm -Rf Bundle-Data/mac mv $SKELETON_TMP Bundle-Data/mac
- # Install a "tor" shim that sets the working directory. See #10030. - mv "$TBDIR/$TORBINPATH/tor" "$TBDIR/$TORBINPATH/tor.real" - cp Bundle-Data/mac-tor.sh "$TBDIR/$TORCONFIGPATH/tor" + [% IF c("var/tor-browser") -%] + # Install a "tor" shim that sets the working directory. See #10030. + mv "$TBDIR/$TORBINPATH/tor" "$TBDIR/$TORBINPATH/tor.real" + cp Bundle-Data/mac-tor.sh "$TBDIR/$TORCONFIGPATH/tor" + [% END -%]
tar -C Bundle-Data/mac-applications.dmg -c . | tar -C $TB_STAGE_DIR -x [% END %]
mkdir -p "$TBDIR/$DOCSPATH" cp -a Bundle-Data/Docs/* "$TBDIR/$DOCSPATH" -tar -C Bundle-Data/[% bundledata_osname %] [% IF ! c("var/namecoin") %]--exclude=*Electrum-NMC* --exclude=*ncprop279*[% END %] -c . | tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -x - -cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$TBDIR/$TORCONFIGPATH/torrc-defaults" -cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH" - -function bridges_conf { - local pt="$1" - local i=1 - while read -r line - do - echo "pref("extensions.torlauncher.default_bridge.$pt.$i", "$line");" >> "$GENERATEDPREFSPATH" - i=$((i + 1)) - done < "$rootdir/bridges_list.$pt.txt" -} -bridges_conf obfs4 -bridges_conf meek-azure -bridges_conf snowflake +tar -C Bundle-Data/[% bundledata_osname %] [% IF ! c("var/namecoin") %]--exclude=*Electrum-NMC* --exclude=*ncprop279*[% END %] -c . | tar -C "$TBDIR[% IF ! c("var/osx") %]/[% c('var/ProjectName') %][% END %]" -x + +[% IF c("var/tor-browser") -%] + cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$TBDIR/$TORCONFIGPATH/torrc-defaults" + cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH" + + function bridges_conf { + local pt="$1" + local i=1 + while read -r line + do + echo "pref("extensions.torlauncher.default_bridge.$pt.$i", "$line");" >> "$GENERATEDPREFSPATH" + i=$((i + 1)) + done < "$rootdir/bridges_list.$pt.txt" + } + bridges_conf obfs4 + bridges_conf meek-azure + bridges_conf snowflake +[% END -%]
-[% IF ! c("var/multi_lingual") %] +[% IF ! c("var/multi_lingual") && c("var/tor-browser") %] echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH" [% END %]
[% IF c("var/linux") %] - chmod 700 ${TB_STAGE_DIR}/Browser/TorBrowser/Data/Browser - chmod 700 ${TB_STAGE_DIR}/Browser/TorBrowser/Data/Tor + chmod 700 ${TB_STAGE_DIR}/Browser/[% c('var/ProjectName') %]/Data/Browser + [% IF c("var/tor-browser") -%] + chmod 700 ${TB_STAGE_DIR}/Browser/TorBrowser/Data/Tor + [% END -%] [% END %]
[% IF c("var/multi_lingual") %] @@ -162,18 +185,18 @@ bridges_conf snowflake # of the directory that is inside the package (in other words, users will # not see tor-browser_ALL after they install Tor Browser). PKG_LOCALE="ALL" - PKG_DIR="tor-browser" + PKG_DIR='[% c("var/project-name") %]' [% ELSE %] PKG_LOCALE="en-US" - PKG_DIR="tor-browser_${PKG_LOCALE}" + PKG_DIR="[% c('var/project-name') %]_${PKG_LOCALE}" [% END %]
pushd "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]/browser/" -unzip omni.ja defaults/preferences/000-tor-browser.js || [ $? -lt 3 ] +unzip omni.ja defaults/preferences/[% c("var/prefs_file") %] || [ $? -lt 3 ] # Append our built extension-overrides.js to 000-tor-browser.js -cat "$GENERATEDPREFSPATH" >> defaults/preferences/000-tor-browser.js -cp defaults/preferences/000-tor-browser.js $rootdir +cat "$GENERATEDPREFSPATH" >> defaults/preferences/[% c("var/prefs_file") %] +cp defaults/preferences/[% c("var/prefs_file") %] $rootdir [% IF c("var/osx") %] # Embed our default bookmarks within the en-US locale. mkdir -p chrome/en-US/locale/browser @@ -184,9 +207,9 @@ cp defaults/preferences/000-tor-browser.js $rootdir rm -rf chrome [% END %] # Set the locale of the bundle. -echo "pref("intl.locale.requested", "en-US");" >> defaults/preferences/000-tor-browser.js -[% c("touch") %] defaults/preferences/000-tor-browser.js -zip -Xm omni.ja defaults/preferences/000-tor-browser.js +echo "pref("intl.locale.requested", "en-US");" >> defaults/preferences/[% c("var/prefs_file") %] +[% c("touch") %] defaults/preferences/[% c("var/prefs_file") %] +zip -Xm omni.ja defaults/preferences/[% c("var/prefs_file") %] rm -rf defaults # create tbb_version.json file for #25020 echo '{"version":"[% c("var/torbrowser_version") %]","architecture":"[% c("var/mar_osname") %]","channel":"[% c("var/channel") %]","locale":"en-US"}' > ../tbb_version.json @@ -235,14 +258,14 @@ popd export PATH="/var/tmp/dist/nsis/bin:$PATH"
mv $rootdir/windows-installer $distdir/windows-installer - mv ${TB_STAGE_DIR} $distdir/windows-installer/"Tor Browser" + mv ${TB_STAGE_DIR} $distdir/windows-installer/"[% c('var/Project_Name') %]" mv $distdir/windows-installer ${TB_STAGE_DIR} [% END %]
[% IF c("var/windows") %] - TBDIR="$distdir/$PKG_DIR/Tor Browser/Browser" + TBDIR="$distdir/$PKG_DIR/[% c("var/Project_Name") %]/Browser" [% ELSIF c("var/osx") %] - TBDIR="$distdir/$PKG_DIR/Tor Browser.app" + TBDIR="$distdir/$PKG_DIR/[% c("var/Project_Name") %].app" [% ELSE %] TBDIR="$distdir/$PKG_DIR/Browser" [% END %] @@ -261,7 +284,7 @@ cd $distdir
[% IF c("var/build_mar") -%] # Create full MAR file and compressed package. - [% SET mar_file = 'tor-browser-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.mar' %] + [% SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.mar' %] MAR=$MARTOOLS/mar \ MOZ_PRODUCT_VERSION=[% c("var/torbrowser_version") %] \ MAR_CHANNEL_ID=torbrowser-torproject-[% c("var/channel") %] \ @@ -271,23 +294,23 @@ cd $distdir [% IF c("var/linux") %] [% c('tar', { tar_src => [ '$PKG_DIR' ], - tar_args => '-cJf $OUTDIR/tor-browser-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.tar.xz', + tar_args => '-cJf $OUTDIR/' _ c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.tar.xz', }) %] [% ELSIF c("var/osx") %] [% c('var/ddmg', { dmg_src => '"$PKG_DIR"', - dmg_out => '$OUTDIR/TorBrowser-' _ c("var/torbrowser_version") _ '-osx64_${PKG_LOCALE}.dmg', + dmg_out => '$OUTDIR/' _ c('var/ProjectName') _ '-' _ c("var/torbrowser_version") _ '-osx64_${PKG_LOCALE}.dmg', }) %] [% ELSIF c("var/windows") %] find "$PKG_DIR" -exec [% c("touch") %] {} ; pushd "$PKG_DIR" - makensis torbrowser.nsi + makensis [% c("var/projectname") %].nsi # Working around NSIS braindamage - mv torbrowser-install.exe torbrowser-install-tmp.exe + mv [% c("var/projectname") %]-install.exe browser-install-tmp.exe python3 $rootdir/pe_checksum_fix.py - mv torbrowser-install-tmp2.exe torbrowser-install.exe - rm torbrowser-install-tmp.exe - mv torbrowser-install.exe $OUTDIR/torbrowser-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_${PKG_LOCALE}.exe + mv browser-install-tmp2.exe [% c("var/projectname") %]-install.exe + rm browser-install-tmp.exe + mv [% c("var/projectname") %]-install.exe $OUTDIR/[% c("var/projectname") %]-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_${PKG_LOCALE}.exe popd [% END %] rm -rf $distdir/${PKG_DIR} @@ -295,12 +318,14 @@ SCRIPT_EOF
cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ [% IF c("var/linux-x86_64") -%] - cp $rootdir/[% c('input_files_by_name/firefox') %]/tor-browser-debug.tar.xz "$OUTDIR"/tor-browser-[% c("var/mar_osname") %]-debug.tar.xz + [% IF c("var/tor-browser") -%] + cp $rootdir/[% c('input_files_by_name/firefox') %]/browser-debug.tar.xz "$OUTDIR"/[% c("var/project-name") %]-[% c("var/mar_osname") %]-debug.tar.xz + [% END -%] [% IF !c("var/asan") -%] cp $rootdir/[% c('input_files_by_name/firefox') %]/geckodriver-linux64.tar.xz "$OUTDIR"/ [% END -%] [% END -%] -[% IF c("var/linux") -%] +[% IF c("var/linux") && c("var/tor-browser") -%] cp $rootdir/[% c('input_files_by_name/tor') %]/tor-debug.tar.xz "$OUTDIR"/tor-[% c("var/mar_osname") %]-debug.tar.xz [% END -%] [% IF c("var/build_infos_json") -%] @@ -308,7 +333,7 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ [% END -%]
# Create a tarball with all Linux x86_64 language packs (Bug 32676) -[% IF c("var/linux-x86_64") && ! c("var/multi_lingual") && ! c("var/testbuild") -%] +[% IF c("var/tor-browser") && c("var/linux-x86_64") && ! c("var/multi_lingual") && ! c("var/testbuild") -%] pushd $rootdir/[% c('input_files_by_name/firefox-langpacks') %] [% c('tar', { tar_src => [ '.' ], @@ -325,12 +350,12 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ [% FOREACH lang = locales %] [% SET lang = tmpl(lang); SET xpi = '$rootdir/' _ c('input_files_by_name/firefox-langpacks') _ '/' _ lang _ '.xpi'; - SET tbdir = '$distdir/tor-browser_' _ lang; - SET mar_file = 'tor-browser-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.mar'; + SET tbdir = '$distdir/' _ c("var/project-name") _ '_' _ lang; + SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.mar'; IF c("var/osx"); - SET browserdir = tbdir _ '/Tor Browser.app'; + SET browserdir = tbdir _ '/' _ c("var/Project_Name") _ '.app'; ELSIF c("var/windows"); - SET browserdir = tbdir _ '/Tor Browser/Browser'; + SET browserdir = tbdir _ '/' _ c("var/Project_Name") _ '/Browser'; ELSE; SET browserdir = tbdir _ '/Browser'; END; @@ -346,7 +371,7 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ END; END; %] - cat > "$scripts_dir/create-tor-browser_[% lang %]" << SCRIPT_EOF + cat > "$scripts_dir/create-browser_[% lang %]" << SCRIPT_EOF #!/bin/bash set -e cp -a ${TB_STAGE_DIR} [% tbdir %] @@ -354,11 +379,11 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
pushd "[% browserdir %]/[% IF c("var/osx") %]Contents/Resources/[% END %]browser/" mkdir -p defaults/preferences - cp $rootdir/000-tor-browser.js defaults/preferences/ + cp $rootdir/[% c("var/prefs_file") %] defaults/preferences/ # Set the locale of the bundle. - echo "pref("intl.locale.requested", "[% lang %]");" >> defaults/preferences/000-tor-browser.js - [% c("touch") %] defaults/preferences/000-tor-browser.js - zip -Xm omni.ja defaults/preferences/000-tor-browser.js + echo "pref("intl.locale.requested", "[% lang %]");" >> defaults/preferences/[% c("var/prefs_file") %] + [% c("touch") %] defaults/preferences/[% c("var/prefs_file") %] + zip -Xm omni.ja defaults/preferences/[% c("var/prefs_file") %] rm -rf defaults # create tbb_version.json file for #25020 echo '{"version":"[% c("var/torbrowser_version") %]","architecture":"[% c("var/mar_osname") %]","channel":"[% c("var/channel") %]","locale":"[% lang %]"}' > ../tbb_version.json @@ -387,10 +412,10 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ [% END -%]
[% IF c("var/linux") %] - [% SET tardir = 'tor-browser_' _ lang; + [% SET tardir = c("var/project-name") _ '_' _ lang; c('tar', { tar_src => [ tardir ], - tar_args => '-cJf $OUTDIR/tor-browser-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.tar.xz', + tar_args => '-cJf $OUTDIR/' _ c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_' _ lang _ '.tar.xz', }) %] [% ELSIF c("var/osx") %] [% # Rename the Japanese bundle to not confuse users @@ -399,18 +424,18 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/ END; -%] [% c('var/ddmg', { dmg_src => tbdir, - dmg_out => '$OUTDIR/TorBrowser-' _ c("var/torbrowser_version") _ '-osx64_' _ lang _ '.dmg', + dmg_out => '$OUTDIR/' _ c('var/ProjectName') _ '-' _ c("var/torbrowser_version") _ '-osx64_' _ lang _ '.dmg', }) %] [% ELSIF c("var/windows") %] find "[% tbdir %]" -exec [% c("touch") %] {} ; pushd "[% tbdir %]" - makensis torbrowser.nsi + makensis [% c("var/projectname") %].nsi # Working around NSIS braindamage - mv torbrowser-install.exe torbrowser-install-tmp.exe + mv [% c("var/projectname") %]-install.exe browser-install-tmp.exe python3 $rootdir/pe_checksum_fix.py - mv torbrowser-install-tmp2.exe torbrowser-install.exe - rm torbrowser-install-tmp.exe - mv torbrowser-install.exe $OUTDIR/torbrowser-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_[% lang %].exe + mv browser-install-tmp2.exe [% c("var/projectname") %]-install.exe + rm browser-install-tmp.exe + mv [% c("var/projectname") %]-install.exe $OUTDIR/[% c("var/projectname") %]-install[% IF c("var/windows-x86_64") %]-win64[% END %]-[% c("var/torbrowser_version") %]_[% lang %].exe popd [% END %] rm -rf [% tbdir %] diff --git a/projects/browser/build.android b/projects/browser/build.android index 2e1b11f..589d117 100644 --- a/projects/browser/build.android +++ b/projects/browser/build.android @@ -3,9 +3,9 @@ [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %] assets_dir=assets ext_dir=$assets_dir/extensions -qa_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk +qa_apk=[% dest_dir %]/[% c('filename') %]/[% c("var/project-name") %]-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk apk=$rootdir/fenix/app-[% c("var/abi") %]-*.apk -test_out_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-androidTest.apk +test_out_apk=[% dest_dir %]/[% c('filename') %]/[% c("var/project-name") %]-[% c("version") %]-[% c("var/osname") %]-androidTest.apk test_in_apk=$rootdir/fenix/app-*-androidTest.apk
tar xavf $rootdir/[% c('input_files_by_name/fenix') %] diff --git a/projects/browser/config b/projects/browser/config index 31e2cc1..ae820f8 100644 --- a/projects/browser/config +++ b/projects/browser/config @@ -1,6 +1,6 @@ # vim: filetype=yaml sw=2 version: '[% c("var/torbrowser_version") %]' -filename: 'tor-browser-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]' +filename: '[% c("var/project-name") %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]' container: use_container: 1
@@ -46,6 +46,12 @@ targets: build: '[% INCLUDE build.android %]' var: verify_allowed_addons: 1 + torbrowser: + var: + prefs_file: 000-tor-browser.js + basebrowser: + var: + prefs_file: 001-base-profile.js
input_files: - project: container-image @@ -59,7 +65,7 @@ input_files: enable: '[% c("var/android") %]' - project: tor name: tor - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - project: firefox-langpacks name: firefox-langpacks enable: '[% ! c("var/testbuild") && ! c("var/android") %]' @@ -71,19 +77,15 @@ input_files: enable: '[% ! c("var/android") %]' - project: obfs4 name: obfs4 - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - project: snowflake name: snowflake - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - filename: Bundle-Data enable: '[% ! c("var/android") %]' - URL: https://addons.mozilla.org/firefox/downloads/file/3954910/noscript-11.4.6.xp... name: noscript sha256sum: 5f917e54a52d7269959976ebb6eb41f1a14c047c30d5f7bd6a401fe4126f0b3a - - filename: 'RelativeLink/start-tor-browser.desktop' - enable: '[% c("var/linux") %]' - - filename: 'RelativeLink/execdesktop' - enable: '[% c("var/linux") %]' - filename: 'gtk3-settings.ini' enable: '[% c("var/linux") %]' - project: libdmg-hfsplus @@ -118,11 +120,11 @@ input_files: - filename: verify_allowed_addons.py enable: '[% c("var/android") && c("var/verify_allowed_addons") %]' - filename: bridges_list.obfs4.txt - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - filename: bridges_list.meek-azure.txt - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - filename: bridges_list.snowflake.txt - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' - project: manual name: manual - enable: '[% ! c("var/android") %]' + enable: '[% ! c("var/android") && c("var/tor-browser") %]' diff --git a/projects/browser/pe_checksum_fix.py b/projects/browser/pe_checksum_fix.py index 73cd009..1ee56ad 100755 --- a/projects/browser/pe_checksum_fix.py +++ b/projects/browser/pe_checksum_fix.py @@ -45,7 +45,7 @@ Thanks to a cypherpunk for this workaround idea.
import pefile;
-f = open('torbrowser-install-tmp.exe', 'rb') +f = open('browser-install-tmp.exe', 'rb') exe = f.read() f.close() remainder = len(exe) % 8 @@ -53,4 +53,4 @@ if remainder > 0: exe += bytes('\0' * (8 - remainder), 'utf-8') pef = pefile.PE(data=exe, fast_load=True) pef.OPTIONAL_HEADER.CheckSum = pef.generate_checksum() -pef.write(filename='torbrowser-install-tmp2.exe') +pef.write(filename='browser-install-tmp2.exe') diff --git a/projects/browser/windows-installer/basebrowser.ico b/projects/browser/windows-installer/basebrowser.ico new file mode 100644 index 0000000..cce2759 Binary files /dev/null and b/projects/browser/windows-installer/basebrowser.ico differ diff --git a/projects/browser/windows-installer/basebrowser.nsi b/projects/browser/windows-installer/basebrowser.nsi new file mode 100644 index 0000000..5d3e858 --- /dev/null +++ b/projects/browser/windows-installer/basebrowser.nsi @@ -0,0 +1,185 @@ +;NSIS Installer for Base Browser Bundle +;Written by Moritz Bartl +;released under Public Domain + +;-------------------------------- +;Modern" UI + + !include "MUI2.nsh" + !include "LogicLib.nsh" + !include "WinVer.nsh" + +;-------------------------------- +;General + + ; location of Base Browser bundle to put into installer + !define TBBSOURCE ".\Base Browser" + + Name "Base Browser" + OutFile "basebrowser-install.exe" + + ;Default installation folder + InstallDir "$DESKTOP\Base Browser" + + ;Best (but slowest) compression + SetCompressor /SOLID lzma + SetCompressorDictSize 32 + + ;Request application privileges for Windows Vista + RequestExecutionLevel user + +;-------------------------------- +;Interface Configuration + + !define MUI_ICON "basebrowser.ico" + !define MUI_ABORTWARNING + +;-------------------------------- +;Modern UI settings + !define MUI_FINISHPAGE_NOREBOOTSUPPORT ; we don't require a reboot + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_FUNCTION "StartBaseBrowser" + !define MUI_FINISHPAGE_SHOWREADME ; misuse for option to create shortcut; less ugly than MUI_PAGE_COMPONENTS + !define MUI_FINISHPAGE_SHOWREADME_TEXT "&Add Start Menu && Desktop shortcuts" + !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CreateShortCuts" +;-------------------------------- +;Pages + + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckIfTargetDirectoryExists + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" ;first language is the default language + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "SpanishInternational" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "NorwegianNynorsk" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !insertmacro MUI_LANGUAGE "Polish" + !insertmacro MUI_LANGUAGE "Ukrainian" + !insertmacro MUI_LANGUAGE "Czech" + !insertmacro MUI_LANGUAGE "Slovak" + !insertmacro MUI_LANGUAGE "Croatian" + !insertmacro MUI_LANGUAGE "Bulgarian" + !insertmacro MUI_LANGUAGE "Hungarian" + !insertmacro MUI_LANGUAGE "Thai" + !insertmacro MUI_LANGUAGE "Romanian" + !insertmacro MUI_LANGUAGE "Latvian" + !insertmacro MUI_LANGUAGE "Macedonian" + !insertmacro MUI_LANGUAGE "Estonian" + !insertmacro MUI_LANGUAGE "Turkish" + !insertmacro MUI_LANGUAGE "Lithuanian" + !insertmacro MUI_LANGUAGE "Slovenian" + !insertmacro MUI_LANGUAGE "Serbian" + !insertmacro MUI_LANGUAGE "SerbianLatin" + !insertmacro MUI_LANGUAGE "Arabic" + !insertmacro MUI_LANGUAGE "Farsi" + !insertmacro MUI_LANGUAGE "Hebrew" + !insertmacro MUI_LANGUAGE "Indonesian" + !insertmacro MUI_LANGUAGE "Mongolian" + !insertmacro MUI_LANGUAGE "Luxembourgish" + !insertmacro MUI_LANGUAGE "Albanian" + !insertmacro MUI_LANGUAGE "Breton" + !insertmacro MUI_LANGUAGE "Belarusian" + !insertmacro MUI_LANGUAGE "Icelandic" + !insertmacro MUI_LANGUAGE "Malay" + !insertmacro MUI_LANGUAGE "Bosnian" + !insertmacro MUI_LANGUAGE "Kurdish" + !insertmacro MUI_LANGUAGE "Irish" + !insertmacro MUI_LANGUAGE "Uzbek" + !insertmacro MUI_LANGUAGE "Galician" + !insertmacro MUI_LANGUAGE "Afrikaans" + !insertmacro MUI_LANGUAGE "Catalan" + !insertmacro MUI_LANGUAGE "Esperanto" + +;-------------------------------- +;Multi Language support: Read strings from separate file + +; !include torbrowser-langstrings.nsi + +;-------------------------------- +;Reserve Files + + ;If you are using solid compression, files that are required before + ;the actual installation should be stored first in the data block, + ;because this will make your installer start faster. + + !insertmacro MUI_RESERVEFILE_LANGDLL + +;-------------------------------- +;Installer Sections + +Section "Base Browser Bundle" SecTBB + + SetOutPath "$INSTDIR" + File /r "${TBBSOURCE}*.*" + SetOutPath "$INSTDIR\Browser" + CreateShortCut "$INSTDIR\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe" + +SectionEnd + +Function CreateShortcuts + + CreateShortCut "$SMPROGRAMS\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe" + CreateShortCut "$DESKTOP\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe" + +FunctionEnd +;-------------------------------- +;Installer Functions + +Function .onInit + + ${IfNot} ${AtLeastWin7} + MessageBox MB_USERICON|MB_OK "Base Browser requires at least Windows 7" + SetErrorLevel 1 + Quit + ${EndIf} + + ; Don't install on systems that don't support SSE2. The parameter value of + ; 10 is for PF_XMMI64_INSTRUCTIONS_AVAILABLE which will check whether the + ; SSE2 instruction set is available. + System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7" + + ${If} "$R7" == "0" + MessageBox MB_OK|MB_ICONSTOP "Sorry, Base Browser can't be installed. This version of Base Browser requires a processor with SSE2 support." + Abort + ${EndIf} + + !insertmacro MUI_LANGDLL_DISPLAY + +FunctionEnd + +;-------------------------------- +;Helper Functions + +Function CheckIfTargetDirectoryExists +${If} ${FileExists} "$INSTDIR*.*" + MessageBox MB_YESNO "The destination directory already exists. You can try to upgrade the Base Browser Bundle, but if you run into any problems, use a new directory instead. Continue?" IDYES NoAbort + Abort + NoAbort: +${EndIf} +FunctionEnd + + +Function StartBaseBrowser +ExecShell "open" "$INSTDIR/Start Base Browser.lnk" +FunctionEnd +