boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
- 
3299ed3d
by Nicolas Vigier at 2023-02-10T09:44:21+01:00
4 changed files:
- projects/browser/build
- projects/browser/windows-installer/basebrowser.nsi → projects/browser/windows-installer.nsi
- − projects/browser/windows-installer/privacybrowser.nsi
- − projects/browser/windows-installer/torbrowser.nsi
Changes:
| ... | ... | @@ -285,6 +285,9 @@ done | 
| 285 | 285 |    export PATH="/var/tmp/dist/nsis/bin:$PATH"
 | 
| 286 | 286 | |
| 287 | 287 |    mv $rootdir/windows-installer $distdir/windows-installer
 | 
| 288 | +  cat > $distdir/windows-installer/browser.nsi << 'BROWSER_NSI'
 | |
| 289 | +[% INCLUDE 'windows-installer.nsi' %]
 | |
| 290 | +BROWSER_NSI
 | |
| 288 | 291 |    mv ${TB_STAGE_DIR} $distdir/windows-installer/"[% c('var/Project_Name') %]"
 | 
| 289 | 292 |    mv $distdir/windows-installer ${TB_STAGE_DIR}
 | 
| 290 | 293 |  [% END %]
 | 
| ... | ... | @@ -354,7 +357,7 @@ cd $distdir | 
| 354 | 357 |  [% ELSIF c("var/windows") %]
 | 
| 355 | 358 |    find "$PKG_DIR" -exec [% c("touch") %] {} \;
 | 
| 356 | 359 |    pushd "$PKG_DIR"
 | 
| 357 | -  makensis [% c("var/projectname") %].nsi
 | |
| 360 | +  makensis browser.nsi
 | |
| 358 | 361 |    # Working around NSIS braindamage
 | 
| 359 | 362 |    mv [% c("var/projectname") %]-install.exe browser-install-tmp.exe
 | 
| 360 | 363 |    python3 $rootdir/pe_checksum_fix.py
 | 
| 1 | -;NSIS Installer for Base Browser Bundle
 | |
| 1 | +;NSIS Installer for Tor/Base/Privacy Browser
 | |
| 2 | 2 |  ;Written by Moritz Bartl
 | 
| 3 | 3 |  ;released under Public Domain
 | 
| 4 | 4 | |
| ... | ... | @@ -12,14 +12,14 @@ | 
| 12 | 12 |  ;--------------------------------
 | 
| 13 | 13 |  ;General
 | 
| 14 | 14 | |
| 15 | -  ; location of Base Browser bundle to put into installer
 | |
| 16 | -  !define TBBSOURCE ".\Base Browser\"
 | |
| 15 | +  ; location of Tor/Base/Privacy Browser to put into installer
 | |
| 16 | +  !define PROGRAM_SOURCE ".\[% c('var/Project_Name') %]\"
 | |
| 17 | 17 | |
| 18 | -  Name "Base Browser"
 | |
| 19 | -  OutFile "basebrowser-install.exe"
 | |
| 18 | +  Name "[% c('var/Project_Name') %]"
 | |
| 19 | +  OutFile "[% c('var/projectname') %]-install.exe"
 | |
| 20 | 20 | |
| 21 | 21 |    ;Default installation folder
 | 
| 22 | -  InstallDir "$DESKTOP\Base Browser"
 | |
| 22 | +  InstallDir "$DESKTOP\[% c('var/Project_Name') %]"
 | |
| 23 | 23 | |
| 24 | 24 |    ;Best (but slowest) compression
 | 
| 25 | 25 |    SetCompressor /SOLID lzma
 | 
| ... | ... | @@ -31,14 +31,14 @@ | 
| 31 | 31 |  ;--------------------------------
 | 
| 32 | 32 |  ;Interface Configuration
 | 
| 33 | 33 | |
| 34 | -  !define MUI_ICON   "basebrowser.ico"
 | |
| 34 | +  !define MUI_ICON   "[% c('var/projectname') %].ico"
 | |
| 35 | 35 |    !define MUI_ABORTWARNING
 | 
| 36 | 36 | |
| 37 | 37 |  ;--------------------------------
 | 
| 38 | 38 |  ;Modern UI settings
 | 
| 39 | 39 |    !define MUI_FINISHPAGE_NOREBOOTSUPPORT     ; we don't require a reboot
 | 
| 40 | 40 |    !define MUI_FINISHPAGE_RUN
 | 
| 41 | -  !define MUI_FINISHPAGE_RUN_FUNCTION "StartBaseBrowser"
 | |
| 41 | +  !define MUI_FINISHPAGE_RUN_FUNCTION "StartBrowser"
 | |
| 42 | 42 |    !define MUI_FINISHPAGE_SHOWREADME ; misuse for option to create shortcut; less ugly than MUI_PAGE_COMPONENTS
 | 
| 43 | 43 |    !define MUI_FINISHPAGE_SHOWREADME_TEXT "&Add Start Menu && Desktop shortcuts"
 | 
| 44 | 44 |    !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CreateShortCuts"
 | 
| ... | ... | @@ -113,7 +113,7 @@ | 
| 113 | 113 |  ;--------------------------------
 | 
| 114 | 114 |  ;Multi Language support: Read strings from separate file
 | 
| 115 | 115 | |
| 116 | -; !include torbrowser-langstrings.nsi
 | |
| 116 | +; !include [% c('var/projectname') %]-langstrings.nsi
 | |
| 117 | 117 | |
| 118 | 118 |  ;--------------------------------
 | 
| 119 | 119 |  ;Reserve Files
 | 
| ... | ... | @@ -127,19 +127,19 @@ | 
| 127 | 127 |  ;--------------------------------
 | 
| 128 | 128 |  ;Installer Sections
 | 
| 129 | 129 | |
| 130 | -Section "Base Browser Bundle" SecTBB
 | |
| 130 | +Section "[% c('var/Project_Name') %]" SecBrowser
 | |
| 131 | 131 | |
| 132 | 132 |    SetOutPath "$INSTDIR"
 | 
| 133 | -  File /r "${TBBSOURCE}\*.*"
 | |
| 133 | +  File /r "${PROGRAM_SOURCE}\*.*"
 | |
| 134 | 134 |    SetOutPath "$INSTDIR\Browser"
 | 
| 135 | -  CreateShortCut "$INSTDIR\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 135 | +  CreateShortCut "$INSTDIR\Start [% c('var/Project_Name') %].lnk" "$INSTDIR\Browser\[% c('var/exe_name') %].exe"
 | |
| 136 | 136 | |
| 137 | 137 |  SectionEnd
 | 
| 138 | 138 | |
| 139 | 139 |  Function CreateShortcuts
 | 
| 140 | 140 | |
| 141 | -  CreateShortCut "$SMPROGRAMS\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 142 | -  CreateShortCut "$DESKTOP\Start Base Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 141 | +  CreateShortCut "$SMPROGRAMS\Start [% c('var/Project_Name') %].lnk" "$INSTDIR\Browser\[% c('var/exe_name') %].exe"
 | |
| 142 | +  CreateShortCut "$DESKTOP\Start [% c('var/Project_Name') %].lnk" "$INSTDIR\Browser\[% c('var/exe_name') %].exe"
 | |
| 143 | 143 | |
| 144 | 144 |  FunctionEnd
 | 
| 145 | 145 |  ;--------------------------------
 | 
| ... | ... | @@ -148,7 +148,7 @@ FunctionEnd | 
| 148 | 148 |  Function .onInit
 | 
| 149 | 149 | |
| 150 | 150 |    ${IfNot} ${AtLeastWin7}
 | 
| 151 | -    MessageBox MB_USERICON|MB_OK "Base Browser requires at least Windows 7"
 | |
| 151 | +    MessageBox MB_USERICON|MB_OK "[% c('var/Project_Name') %] requires at least Windows 7"
 | |
| 152 | 152 |      SetErrorLevel 1
 | 
| 153 | 153 |      Quit
 | 
| 154 | 154 |    ${EndIf}
 | 
| ... | ... | @@ -159,7 +159,7 @@ Function .onInit | 
| 159 | 159 |    System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7"
 | 
| 160 | 160 | |
| 161 | 161 |    ${If} "$R7" == "0"
 | 
| 162 | -    MessageBox MB_OK|MB_ICONSTOP "Sorry, Base Browser can't be installed. This version of Base Browser requires a processor with SSE2 support."
 | |
| 162 | +    MessageBox MB_OK|MB_ICONSTOP "Sorry, [% c('var/Project_Name') %] can't be installed. This version of [% c('var/Project_Name') %] requires a processor with SSE2 support."
 | |
| 163 | 163 |      Abort
 | 
| 164 | 164 |    ${EndIf}
 | 
| 165 | 165 | |
| ... | ... | @@ -172,14 +172,14 @@ FunctionEnd | 
| 172 | 172 | |
| 173 | 173 |  Function CheckIfTargetDirectoryExists
 | 
| 174 | 174 |  ${If} ${FileExists} "$INSTDIR\*.*"
 | 
| 175 | - 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
 | |
| 175 | + MessageBox MB_YESNO "The destination directory already exists. You can try to upgrade the [% c('var/Project_Name') %], but if you run into any problems, use a new directory instead. Continue?" IDYES NoAbort
 | |
| 176 | 176 |     Abort
 | 
| 177 | 177 |   NoAbort:
 | 
| 178 | 178 |  ${EndIf}
 | 
| 179 | 179 |  FunctionEnd
 | 
| 180 | 180 | |
| 181 | 181 | |
| 182 | -Function StartBaseBrowser
 | |
| 183 | -ExecShell "open" "$INSTDIR/Start Base Browser.lnk"
 | |
| 182 | +Function StartBrowser
 | |
| 183 | +ExecShell "open" "$INSTDIR/Start [% c('var/Project_Name') %].lnk"
 | |
| 184 | 184 |  FunctionEnd
 | 
| 185 | 185 | 
| 1 | -;NSIS Installer for Privacy Browser
 | |
| 2 | -;Written by Moritz Bartl
 | |
| 3 | -;released under Public Domain
 | |
| 4 | - | |
| 5 | -;--------------------------------
 | |
| 6 | -;Modern UI
 | |
| 7 | - | |
| 8 | -  !include "MUI2.nsh"
 | |
| 9 | -  !include "LogicLib.nsh"
 | |
| 10 | -  !include "WinVer.nsh"
 | |
| 11 | - | |
| 12 | -;--------------------------------
 | |
| 13 | -;General
 | |
| 14 | - | |
| 15 | -  ; location of Privacy Browser bundle to put into installer
 | |
| 16 | -  !define TBBSOURCE ".\Privacy Browser\"
 | |
| 17 | - | |
| 18 | -  Name "Privacy Browser"
 | |
| 19 | -  OutFile "privacybrowser-install.exe"
 | |
| 20 | - | |
| 21 | -  ;Default installation folder
 | |
| 22 | -  InstallDir "$DESKTOP\Privacy Browser"
 | |
| 23 | - | |
| 24 | -  ;Best (but slowest) compression
 | |
| 25 | -  SetCompressor /SOLID lzma
 | |
| 26 | -  SetCompressorDictSize 32
 | |
| 27 | - | |
| 28 | -  ;Request application privileges for Windows Vista
 | |
| 29 | -  RequestExecutionLevel user
 | |
| 30 | - | |
| 31 | -;--------------------------------
 | |
| 32 | -;Interface Configuration
 | |
| 33 | - | |
| 34 | -  !define MUI_ICON   "privacybrowser.ico"
 | |
| 35 | -  !define MUI_ABORTWARNING
 | |
| 36 | - | |
| 37 | -;--------------------------------
 | |
| 38 | -;Modern UI settings
 | |
| 39 | -  !define MUI_FINISHPAGE_NOREBOOTSUPPORT     ; we don't require a reboot
 | |
| 40 | -  !define MUI_FINISHPAGE_RUN
 | |
| 41 | -  !define MUI_FINISHPAGE_RUN_FUNCTION "StartPrivacyBrowser"
 | |
| 42 | -  !define MUI_FINISHPAGE_SHOWREADME ; misuse for option to create shortcut; less ugly than MUI_PAGE_COMPONENTS
 | |
| 43 | -  !define MUI_FINISHPAGE_SHOWREADME_TEXT "&Add Start Menu && Desktop shortcuts"
 | |
| 44 | -  !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CreateShortCuts"
 | |
| 45 | -;--------------------------------
 | |
| 46 | -;Pages
 | |
| 47 | - | |
| 48 | -  !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckIfTargetDirectoryExists
 | |
| 49 | -  !insertmacro MUI_PAGE_DIRECTORY
 | |
| 50 | -  !insertmacro MUI_PAGE_INSTFILES
 | |
| 51 | -  !insertmacro MUI_PAGE_FINISH
 | |
| 52 | - | |
| 53 | -;--------------------------------
 | |
| 54 | -;Languages
 | |
| 55 | - | |
| 56 | -  !insertmacro MUI_LANGUAGE "English" ;first language is the default language
 | |
| 57 | -  !insertmacro MUI_LANGUAGE "French"
 | |
| 58 | -  !insertmacro MUI_LANGUAGE "German"
 | |
| 59 | -  !insertmacro MUI_LANGUAGE "Spanish"
 | |
| 60 | -  !insertmacro MUI_LANGUAGE "SpanishInternational"
 | |
| 61 | -  !insertmacro MUI_LANGUAGE "SimpChinese"
 | |
| 62 | -  !insertmacro MUI_LANGUAGE "TradChinese"
 | |
| 63 | -  !insertmacro MUI_LANGUAGE "Japanese"
 | |
| 64 | -  !insertmacro MUI_LANGUAGE "Korean"
 | |
| 65 | -  !insertmacro MUI_LANGUAGE "Italian"
 | |
| 66 | -  !insertmacro MUI_LANGUAGE "Dutch"
 | |
| 67 | -  !insertmacro MUI_LANGUAGE "Danish"
 | |
| 68 | -  !insertmacro MUI_LANGUAGE "Swedish"
 | |
| 69 | -  !insertmacro MUI_LANGUAGE "Norwegian"
 | |
| 70 | -  !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
 | |
| 71 | -  !insertmacro MUI_LANGUAGE "Finnish"
 | |
| 72 | -  !insertmacro MUI_LANGUAGE "Greek"
 | |
| 73 | -  !insertmacro MUI_LANGUAGE "Russian"
 | |
| 74 | -  !insertmacro MUI_LANGUAGE "Portuguese"
 | |
| 75 | -  !insertmacro MUI_LANGUAGE "PortugueseBR"
 | |
| 76 | -  !insertmacro MUI_LANGUAGE "Polish"
 | |
| 77 | -  !insertmacro MUI_LANGUAGE "Ukrainian"
 | |
| 78 | -  !insertmacro MUI_LANGUAGE "Czech"
 | |
| 79 | -  !insertmacro MUI_LANGUAGE "Slovak"
 | |
| 80 | -  !insertmacro MUI_LANGUAGE "Croatian"
 | |
| 81 | -  !insertmacro MUI_LANGUAGE "Bulgarian"
 | |
| 82 | -  !insertmacro MUI_LANGUAGE "Hungarian"
 | |
| 83 | -  !insertmacro MUI_LANGUAGE "Thai"
 | |
| 84 | -  !insertmacro MUI_LANGUAGE "Romanian"
 | |
| 85 | -  !insertmacro MUI_LANGUAGE "Latvian"
 | |
| 86 | -  !insertmacro MUI_LANGUAGE "Macedonian"
 | |
| 87 | -  !insertmacro MUI_LANGUAGE "Estonian"
 | |
| 88 | -  !insertmacro MUI_LANGUAGE "Turkish"
 | |
| 89 | -  !insertmacro MUI_LANGUAGE "Lithuanian"
 | |
| 90 | -  !insertmacro MUI_LANGUAGE "Slovenian"
 | |
| 91 | -  !insertmacro MUI_LANGUAGE "Serbian"
 | |
| 92 | -  !insertmacro MUI_LANGUAGE "SerbianLatin"
 | |
| 93 | -  !insertmacro MUI_LANGUAGE "Arabic"
 | |
| 94 | -  !insertmacro MUI_LANGUAGE "Farsi"
 | |
| 95 | -  !insertmacro MUI_LANGUAGE "Hebrew"
 | |
| 96 | -  !insertmacro MUI_LANGUAGE "Indonesian"
 | |
| 97 | -  !insertmacro MUI_LANGUAGE "Mongolian"
 | |
| 98 | -  !insertmacro MUI_LANGUAGE "Luxembourgish"
 | |
| 99 | -  !insertmacro MUI_LANGUAGE "Albanian"
 | |
| 100 | -  !insertmacro MUI_LANGUAGE "Breton"
 | |
| 101 | -  !insertmacro MUI_LANGUAGE "Belarusian"
 | |
| 102 | -  !insertmacro MUI_LANGUAGE "Icelandic"
 | |
| 103 | -  !insertmacro MUI_LANGUAGE "Malay"
 | |
| 104 | -  !insertmacro MUI_LANGUAGE "Bosnian"
 | |
| 105 | -  !insertmacro MUI_LANGUAGE "Kurdish"
 | |
| 106 | -  !insertmacro MUI_LANGUAGE "Irish"
 | |
| 107 | -  !insertmacro MUI_LANGUAGE "Uzbek"
 | |
| 108 | -  !insertmacro MUI_LANGUAGE "Galician"
 | |
| 109 | -  !insertmacro MUI_LANGUAGE "Afrikaans"
 | |
| 110 | -  !insertmacro MUI_LANGUAGE "Catalan"
 | |
| 111 | -  !insertmacro MUI_LANGUAGE "Esperanto"
 | |
| 112 | - | |
| 113 | -;--------------------------------
 | |
| 114 | -;Reserve Files
 | |
| 115 | - | |
| 116 | -  ;If you are using solid compression, files that are required before
 | |
| 117 | -  ;the actual installation should be stored first in the data block,
 | |
| 118 | -  ;because this will make your installer start faster.
 | |
| 119 | - | |
| 120 | -  !insertmacro MUI_RESERVEFILE_LANGDLL
 | |
| 121 | - | |
| 122 | -;--------------------------------
 | |
| 123 | -;Installer Sections
 | |
| 124 | - | |
| 125 | -Section "Privacy Browser" SecPB
 | |
| 126 | - | |
| 127 | -  SetOutPath "$INSTDIR"
 | |
| 128 | -  File /r "${TBBSOURCE}\*.*"
 | |
| 129 | -  SetOutPath "$INSTDIR\Browser"
 | |
| 130 | -  CreateShortCut "$INSTDIR\Start Privacy Browser.lnk" "$INSTDIR\Browser\privacybrowser.exe"
 | |
| 131 | - | |
| 132 | -SectionEnd
 | |
| 133 | - | |
| 134 | -Function CreateShortcuts
 | |
| 135 | - | |
| 136 | -  CreateShortCut "$SMPROGRAMS\Start Privacy Browser.lnk" "$INSTDIR\Browser\privacybrowser.exe"
 | |
| 137 | -  CreateShortCut "$DESKTOP\Start Privacy Browser.lnk" "$INSTDIR\Browser\privacybrowser.exe"
 | |
| 138 | - | |
| 139 | -FunctionEnd
 | |
| 140 | -;--------------------------------
 | |
| 141 | -;Installer Functions
 | |
| 142 | - | |
| 143 | -Function .onInit
 | |
| 144 | - | |
| 145 | -  ${IfNot} ${AtLeastWin7}
 | |
| 146 | -    MessageBox MB_USERICON|MB_OK "Privacy Browser requires at least Windows 7"
 | |
| 147 | -    SetErrorLevel 1
 | |
| 148 | -    Quit
 | |
| 149 | -  ${EndIf}
 | |
| 150 | - | |
| 151 | -  ; Don't install on systems that don't support SSE2. The parameter value of
 | |
| 152 | -  ; 10 is for PF_XMMI64_INSTRUCTIONS_AVAILABLE which will check whether the
 | |
| 153 | -  ; SSE2 instruction set is available.
 | |
| 154 | -  System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7"
 | |
| 155 | - | |
| 156 | -  ${If} "$R7" == "0"
 | |
| 157 | -    MessageBox MB_OK|MB_ICONSTOP "Sorry, Privacy Browser can't be installed. This version of Privacy Browser requires a processor with SSE2 support."
 | |
| 158 | -    Abort
 | |
| 159 | -  ${EndIf}
 | |
| 160 | - | |
| 161 | -  !insertmacro MUI_LANGDLL_DISPLAY
 | |
| 162 | - | |
| 163 | -FunctionEnd
 | |
| 164 | - | |
| 165 | -;--------------------------------
 | |
| 166 | -;Helper Functions
 | |
| 167 | - | |
| 168 | -Function CheckIfTargetDirectoryExists
 | |
| 169 | -${If} ${FileExists} "$INSTDIR\*.*"
 | |
| 170 | -  MessageBox MB_YESNO "The destination directory already exists. You can try to upgrade Privacy Browser, but if you run into any problems, use a new directory instead. Continue?" IDYES NoAbort
 | |
| 171 | -    Abort
 | |
| 172 | -  NoAbort:
 | |
| 173 | -${EndIf}
 | |
| 174 | -FunctionEnd
 | |
| 175 | - | |
| 176 | - | |
| 177 | -Function StartPrivacyBrowser
 | |
| 178 | -ExecShell "open" "$INSTDIR/Start Privacy Browser.lnk"
 | |
| 179 | -FunctionEnd
 | |
| 180 | - | 
| 1 | -;NSIS Installer for Tor Browser Bundle
 | |
| 2 | -;Written by Moritz Bartl
 | |
| 3 | -;released under Public Domain
 | |
| 4 | - | |
| 5 | -;--------------------------------
 | |
| 6 | -;Modern UI
 | |
| 7 | - | |
| 8 | -  !include "MUI2.nsh"
 | |
| 9 | -  !include "LogicLib.nsh"
 | |
| 10 | -  !include "WinVer.nsh"
 | |
| 11 | - | |
| 12 | -;--------------------------------
 | |
| 13 | -;General
 | |
| 14 | - | |
| 15 | -  ; location of Tor Browser bundle to put into installer
 | |
| 16 | -  !define TBBSOURCE ".\Tor Browser\"
 | |
| 17 | - | |
| 18 | -  Name "Tor Browser"
 | |
| 19 | -  OutFile "torbrowser-install.exe"
 | |
| 20 | - | |
| 21 | -  ;Default installation folder
 | |
| 22 | -  InstallDir "$DESKTOP\Tor Browser"
 | |
| 23 | - | |
| 24 | -  ;Best (but slowest) compression
 | |
| 25 | -  SetCompressor /SOLID lzma
 | |
| 26 | -  SetCompressorDictSize 32
 | |
| 27 | - | |
| 28 | -  ;Request application privileges for Windows Vista
 | |
| 29 | -  RequestExecutionLevel user
 | |
| 30 | - | |
| 31 | -;--------------------------------
 | |
| 32 | -;Interface Configuration
 | |
| 33 | - | |
| 34 | -  !define MUI_ICON   "torbrowser.ico"
 | |
| 35 | -  !define MUI_ABORTWARNING
 | |
| 36 | - | |
| 37 | -;--------------------------------
 | |
| 38 | -;Modern UI settings
 | |
| 39 | -  !define MUI_FINISHPAGE_NOREBOOTSUPPORT     ; we don't require a reboot
 | |
| 40 | -  !define MUI_FINISHPAGE_RUN
 | |
| 41 | -  !define MUI_FINISHPAGE_RUN_FUNCTION "StartTorBrowser"
 | |
| 42 | -  !define MUI_FINISHPAGE_SHOWREADME ; misuse for option to create shortcut; less ugly than MUI_PAGE_COMPONENTS
 | |
| 43 | -  !define MUI_FINISHPAGE_SHOWREADME_TEXT "&Add Start Menu && Desktop shortcuts"
 | |
| 44 | -  !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CreateShortCuts"
 | |
| 45 | -;--------------------------------
 | |
| 46 | -;Pages
 | |
| 47 | - | |
| 48 | -  !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckIfTargetDirectoryExists
 | |
| 49 | -  !insertmacro MUI_PAGE_DIRECTORY
 | |
| 50 | -  !insertmacro MUI_PAGE_INSTFILES
 | |
| 51 | -  !insertmacro MUI_PAGE_FINISH
 | |
| 52 | - | |
| 53 | -;--------------------------------
 | |
| 54 | -;Languages
 | |
| 55 | - | |
| 56 | -  !insertmacro MUI_LANGUAGE "English" ;first language is the default language
 | |
| 57 | -  !insertmacro MUI_LANGUAGE "French"
 | |
| 58 | -  !insertmacro MUI_LANGUAGE "German"
 | |
| 59 | -  !insertmacro MUI_LANGUAGE "Spanish"
 | |
| 60 | -  !insertmacro MUI_LANGUAGE "SpanishInternational"
 | |
| 61 | -  !insertmacro MUI_LANGUAGE "SimpChinese"
 | |
| 62 | -  !insertmacro MUI_LANGUAGE "TradChinese"
 | |
| 63 | -  !insertmacro MUI_LANGUAGE "Japanese"
 | |
| 64 | -  !insertmacro MUI_LANGUAGE "Korean"
 | |
| 65 | -  !insertmacro MUI_LANGUAGE "Italian"
 | |
| 66 | -  !insertmacro MUI_LANGUAGE "Dutch"
 | |
| 67 | -  !insertmacro MUI_LANGUAGE "Danish"
 | |
| 68 | -  !insertmacro MUI_LANGUAGE "Swedish"
 | |
| 69 | -  !insertmacro MUI_LANGUAGE "Norwegian"
 | |
| 70 | -  !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
 | |
| 71 | -  !insertmacro MUI_LANGUAGE "Finnish"
 | |
| 72 | -  !insertmacro MUI_LANGUAGE "Greek"
 | |
| 73 | -  !insertmacro MUI_LANGUAGE "Russian"
 | |
| 74 | -  !insertmacro MUI_LANGUAGE "Portuguese"
 | |
| 75 | -  !insertmacro MUI_LANGUAGE "PortugueseBR"
 | |
| 76 | -  !insertmacro MUI_LANGUAGE "Polish"
 | |
| 77 | -  !insertmacro MUI_LANGUAGE "Ukrainian"
 | |
| 78 | -  !insertmacro MUI_LANGUAGE "Czech"
 | |
| 79 | -  !insertmacro MUI_LANGUAGE "Slovak"
 | |
| 80 | -  !insertmacro MUI_LANGUAGE "Croatian"
 | |
| 81 | -  !insertmacro MUI_LANGUAGE "Bulgarian"
 | |
| 82 | -  !insertmacro MUI_LANGUAGE "Hungarian"
 | |
| 83 | -  !insertmacro MUI_LANGUAGE "Thai"
 | |
| 84 | -  !insertmacro MUI_LANGUAGE "Romanian"
 | |
| 85 | -  !insertmacro MUI_LANGUAGE "Latvian"
 | |
| 86 | -  !insertmacro MUI_LANGUAGE "Macedonian"
 | |
| 87 | -  !insertmacro MUI_LANGUAGE "Estonian"
 | |
| 88 | -  !insertmacro MUI_LANGUAGE "Turkish"
 | |
| 89 | -  !insertmacro MUI_LANGUAGE "Lithuanian"
 | |
| 90 | -  !insertmacro MUI_LANGUAGE "Slovenian"
 | |
| 91 | -  !insertmacro MUI_LANGUAGE "Serbian"
 | |
| 92 | -  !insertmacro MUI_LANGUAGE "SerbianLatin"
 | |
| 93 | -  !insertmacro MUI_LANGUAGE "Arabic"
 | |
| 94 | -  !insertmacro MUI_LANGUAGE "Farsi"
 | |
| 95 | -  !insertmacro MUI_LANGUAGE "Hebrew"
 | |
| 96 | -  !insertmacro MUI_LANGUAGE "Indonesian"
 | |
| 97 | -  !insertmacro MUI_LANGUAGE "Mongolian"
 | |
| 98 | -  !insertmacro MUI_LANGUAGE "Luxembourgish"
 | |
| 99 | -  !insertmacro MUI_LANGUAGE "Albanian"
 | |
| 100 | -  !insertmacro MUI_LANGUAGE "Breton"
 | |
| 101 | -  !insertmacro MUI_LANGUAGE "Belarusian"
 | |
| 102 | -  !insertmacro MUI_LANGUAGE "Icelandic"
 | |
| 103 | -  !insertmacro MUI_LANGUAGE "Malay"
 | |
| 104 | -  !insertmacro MUI_LANGUAGE "Bosnian"
 | |
| 105 | -  !insertmacro MUI_LANGUAGE "Kurdish"
 | |
| 106 | -  !insertmacro MUI_LANGUAGE "Irish"
 | |
| 107 | -  !insertmacro MUI_LANGUAGE "Uzbek"
 | |
| 108 | -  !insertmacro MUI_LANGUAGE "Galician"
 | |
| 109 | -  !insertmacro MUI_LANGUAGE "Afrikaans"
 | |
| 110 | -  !insertmacro MUI_LANGUAGE "Catalan"
 | |
| 111 | -  !insertmacro MUI_LANGUAGE "Esperanto"
 | |
| 112 | - | |
| 113 | -;--------------------------------
 | |
| 114 | -;Multi Language support: Read strings from separate file
 | |
| 115 | - | |
| 116 | -; !include torbrowser-langstrings.nsi
 | |
| 117 | - | |
| 118 | -;--------------------------------
 | |
| 119 | -;Reserve Files
 | |
| 120 | - | |
| 121 | -  ;If you are using solid compression, files that are required before
 | |
| 122 | -  ;the actual installation should be stored first in the data block,
 | |
| 123 | -  ;because this will make your installer start faster.
 | |
| 124 | - | |
| 125 | -  !insertmacro MUI_RESERVEFILE_LANGDLL
 | |
| 126 | - | |
| 127 | -;--------------------------------
 | |
| 128 | -;Installer Sections
 | |
| 129 | - | |
| 130 | -Section "Tor Browser Bundle" SecTBB
 | |
| 131 | - | |
| 132 | -  SetOutPath "$INSTDIR"
 | |
| 133 | -  File /r "${TBBSOURCE}\*.*"
 | |
| 134 | -  SetOutPath "$INSTDIR\Browser"
 | |
| 135 | -  CreateShortCut "$INSTDIR\Start Tor Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 136 | - | |
| 137 | -SectionEnd
 | |
| 138 | - | |
| 139 | -Function CreateShortcuts
 | |
| 140 | - | |
| 141 | -  CreateShortCut "$SMPROGRAMS\Start Tor Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 142 | -  CreateShortCut "$DESKTOP\Start Tor Browser.lnk" "$INSTDIR\Browser\firefox.exe"
 | |
| 143 | - | |
| 144 | -FunctionEnd
 | |
| 145 | -;--------------------------------
 | |
| 146 | -;Installer Functions
 | |
| 147 | - | |
| 148 | -Function .onInit
 | |
| 149 | - | |
| 150 | -  ${IfNot} ${AtLeastWin7}
 | |
| 151 | -    MessageBox MB_USERICON|MB_OK "Tor Browser requires at least Windows 7"
 | |
| 152 | -    SetErrorLevel 1
 | |
| 153 | -    Quit
 | |
| 154 | -  ${EndIf}
 | |
| 155 | - | |
| 156 | -  ; Don't install on systems that don't support SSE2. The parameter value of
 | |
| 157 | -  ; 10 is for PF_XMMI64_INSTRUCTIONS_AVAILABLE which will check whether the
 | |
| 158 | -  ; SSE2 instruction set is available.
 | |
| 159 | -  System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7"
 | |
| 160 | - | |
| 161 | -  ${If} "$R7" == "0"
 | |
| 162 | -    MessageBox MB_OK|MB_ICONSTOP "Sorry, Tor Browser can't be installed. This version of Tor Browser requires a processor with SSE2 support."
 | |
| 163 | -    Abort
 | |
| 164 | -  ${EndIf}
 | |
| 165 | - | |
| 166 | -  !insertmacro MUI_LANGDLL_DISPLAY
 | |
| 167 | - | |
| 168 | -FunctionEnd
 | |
| 169 | - | |
| 170 | -;--------------------------------
 | |
| 171 | -;Helper Functions
 | |
| 172 | - | |
| 173 | -Function CheckIfTargetDirectoryExists
 | |
| 174 | -${If} ${FileExists} "$INSTDIR\*.*"
 | |
| 175 | - MessageBox MB_YESNO "The destination directory already exists. You can try to upgrade the Tor Browser Bundle, but if you run into any problems, use a new directory instead. Continue?" IDYES NoAbort
 | |
| 176 | -   Abort
 | |
| 177 | - NoAbort:
 | |
| 178 | -${EndIf}
 | |
| 179 | -FunctionEnd
 | |
| 180 | - | |
| 181 | - | |
| 182 | -Function StartTorBrowser
 | |
| 183 | -ExecShell "open" "$INSTDIR/Start Tor Browser.lnk"
 | |
| 184 | -FunctionEnd
 | |
| 185 | - |