"Fossies" - the Fresh Open Source Software Archive

Member "src/Setup/Linux/veracrypt_install_template.sh" (10 Oct 2018, 42492 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "veracrypt_install_template.sh": 1.21_Source_vs_1.22_Source.

    1 #
    2 # Derived from source code of TrueCrypt 7.1a, which is
    3 # Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4 # by the TrueCrypt License 3.0.
    5 #
    6 # Modifications and additions to the original source code (contained in this file)
    7 # and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8 # and are governed by the Apache License 2.0 the full text of which is
    9 # contained in the file License.txt included in VeraCrypt binary and source
   10 # code distribution packages.
   11 #
   12 
   13 PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/X11
   14 
   15 PACKAGE_DIR=$(dirname $(mktemp))
   16 PACKAGE=$PACKAGE_DIR/$PACKAGE_NAME
   17 umask 022
   18 
   19 
   20 # Terminal setup
   21 
   22 TTY=0
   23 tty >/dev/null 2>/dev/null && TTY=1
   24 
   25 GUI=0
   26 XMESSAGE=0
   27 XTERM=0
   28 GTERM=0
   29 KTERM=0
   30 
   31 
   32 case $PACKAGE_TYPE in
   33     tar)
   34         PACKAGE_INSTALLER=tar
   35         PACKAGE_INSTALLER_OPTS='-C / --no-overwrite-dir -xpzvf'
   36         ;;
   37 esac
   38 
   39 
   40 if [ -n "$DISPLAY" -a "$INSTALLER_TYPE" != "console" ]
   41 then
   42     GUI=1
   43     which xmessage >/dev/null 2>/dev/null && XMESSAGE=1
   44     which xterm >/dev/null 2>/dev/null && XTERM=1
   45     which gnome-terminal >/dev/null 2>/dev/null && GTERM=1
   46     which konsole >/dev/null 2>/dev/null && KTERM=1
   47 fi
   48 
   49 if [ $TTY -eq 0 ]
   50 then
   51     [ $GUI -eq 0 ] && echo 'Error: Terminal required' >&2 && exit 1
   52 
   53     if [ $XMESSAGE -eq 0 ] || ([ $XTERM -eq 0 ] && [ $GTERM -eq 0 ] && [ $KTERM -eq 0 ])
   54     then
   55         which gnome-terminal && exec gnome-terminal -e "$0"
   56         which konsole && exec konsole -e "$0"
   57         which xterm && exec xterm -e "$0"
   58 
   59         [ $XMESSAGE -eq 1 ] && show_exit_message 'Error: Terminal required'
   60         exit 1
   61     fi
   62 fi
   63 
   64 if [ $XMESSAGE -eq 0 ] || ([ $XTERM -eq 0 ] && [ $GTERM -eq 0 ] && [ $KTERM -eq 0 ])
   65 then
   66     GUI=0
   67     XMESSAGE=0
   68     XTERM=0
   69     GTERM=0
   70     KTERM=0
   71 fi
   72 
   73 
   74 show_message()
   75 {
   76     if [ $GUI -eq 1 ]
   77     then
   78         if [ $XMESSAGE -eq 1 ]
   79         then
   80             xmessage -center -buttons OK -default OK "$*"
   81         else
   82             if [ $TTY -eq 1 ]
   83             then
   84                 echo "$*"
   85             else
   86                 if [ $XTERM -eq 1 ]
   87                 then
   88                     xterm -T 'VeraCrypt Setup' -e sh -c "echo $*; read A"
   89                 else
   90                     if [ $GTERM -eq 1 ]
   91                     then
   92                         gnome-terminal --title='VeraCrypt Setup' -e "sh -c \"echo $*; read A\""
   93                     else
   94                         if [ $KTERM -eq 1 ]
   95                         then
   96                             konsole --title 'VeraCrypt Setup' -e sh -c "echo $*; read A"
   97                         fi
   98                     fi
   99                 fi
  100             fi
  101         fi
  102     else
  103         echo "$*"
  104     fi
  105 }
  106 
  107 show_exit_message()
  108 {
  109     show_message "$*"
  110 
  111     if [ $XMESSAGE -eq 0 ]
  112     then
  113         printf 'Press Enter to exit... '
  114         read A
  115     fi
  116 }
  117 
  118 # License extraction
  119 
  120 trap 'rm -f $LICENSE $PACKAGE; exit 1' HUP INT QUIT TERM
  121 LICENSE=$(mktemp)
  122 
  123 cat >$LICENSE <<_LICENSE_END
  124 VeraCrypt License
  125 Software distributed under this license is distributed on an "AS
  126 IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
  127 DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
  128 USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
  129 SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
  130 BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
  131 ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
  132 SOFTWARE, NOR ANY PART(S) THEREOF.
  133 
  134 VeraCrypt is multi-licensed under Apache License 2.0 and
  135 the TrueCrypt License version 3.0, a verbatim copy of both
  136 licenses can be found below.
  137 
  138 This license does not grant you rights to use any
  139 contributors' name, logo, or trademarks, including IDRIX,
  140 VeraCrypt and all derivative names.
  141 For example, the following names are not allowed: VeraCrypt,
  142 VeraCrypt+, VeraCrypt Professional, iVeraCrypt, etc. Nor any
  143 other names confusingly similar to the name VeraCrypt (e.g.,
  144 Vera-Crypt, Vera Crypt, VerKrypt, etc.)
  145 ____________________________________________________________
  146 
  147 Apache License
  148 Version 2.0, January 2004
  149 https://www.apache.org/licenses/
  150 
  151 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  152 
  153 1. Definitions.
  154 
  155 "License" shall mean the terms and conditions for use,
  156 reproduction, and distribution as defined by Sections 1 through
  157 9 of this document.
  158 
  159 "Licensor" shall mean the copyright owner or entity authorized
  160 by the copyright owner that is granting the License.
  161 
  162 "Legal Entity" shall mean the union of the acting entity and all
  163 other entities that control, are controlled by, or are under
  164 common control with that entity. For the purposes of this
  165 definition, "control" means (i) the power, direct or indirect,
  166 to cause the direction or management of such entity, whether by
  167 contract or otherwise, or (ii) ownership of fifty percent (50%)
  168 or more of the outstanding shares, or (iii) beneficial ownership
  169 of such entity.
  170 
  171 "You" (or "Your") shall mean an individual or Legal Entity
  172 exercising permissions granted by this License.
  173 
  174 "Source" form shall mean the preferred form for making
  175 modifications, including but not limited to software source
  176 code, documentation source, and configuration files.
  177 
  178 "Object" form shall mean any form resulting from mechanical
  179 transformation or translation of a Source form, including but
  180 not limited to compiled object code, generated documentation,
  181 and conversions to other media types.
  182 
  183 "Work" shall mean the work of authorship, whether in Source or
  184 Object form, made available under the License, as indicated by
  185 a copyright notice that is included in or attached to the work
  186 (an example is provided in the Appendix below).
  187 
  188 "Derivative Works" shall mean any work, whether in Source or
  189 Object form, that is based on (or derived from) the Work and
  190 for which the editorial revisions, annotations, elaborations, or
  191 other modifications represent, as a whole, an original work of
  192 authorship. For the purposes of this License, Derivative Works
  193 shall not include works that remain separable from, or merely
  194 link (or bind by name) to the interfaces of, the Work and
  195 Derivative Works thereof.
  196 
  197 "Contribution" shall mean any work of authorship, including
  198 the original version of the Work and any modifications or
  199 additions to that Work or Derivative Works thereof, that is
  200 intentionally submitted to Licensor for inclusion in the Work by
  201 the copyright owner or by an individual or Legal Entity
  202 authorized to submit on behalf of the copyright owner. For the
  203 purposes of this definition, "submitted" means any form
  204 of electronic, verbal, or written communication sent to the
  205 Licensor or its representatives, including but not limited to
  206 communication on electronic mailing lists, source code control
  207 systems, and issue tracking systems that are managed by, or on
  208 behalf of, the Licensor for the purpose of discussing and
  209 improving the Work, but excluding communication that is
  210 conspicuously marked or otherwise designated in writing by the
  211 copyright owner as "Not a Contribution."
  212 
  213 "Contributor" shall mean Licensor and any individual or Legal
  214 Entity on behalf of whom a Contribution has been received by
  215 Licensor and subsequently incorporated within the Work.
  216 
  217 2. Grant of Copyright License. Subject to the terms and
  218 conditions of this License, each Contributor hereby grants to
  219 You a perpetual, worldwide, non-exclusive, no-charge,
  220 royalty-free, irrevocable copyright license to reproduce,
  221 prepare Derivative Works of, publicly display, publicly perform,
  222 sublicense, and distribute the Work and such Derivative Works
  223 in Source or Object form.
  224 
  225 3. Grant of Patent License. Subject to the terms and conditions
  226 of this License, each Contributor hereby grants to You a
  227 perpetual, worldwide, non-exclusive, no-charge, royalty-free,
  228 irrevocable(except as stated in this section) patent license
  229 to make, have made, use, offer to sell, sell, import, and
  230 otherwise transfer the Work, where such license applies only
  231 to those patent claims licensable by such Contributor that are
  232 necessarily infringed by their Contribution(s) alone or by
  233 combination of their Contribution(s) with the Work to which such
  234 Contribution(s) was submitted. If You institute patent
  235 litigation against any entity (including a cross-claim or
  236 counterclaim in a lawsuit) alleging that the Work or a
  237 Contribution incorporated within the Work constitutes direct or
  238 contributory patent infringement, then any patent licenses
  239 granted to You under this License for that Work shall terminate
  240 as of the date such litigation is filed.
  241 
  242 4. Redistribution. You may reproduce and distribute copies of
  243 the Work or Derivative Works thereof in any medium, with or
  244 without modifications, and in Source or Object form, provided
  245 that You meet the following conditions:
  246 
  247 (a) You must give any other recipients of the Work or Derivative
  248     Works a copy of this License; and
  249 (b) You must cause any modified files to carry prominent notices
  250     stating that You changed the files; and
  251 (c) You must retain, in the Source form of any Derivative Works
  252     that You distribute, all copyright, patent, trademark, and
  253     attribution notices from the Source form of the Work,
  254     excluding those notices that do not pertain to any part of
  255     the Derivative Works; and
  256 (d) If the Work includes a "NOTICE" text file as part of its
  257     distribution, then any Derivative Works that You distribute
  258     must include a readable copy of the attribution notices
  259     contained within such NOTICE file, excluding those notices
  260     that do not pertain to any part of the Derivative Works, in
  261     at least one of the following places: within a NOTICE text
  262     file distributed as part of the Derivative Works; within the
  263     Source form or documentation, if provided along with the
  264     Derivative Works; or, within a display generated by the
  265     Derivative Works, if and wherever such third-party notices
  266     normally appear. The contents of the NOTICE file are for
  267     informational purposes only and do not modify the License.
  268     You may add Your own attribution notices within Derivative
  269     Works that You distribute, alongside or as an addendum to
  270     the NOTICE text from the Work, provided that such additional
  271     attribution notices cannot be construed as modifying
  272     the License.
  273 
  274 You may add Your own copyright statement to Your modifications
  275 and may provide additional or different license terms
  276 and conditions for use, reproduction, or distribution of
  277 Your modifications, or for any such Derivative Works as a whole,
  278 provided Your use, reproduction, and distribution of the Work
  279 otherwise complies with the conditions stated in this License.
  280 
  281 5. Submission of Contributions. Unless You explicitly state
  282 otherwise, any Contribution intentionally submitted for
  283 inclusion in the Work by You to the Licensor shall be under the
  284 terms and conditions of this License, without any additional
  285 terms or conditions. Notwithstanding the above, nothing herein
  286 shall supersede or modify the terms of any separate license
  287 agreement you may have executed with Licensor regarding such
  288 Contributions.
  289 
  290 6. Trademarks. This License does not grant permission to use the
  291 trade names, trademarks, service marks, or product names of the
  292 Licensor, except as required for reasonable and customary use in
  293 describing the origin of the Work and reproducing the content of
  294 the NOTICE file.
  295 
  296 7. Disclaimer of Warranty. Unless required by applicable law or
  297 agreed to in writing, Licensor provides the Work (and each
  298 Contributor provides its Contributions) on an "AS IS" BASIS,
  299 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  300 implied, including, without limitation, any warranties or
  301 conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
  302 or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible
  303 for determining the appropriateness of using or redistributing
  304 the Work and assume any risks associated with Your exercise of
  305 permissions under this License.
  306 
  307 8. Limitation of Liability. In no event and under no legal
  308 theory, whether in tort (including negligence), contract,
  309 or otherwise, unless required by applicable law (such as
  310 deliberate and grossly negligent acts) or agreed to in writing,
  311 shall any Contributor be liable to You for damages, including
  312 any direct, indirect, special, incidental, or consequential
  313 damages of any character arising as a result of this License or
  314 out of the use or inability to use the Work (including but not
  315 limited to damages for loss of goodwill, work stoppage, computer
  316 failure or malfunction, or any and all other commercial damages
  317 or losses), even if such Contributor has been advised of the
  318 possibility of such damages.
  319 
  320 9. Accepting Warranty or Additional Liability. While
  321 redistributing the Work or Derivative Works thereof, You may
  322 choose to offer, and charge a fee for, acceptance of support,
  323 warranty, indemnity, or other liability obligations and/or
  324 rights consistent with this License. However, in accepting such
  325 obligations, You may act only on Your own behalf and on Your
  326 sole responsibility, not on behalf of any other Contributor,
  327 and only if You agree to indemnify, defend, and hold each
  328 Contributor harmless for any liability incurred by, or claims
  329 asserted against, such Contributor by reason of your accepting
  330 any such warranty or additional liability.
  331 ____________________________________________________________
  332 
  333 TrueCrypt License Version 3.0
  334 
  335 Software distributed under this license is distributed on an "AS
  336 IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
  337 DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
  338 USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
  339 SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
  340 BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
  341 ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
  342 SOFTWARE, NOR ANY PART(S) THEREOF.
  343 
  344 
  345 I. Definitions
  346 
  347 1. "This Product" means the work (including, but not limited to,
  348 source code, graphics, texts, and accompanying files) made
  349 available under and governed by this version of this license
  350 ("License"), as may be indicated by, but is not limited to,
  351 copyright notice(s) attached to or included in the work.
  352 
  353 2. "You" means (and "Your" refers to) an individual or a legal
  354 entity (e.g., a non-profit organization, commercial
  355 organization, government agency, etc.) exercising permissions
  356 granted by this License.
  357 
  358 3. "Modification" means (and "modify" refers to) any alteration
  359 of This Product, including, but not limited to, addition to or
  360 deletion from the substance or structure of This Product,
  361 translation into another language, repackaging, alteration or
  362 removal of any file included with This Product, and addition of
  363 any new files to This Product.
  364 
  365 4. "Your Product" means This Product modified by You, or any
  366 work You derive from (or base on) any part of This Product. In
  367 addition, "Your Product" means any work in which You include any
  368 (modified or unmodified) portion of This Product. However, if
  369 the work in which you include it is an aggregate software
  370 distribution (such as an operating system distribution or a
  371 cover CD-ROM of a magazine) containing multiple separate
  372 products, then the term "Your Product" includes only those
  373 products (in the aggregate software distribution) that use,
  374 include, or depend on a modified or unmodified version of This
  375 Product (and the term "Your Product" does not include the whole
  376 aggregate software distribution). For the purposes of this
  377 License, a product suite consisting of two or more products is
  378 considered a single product (operating system distributions and
  379 cover media of magazines are not considered product suites).
  380 
  381 5. "Distribution" means (and "distribute" refers to), regardless
  382 of means or methods, conveyance, transfer, providing, or making
  383 available of This/Your Product or portions thereof to third
  384 parties (including, but not limited to, making This/Your
  385 Product, or portions thereof, available for download to third
  386 parties, whether or not any third party has downloaded the
  387 product, or any portion thereof, made available for download).
  388 
  389 
  390 
  391 II. Use, Copying, and Distribution of This Product
  392 
  393 1. Provided that You comply with all applicable terms and
  394 conditions of this License, You may make copies of This Product
  395 (unmodified) and distribute copies of This Product (unmodified)
  396 that are not included in another product forming Your Product
  397 (except as permitted under Chapter III). Note: For terms and
  398 conditions for copying and distribution of modified versions of
  399 This Product, see Chapter III.
  400 
  401 2. Provided that You comply with all applicable terms and
  402 conditions of this License, You may use This Product freely (see
  403 also Chapter III) on any number of computers/systems for non-
  404 commercial and/or commercial purposes.
  405 
  406 
  407 
  408 III. Modification, Derivation, and Inclusion in Other Products
  409 
  410 1. If all conditions specified in the following paragraphs in
  411 this Chapter (III) are met (for exceptions, see Section III.2)
  412 and if You comply with all other applicable terms and conditions
  413 of this License, You may modify This Product (thus forming Your
  414 Product), derive new works from This Product or portions thereof
  415 (thus forming Your Product), include This Product or portions
  416 thereof in another product (thus forming Your Product, unless
  417 defined otherwise in Chapter I), and You may use (for non-
  418 commercial and/or commercial purposes), copy, and/or distribute
  419 Your Product.
  420 
  421     a. The name of Your Product (or of Your modified version of
  422     This Product) must not contain the name TrueCrypt (for
  423     example, the following names are not allowed: TrueCrypt,
  424     TrueCrypt+, TrueCrypt Professional, iTrueCrypt, etc.) nor
  425     any other names confusingly similar to the name TrueCrypt
  426     (e.g., True-Crypt, True Crypt, TruKrypt, etc.)
  427 
  428     All occurrences of the name TrueCrypt that could reasonably
  429     be considered to identify Your Product must be removed from
  430     Your Product and from any associated materials. Logo(s)
  431     included in (or attached to) Your Product (and in/to
  432     associated materials) must not incorporate and must not be
  433     confusingly similar to any of the TrueCrypt logos
  434     (including, but not limited to, the non-textual logo
  435     consisting primarily of a key in stylized form) or
  436     portion(s) thereof. All graphics contained in This Product
  437     (logos, icons, etc.) must be removed from Your Product (or
  438     from Your modified version of This Product) and from any
  439     associated materials.
  440 
  441     b. The following phrases must be removed from Your Product
  442     and from any associated materials, except the text of this
  443     License: "A TrueCrypt Foundation Release", "Released by
  444     TrueCrypt Foundation", "This is a TrueCrypt Foundation
  445     release."
  446 
  447     c. Phrase "Based on TrueCrypt, freely available at
  448     http://www.truecrypt.org/" must be displayed by Your Product
  449     (if technically feasible) and contained in its
  450     documentation. Alternatively, if This Product or its portion
  451     You included in Your Product constitutes only a minor
  452     portion of Your Product, phrase "Portions of this product
  453     are based in part on TrueCrypt, freely available at
  454     http://www.truecrypt.org/" may be displayed instead. In each
  455     of the cases mentioned above in this paragraph,
  456     "http://www.truecrypt.org/" must be a hyperlink (if
  457     technically feasible) pointing to http://www.truecrypt.org/
  458     and You may freely choose the location within the user
  459     interface (if there is any) of Your Product (e.g., an
  460     "About" window, etc.) and the way in which Your Product will
  461     display the respective phrase.
  462 
  463     Your Product (and any associated materials, e.g., the
  464     documentation, the content of the official web site of Your
  465     Product, etc.) must not present any Internet address
  466     containing the domain name truecrypt.org (or any domain name
  467     that forwards to the domain name truecrypt.org) in a manner
  468     that might suggest that it is where information about Your
  469     Product may be obtained or where bugs found in Your Product
  470     may be reported or where support for Your Product may be
  471     available or otherwise attempt to indicate that the domain
  472     name truecrypt.org is associated with Your Product.
  473 
  474     d. The complete source code of Your Product must be freely
  475     and publicly available (for exceptions, see Section III.2)
  476     at least until You cease to distribute Your Product. This
  477     condition can be met in one or both of the following ways:
  478     (i) You include the complete source code of Your Product
  479     with every copy of Your Product that You make and distribute
  480     and You make all such copies of Your Product available to
  481     the general public free of charge, and/or (ii) You include
  482     information (valid and correct at least until You cease to
  483     distribute Your Product) about where the complete source
  484     code of Your Product can be obtained free of charge (e.g.,
  485     an Internet address) or for a reasonable reproduction fee
  486     with every copy of Your Product that You make and distribute
  487     and, if there is a web site officially associated with Your
  488     Product, You include the aforementioned information about
  489     the source code on a freely and publicly accessible web
  490     page to which such web site links via an easily viewable
  491     hyperlink (at least until You cease to distribute Your
  492     Product).
  493 
  494     The source code of Your Product must not be deliberately
  495     obfuscated and it must not be in an intermediate form (e.g.,
  496     the output of a preprocessor). Source code means the
  497     preferred form in which a programmer would usually modify
  498     the program.
  499 
  500     Portions of the source code of Your Product not contained in
  501     This Product (e.g., portions added by You in creating Your
  502     Product, whether created by You or by third parties) must be
  503     available under license(s) that (however, see also
  504     Subsection III.1.e) allow(s) anyone to modify and derive new
  505     works from the portions of the source code that are not
  506     contained in This Product and to use, copy, and redistribute
  507     such modifications and/or derivative works. The license(s)
  508     must be perpetual, non-exclusive, royalty-free, no-charge,
  509     and worldwide, and must not invalidate, weaken, restrict,
  510     interpret, amend, modify, interfere with or otherwise affect
  511     any part, term, provision, or clause of this License. The
  512     text(s) of the license(s) must be included with every copy
  513     of Your Product that You make and distribute.
  514 
  515     e. You must not change the license terms of This Product in
  516     any way (adding any new terms is considered changing the
  517     license terms even if the original terms are retained),
  518     which means, e.g., that no part of This Product may be put
  519     under another license. You must keep intact all the legal
  520     notices contained in the source code files. You must include
  521     the following items with every copy of Your Product that You
  522     make and distribute: a clear and conspicuous notice stating
  523     that Your Product or portion(s) thereof is/are governed by
  524     this version of the TrueCrypt License, a verbatim copy of
  525     this version of the TrueCrypt License (as contained herein),
  526     a clear and conspicuous notice containing information about
  527     where the included copy of the License can be found, and an
  528     appropriate copyright notice.
  529 
  530 
  531 2. You are not obligated to comply with Subsection III.1.d if
  532 Your Product is not distributed (i.e., Your Product is available
  533 only to You).
  534 
  535 
  536 
  537 IV. Disclaimer of Liability, Disclaimer of Warranty,
  538 Indemnification
  539 
  540 You expressly acknowledge and agree to the following:
  541 
  542 1. IN NO EVENT WILL ANY (CO)AUTHOR OF THIS PRODUCT, OR ANY
  543 APPLICABLE INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY WHO
  544 MAY COPY AND/OR (RE)DISTRIBUTE THIS PRODUCT OR PORTIONS THEREOF,
  545 AS MAY BE PERMITTED HEREIN, BE LIABLE TO YOU OR TO ANY OTHER
  546 PARTY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, ANY
  547 DIRECT, INDIRECT, GENERAL, SPECIAL, INCIDENTAL, PUNITIVE,
  548 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  549 TO, CORRUPTION OR LOSS OF DATA, ANY LOSSES SUSTAINED BY YOU OR
  550 THIRD PARTIES, A FAILURE OF THIS PRODUCT TO OPERATE WITH ANY
  551 OTHER PRODUCT, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR
  552 BUSINESS INTERRUPTION), WHETHER IN CONTRACT, STRICT LIABILITY,
  553 TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE) OR OTHERWISE,
  554 ARISING OUT OF THE USE, COPYING, MODIFICATION, OR
  555 (RE)DISTRIBUTION OF THIS PRODUCT (OR A PORTION THEREOF) OR OF
  556 YOUR PRODUCT (OR A PORTION THEREOF), OR INABILITY TO USE THIS
  557 PRODUCT (OR A PORTION THEREOF), EVEN IF SUCH DAMAGES (OR THE
  558 POSSIBILITY OF SUCH DAMAGES) ARE/WERE PREDICTABLE OR KNOWN TO
  559 ANY (CO)AUTHOR, INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY.
  560 
  561 2. THIS PRODUCT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  562 KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
  563 LIMITED TO, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  564 PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE ENTIRE RISK AS TO
  565 THE QUALITY AND PERFORMANCE OF THIS PRODUCT IS WITH YOU. SHOULD
  566 THIS PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
  567 NECESSARY SERVICING, REPAIR, OR CORRECTION.
  568 
  569 3. THIS PRODUCT MAY INCORPORATE IMPLEMENTATIONS OF CRYPTOGRAPHIC
  570 ALGORITHMS THAT ARE REGULATED (E.G., SUBJECT TO EXPORT/IMPORT
  571 CONTROL REGULATIONS) OR ILLEGAL IN SOME COUNTRIES. IT IS SOLELY
  572 YOUR RESPONSIBILITY TO VERIFY THAT IT IS LEGAL TO IMPORT AND/OR
  573 (RE)EXPORT AND/OR USE THIS PRODUCT (OR PORTIONS THEREOF) IN
  574 COUNTRIES WHERE YOU INTEND TO USE IT AND/OR TO WHICH YOU INTEND
  575 TO IMPORT IT AND/OR FROM WHICH YOU INTEND TO EXPORT IT, AND IT
  576 IS SOLELY YOUR RESPONSIBILITY TO COMPLY WITH ANY APPLICABLE
  577 REGULATIONS, RESTRICTIONS, AND LAWS.
  578 
  579 4. YOU SHALL INDEMNIFY, DEFEND AND HOLD ALL (CO)AUTHORS OF THIS
  580 PRODUCT, AND APPLICABLE INTELLECTUAL-PROPERTY OWNERS, HARMLESS
  581 FROM AND AGAINST ANY AND ALL LIABILITY, DAMAGES, LOSSES,
  582 SETTLEMENTS, PENALTIES, FINES, COSTS, EXPENSES (INCLUDING
  583 REASONABLE ATTORNEYS' FEES), DEMANDS, CAUSES OF ACTION, CLAIMS,
  584 ACTIONS, PROCEEDINGS, AND SUITS, DIRECTLY RELATED TO OR ARISING
  585 OUT OF YOUR USE, INABILITY TO USE, COPYING, (RE)DISTRIBUTION,
  586 IMPORT AND/OR (RE)EXPORT OF THIS PRODUCT (OR PORTIONS THEREOF)
  587 AND/OR YOUR BREACH OF ANY TERM OF THIS LICENSE.
  588 
  589 
  590 
  591 V. Trademarks
  592 
  593 This License does not grant permission to use trademarks
  594 associated with (or applying to) This Product, except for fair
  595 use as defined by applicable law and except for use expressly
  596 permitted or required by this License. Any attempt otherwise to
  597 use trademarks associated with (or applying to) This Product
  598 automatically and immediately terminates Your rights under This
  599 License and may constitute trademark infringement (which may be
  600 prosecuted).
  601 
  602 
  603 
  604 VI. General Terms and Conditions, Miscellaneous Provisions
  605 
  606 1. ANYONE WHO USES AND/OR COPIES AND/OR MODIFIES AND/OR CREATES
  607 DERIVATIVE WORKS OF AND/OR (RE)DISTRIBUTES THIS PRODUCT, OR ANY
  608 PORTION(S) THEREOF, IS, BY SUCH ACTION(S), AGREEING TO BE BOUND
  609 BY AND ACCEPTING ALL TERMS AND CONDITIONS OF THIS LICENSE (AND
  610 THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE).
  611 IF YOU DO NOT ACCEPT (AND AGREE TO BE BOUND BY) ALL TERMS AND
  612 CONDITIONS OF THIS LICENSE, DO NOT USE, COPY, MODIFY, CREATE
  613 DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
  614 PORTION(S) THEREOF.
  615 
  616 2. YOU MAY NOT USE, MODIFY, COPY, CREATE DERIVATIVE WORKS OF,
  617 (RE)DISTRIBUTE, OR SUBLICENSE THIS PRODUCT, OR PORTION(S)
  618 THEREOF, EXCEPT AS EXPRESSLY PROVIDED IN THIS LICENSE (EVEN IF
  619 APPLICABLE LAW GIVES YOU MORE RIGHTS). ANY ATTEMPT (EVEN IF
  620 PERMITTED BY APPLICABLE LAW) OTHERWISE TO USE, MODIFY, COPY,
  621 CREATE DERIVATIVE WORKS OF, (RE)DISTRIBUTE, OR SUBLICENSE THIS
  622 PRODUCT, OR PORTION(S) THEREOF, AUTOMATICALLY AND IMMEDIATELY
  623 TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN CONSTITUTE
  624 COPYRIGHT INFRINGEMENT (WHICH MAY BE PROSECUTED). ANY CONDITIONS
  625 AND RESTRICTIONS CONTAINED IN THIS LICENSE ARE ALSO LIMITATIONS
  626 ON THE SCOPE OF THIS LICENSE AND ALSO DEFINE THE SCOPE OF YOUR
  627 RIGHTS UNDER THIS LICENSE. YOUR FAILURE TO COMPLY WITH THE TERMS
  628 AND CONDITIONS OF THIS LICENSE OR FAILURE TO PERFORM ANY
  629 APPLICABLE OBLIGATION IMPOSED BY THIS LICENSE AUTOMATICALLY AND
  630 IMMEDIATELY TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN
  631 CAUSE OR BE CONSIDERED COPYRIGHT INFRINGEMENT (WHICH MAY BE
  632 PROSECUTED). NOTHING IN THIS LICENSE SHALL IMPLY OR BE CONSTRUED
  633 AS A PROMISE, OBLIGATION, OR COVENANT NOT TO SUE FOR COPYRIGHT
  634 OR TRADEMARK INFRINGEMENT IF YOU DO NOT COMPLY WITH THE TERMS
  635 AND CONDITIONS OF THIS LICENSE.
  636 
  637 3. This License does not constitute or imply a waiver of any
  638 intellectual property rights except as may be otherwise
  639 expressly provided in this License. This License does not
  640 transfer, assign, or convey any intellectual property rights
  641 (e.g., it does not transfer ownership of copyrights or
  642 trademarks).
  643 
  644 4. Subject to the terms and conditions of this License, You may
  645 allow a third party to use Your copy of This Product (or a copy
  646 that You make and distribute, or Your Product) provided that the
  647 third party explicitly accepts and agrees to be bound by all
  648 terms and conditions of this License and the third party is not
  649 prohibited from using This Product (or portions thereof) by this
  650 License (see, e.g., Section VI.7) or by applicable law. However,
  651 You are not obligated to ensure that the third party accepts
  652 (and agrees to be bound by all terms of) this License if You
  653 distribute only the self-extracting package (containing This
  654 Product) that does not allow the user to install (nor extract)
  655 the files contained in the package until he or she accepts and
  656 agrees to be bound by all terms and conditions of this License.
  657 
  658 5. Without specific prior written permission from the authors of
  659 This Product (or from their common representative), You must not
  660 use the name of This Product, the names of the authors of This
  661 Product, or the names of the legal entities (or informal groups)
  662 of which the authors were/are members/employees, to endorse or
  663 promote Your Product or any work in which You include a modified
  664 or unmodified version of This Product, or to endorse or promote
  665 You or Your affiliates, or in a way that might suggest that Your
  666 Product (or any work in which You include a modified or
  667 unmodified version of This Product), You, or Your affiliates
  668 is/are endorsed by one or more authors of This Product, or in a
  669 way that might suggest that one or more authors of This Product
  670 is/are affiliated with You (or Your affiliates) or directly
  671 participated in the creation of Your Product or of any work in
  672 which You include a modified or unmodified version of This
  673 Product.
  674 
  675 6. IF YOU ARE NOT SURE WHETHER YOU UNDERSTAND ALL PARTS OF THIS
  676 LICENSE OR IF YOU ARE NOT SURE WHETHER YOU CAN COMPLY WITH ALL
  677 TERMS AND CONDITIONS OF THIS LICENSE, YOU MUST NOT USE, COPY,
  678 MODIFY, CREATE DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS
  679 PRODUCT, NOR ANY PORTION(S) OF IT. YOU SHOULD CONSULT WITH A
  680 LAWYER.
  681 
  682 7. IF (IN RELEVANT CONTEXT) ANY PROVISION OF CHAPTER IV OF THIS
  683 LICENSE IS UNENFORCEABLE, INVALID, OR PROHIBITED UNDER
  684 APPLICABLE LAW IN YOUR JURISDICTION, YOU HAVE NO RIGHTS UNDER
  685 THIS LICENSE AND YOU MUST NOT USE, COPY, MODIFY, CREATE
  686 DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
  687 PORTION(S) THEREOF.
  688 
  689 8. Except as otherwise provided in this License, if any
  690 provision of this License, or a portion thereof, is found to be
  691 invalid or unenforceable under applicable law, it shall not
  692 affect the validity or enforceability of the remainder of this
  693 License, and such invalid or unenforceable provision shall be
  694 construed to reflect the original intent of the provision and
  695 shall be enforced to the maximum extent permitted by applicable
  696 law so as to effect the original intent of the provision as
  697 closely as possible.
  698 
  699 ____________________________________________________________
  700 
  701 
  702 Third-Party Licenses
  703 
  704 This Product contains components that were created by third
  705 parties and that are governed by third-party licenses, which are
  706 contained hereinafter (separated by lines consisting of
  707 underscores). Each of the third-party licenses applies only to
  708 (portions of) the source code file(s) in which the third-party
  709 license is contained or in which it is explicitly referenced,
  710 and to compiled or otherwise processed forms of such source
  711 code. None of the third-party licenses applies to This Product
  712 as a whole, even when it uses terms such as "product",
  713 "program", or any other equivalent terms/phrases. This Product
  714 as a whole is governed by the TrueCrypt License (see above).
  715 Some of the third-party components have been modified by the
  716 authors of This Product. Unless otherwise stated, such
  717 modifications and additions are governed by the TrueCrypt
  718 License (see above). Note: Unless otherwise stated, graphics and
  719 files that are not part of the source code are governed by the
  720 TrueCrypt License.
  721 
  722 ____________________________________________________________
  723 
  724 License agreement for Encryption for the Masses.
  725 
  726 Copyright (C) 1998-2000 Paul Le Roux. All Rights Reserved.
  727 
  728 This product can be copied and distributed free of charge,
  729 including source code.
  730 
  731 You may modify this product and source code, and distribute such
  732 modifications, and you may derive new works based on this
  733 product, provided that:
  734 
  735 1. Any product which is simply derived from this product cannot
  736 be called E4M, or Encryption for the Masses.
  737 
  738 2. If you use any of the source code in your product, and your
  739 product is distributed with source code, you must include this
  740 notice with those portions of this source code that you use.
  741 
  742 Or,
  743 
  744 If your product is distributed in binary form only, you must
  745 display on any packaging, and marketing materials which
  746 reference your product, a notice which states:
  747 
  748 "This product uses components written by Paul Le Roux
  749 <pleroux@swprofessionals.com>"
  750 
  751 3. If you use any of the source code originally by Eric Young,
  752 you must in addition follow his terms and conditions.
  753 
  754 4. Nothing requires that you accept this License, as you have
  755 not signed it. However, nothing else grants you permission to
  756 modify or distribute the product or its derivative works.
  757 
  758 These actions are prohibited by law if you do not accept this
  759 License.
  760 
  761 5. If any of these license terms is found to be to broad in
  762 scope, and declared invalid by any court or legal process, you
  763 agree that all other terms shall not be so affected, and shall
  764 remain valid and enforceable.
  765 
  766 6. THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE, THEREFORE THERE
  767 IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  768 APPLICABLE LAW. UNLESS OTHERWISE STATED THE PROGRAM IS PROVIDED
  769 "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
  770 IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  771 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
  772 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
  773 WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
  774 COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  775 
  776 7. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  777 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  778 MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  779 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  780 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  781 INABILITY TO USE THE PROGRAM, INCLUDING BUT NOT LIMITED TO LOSS
  782 OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  783 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
  784 ANY OTHER PROGRAMS, EVEN IF SUCH HOLDER OR OTHER PARTY HAD
  785 PREVIOUSLY BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  786 ____________________________________________________________
  787 
  788 Copyright (c) 1998-2008, Brian Gladman, Worcester, UK.
  789 All rights reserved.
  790 
  791 LICENSE TERMS
  792 
  793 The free distribution and use of this software is allowed (with
  794 or without changes) provided that:
  795 
  796  1. source code distributions include the above copyright
  797     notice, this list of conditions and the following
  798     disclaimer;
  799 
  800  2. binary distributions include the above copyright notice,
  801     this list of conditions and the following disclaimer in
  802     their documentation;
  803 
  804  3. the name of the copyright holder is not used to endorse
  805     products built using this software without specific written
  806     permission.
  807 
  808 DISCLAIMER
  809 
  810 This software is provided 'as is' with no explicit or implied
  811 warranties in respect of its properties, including, but not
  812 limited to, correctness and/or fitness for purpose.
  813 ____________________________________________________________
  814 
  815 Copyright (C) 2002-2004 Mark Adler, all rights reserved
  816 version 1.8, 9 Jan 2004
  817 
  818 This software is provided 'as-is', without any express or
  819 implied warranty.  In no event will the author be held liable
  820 for any damages arising from the use of this software.
  821 
  822 Permission is granted to anyone to use this software for any
  823 purpose, including commercial applications, and to alter it and
  824 redistribute it freely, subject to the following restrictions:
  825 
  826 1. The origin of this software must not be misrepresented; you
  827    must not claim that you wrote the original software. If you
  828    use this software in a product, an acknowledgment in the
  829    product documentation would be appreciated but is not
  830    required.
  831 2. Altered source versions must be plainly marked as such, and
  832    must not be misrepresented as being the original software.
  833 3. This notice may not be removed or altered from any source
  834    distribution.
  835 ____________________________________________________________
  836 _LICENSE_END
  837 
  838 [ $? -ne 0 ] && show_exit_message 'Error while extracting license' && exit 1
  839 
  840 
  841 # Task selection
  842 
  843 INSTALL=-1
  844 
  845 if [ $XMESSAGE -eq 1 ]
  846 then
  847 
  848     cat <<_END | xmessage -center -file - -buttons "Exit:1,Extract .$PACKAGE_TYPE Package File:20,Install VeraCrypt:10" -default 'Install VeraCrypt'
  849 VeraCrypt $VERSION Setup
  850 ====================
  851  VeraCrypt is a free disk encryption software brought to you by IDRIX
  852  (http://www.idrix.fr) and that is based on TrueCrypt.
  853  It is a software system for establishing and maintaining an
  854  on-the-fly-encrypted volume (data storage device). On-the-fly encryption
  855  means that data are automatically encrypted or decrypted right before they
  856  are loaded or saved, without any user intervention. No data stored on an
  857  encrypted volume can be read (decrypted) without using the correct
  858  password/keyfile(s) or correct encryption keys. Entire file system is
  859  encrypted (e.g., file names, folder names, contents of every file,
  860  free space, meta data, etc).
  861 
  862 Please select one of the below options:
  863 
  864 _END
  865 
  866     SEL=$?
  867 
  868     case $SEL in
  869         1)  exit 1
  870             ;;
  871         10) INSTALL=1
  872             ;;
  873         20) INSTALL=0
  874             ;;
  875     esac
  876 
  877 else
  878 
  879     while [ $INSTALL -eq -1 ]
  880     do
  881         clear
  882         cat <<_MENU_END
  883 VeraCrypt $VERSION Setup
  884 ____________________
  885 
  886 
  887 Installation options:
  888 
  889  1) Install $PACKAGE_NAME
  890  2) Extract package file $PACKAGE_NAME and place it to $PACKAGE_DIR
  891 
  892 _MENU_END
  893 
  894         printf 'To select, enter 1 or 2: '
  895 
  896         read SEL
  897         [ -z "$SEL" ] && SEL=1
  898 
  899         case $SEL in
  900             1)  INSTALL=1
  901                 ;;
  902             2)  INSTALL=0
  903                 ;;
  904         esac
  905     done
  906 
  907 fi
  908 
  909 
  910 # Administrator privileges check
  911 
  912 SUDO=sudo
  913 
  914 if [ $INSTALL -eq 1 -a $(id -u) -ne 0 ]
  915 then
  916     if ! which $SUDO >/dev/null 2>/dev/null
  917     then
  918         show_exit_message "Error: Administrator privileges required ($SUDO command is not installed)"
  919         rm -f $LICENSE
  920         exit 1
  921     fi
  922 else
  923     unset SUDO
  924 fi
  925 
  926 [ -n "$SUDO" -a $GUI -eq 1 ] && which gksudo >/dev/null 2>/dev/null && SUDO="gksudo -D 'VeraCrypt Setup' --"
  927 [ -n "$SUDO" -a $GUI -eq 1 ] && which kdesudo >/dev/null 2>/dev/null && SUDO="kdesudo -d --comment 'VeraCrypt Setup' --"
  928 
  929 
  930 # License agreement
  931 
  932 if [ $XMESSAGE -eq 1 ]
  933 then
  934 
  935 # GUI license agreement
  936 
  937     cat <<_END | cat - $LICENSE | xmessage -center -file - -buttons 'I accept and agree to be bound by the license terms:10,I do not accept:20'
  938 
  939 Before you can use, extract, or install VeraCrypt, you must accept these
  940 license terms.
  941 
  942 IMPORTANT: By clicking the left button below this text field, you accept
  943 these license terms and agree to be bound by and to comply with them.
  944 Press Page Down key or use the scroll bar to see the rest of the license.
  945 
  946 
  947 
  948 _END
  949 
  950     SEL=$?
  951 
  952     rm -f $LICENSE
  953     if [ $SEL -ne 10 ]
  954     then
  955         show_exit_message 'Installation/extraction aborted'
  956         exit 1
  957     fi
  958 
  959 else
  960 
  961 # Console license agreement
  962 
  963 printf '\nBefore you can use, extract, or install VeraCrypt, you must accept the\n'
  964 printf 'terms of the VeraCrypt License.\n\nPress Enter to display the license terms... '
  965 read A
  966 
  967 MORE=more
  968 HASLESS=0
  969 which less >/dev/null 2>/dev/null && HASLESS=1
  970 if [ $HASLESS -eq 1 ]
  971 then
  972     MORE='less -E -X'
  973 fi
  974     cat <<_END | cat - $LICENSE | $MORE
  975 
  976 Press Enter or space bar to see the rest of the license.
  977 
  978 
  979 _END
  980     if [ $? -ne 0 ]
  981     then
  982         if [ $HASLESS -eq 1 ]
  983         then
  984 # use less without -X as it is not supported by some versions (busybox case)
  985             MORE='less -E'
  986             cat <<_END | cat - $LICENSE | $MORE
  987 
  988 Press Enter or space bar to see the rest of the license.
  989 
  990 
  991 _END
  992             [ $? -ne 0 ] && exit 1
  993         else
  994             exit 1
  995         fi
  996     fi
  997 
  998     rm -f $LICENSE
  999 
 1000     ACCEPTED=0
 1001     while [ $ACCEPTED -eq 0 ]
 1002     do
 1003         printf '\n\nDo you accept and agree to be bound by the license terms? (yes/no): '
 1004 
 1005         read SEL
 1006 
 1007         case $SEL in
 1008             y|Y|yes|YES)
 1009                 ACCEPTED=1
 1010                 ;;
 1011             n|N|no|NO)
 1012                 exit 0
 1013                 ;;
 1014         esac
 1015     done
 1016 fi
 1017 
 1018 
 1019 # Package extraction
 1020 
 1021 [ $GUI -eq 0 ] && echo
 1022 
 1023 if ! tail -n +$PACKAGE_START "$0" >$PACKAGE
 1024 then
 1025     show_exit_message "Error: Extraction to $PACKAGE failed"
 1026     exit 1
 1027 fi
 1028 
 1029 
 1030 # Package installation
 1031 
 1032 if [ "$PACKAGE_TYPE" = "tar" ]
 1033 then
 1034     if ! which fusermount >/dev/null 2>/dev/null || ! which dmsetup >/dev/null 2>/dev/null
 1035     then
 1036         show_message "$(cat <<_INFO
 1037 Requirements for Running VeraCrypt:
 1038 -----------------------------------
 1039 
 1040  - FUSE library and tools
 1041  - device mapper tools
 1042 
 1043 _INFO
 1044 )"
 1045         [ $GUI -eq 0 ] && echo && echo Press Enter to continue... && read A
 1046     fi
 1047 
 1048     show_message "$(cat <<_INFO
 1049 Uninstalling VeraCrypt:
 1050 -----------------------
 1051 
 1052 To uninstall VeraCrypt, please run 'veracrypt-uninstall.sh'.
 1053 
 1054 _INFO
 1055 )"
 1056     [ $GUI -eq 0 ] && echo
 1057 fi
 1058 
 1059 if [ $INSTALL -eq 1 ]
 1060 then
 1061 
 1062     INSTALLED=0
 1063 
 1064     if [ $GUI -eq 1 ]
 1065     then
 1066         if [ $XTERM -eq 1 ]
 1067         then
 1068             exec xterm -T 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A"
 1069         else
 1070             if [ $GTERM -eq 1 ]
 1071             then
 1072                 exec gnome-terminal --title='VeraCrypt Setup' -e "sh -c \"echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A\""
 1073             else
 1074                 if [ $KTERM -eq 1 ]
 1075                 then
 1076                     exec konsole --title 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A"
 1077                 fi
 1078             fi
 1079         fi
 1080     else
 1081         echo 'Installing package...'
 1082         $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE && INSTALLED=1
 1083 
 1084         if [ $INSTALLED -eq 1 ]
 1085         then
 1086             show_exit_message ''
 1087         fi
 1088     fi
 1089 
 1090     rm -f $PACKAGE
 1091     if [ $INSTALLED -ne 1 ]
 1092     then
 1093         show_exit_message 'Error: VeraCrypt installation failed'
 1094         exit 1
 1095     fi
 1096 else
 1097     show_exit_message "Installation package '$PACKAGE_NAME' extracted and placed in '$PACKAGE_DIR'"
 1098 fi
 1099 
 1100 exit 0