1 #!/bin/sh 2 # 3 # Copyright (c) 1996-2007, Adobe Systems Incorporated 4 # All Rights Reserved 5 # 6 7 8 set_lang_ENU() 9 { 10 ST_ER_AR02="ERROR: Cannot find installation directory." 11 ST_LANG="ENU" 12 ST_SMALL_N="n" 13 ST_ER_AR01="ERROR: Cannot determine current directory." 14 ST_ICE_INFO_03="The website presented the following Certificate" 15 ST_ER_AR04="ERROR: The environment variable TMPDIR points to an invalid path." 16 ST_ICE_INFO_05="Certificate successfully installed." 17 ST_ER_DIR="ERROR: Cannot make directory %s." 18 ST_YES="yes" 19 ST_ER_AR03="ERROR: Cannot find %s." 20 ST_ICE_INFO_07="Unable to find openssl, please make sure the openssl binary is in the PATH" 21 ST_INFO_AR04="Installed platform(s) include the following:" 22 ST_ICE_INFO_09="Read the following Certificate:" 23 ST_VERSION="version" 24 ST_INFO_AR01="The OS named %s is currently not installed." 25 ST_ICE_INFO_04="Do you want to accept and install it (y|n)? " 26 ST_CAPS_Y="Y" 27 ST_ICE_INFO_01="Fetching certificate from website...." 28 ST_ICE_INFO_02="Processing ...." 29 ST_ICE_INFO_08="Not installing the certificate." 30 ST_INFO_AR03="Try running on an installed platform and connecting to your display." 31 ST_ICE_INFO_06="There was a problem installing the certificate" 32 ST_SMALL_Y="y" 33 ST_ER_AR05="%s not installed for this configuration, %s." 34 } 35 36 37 set_lang_JPN() 38 { 39 ST_ER_AR02=" : " 40 ST_LANG="JPN" 41 ST_SMALL_N="n" 42 ST_ER_AR01=" : " 43 ST_ICE_INFO_03="Web " 44 ST_ER_AR04=" : TMPDIR " 45 ST_ICE_INFO_05="" 46 ST_ER_DIR=" : %s " 47 ST_YES="yes" 48 ST_ER_AR03=" : %s " 49 ST_ICE_INFO_07="openssl openssl PATH " 50 ST_INFO_AR04=" : " 51 ST_ICE_INFO_09=":" 52 ST_VERSION="" 53 ST_INFO_AR01="%s OS " 54 ST_ICE_INFO_04=" (y|n) " 55 ST_CAPS_Y="Y" 56 ST_ICE_INFO_01="Web ...." 57 ST_ICE_INFO_02="...." 58 ST_ICE_INFO_08="" 59 ST_INFO_AR03="" 60 ST_ICE_INFO_06="" 61 ST_SMALL_Y="y" 62 ST_ER_AR05="%s %s " 63 } 64 65 66 set_lang_JPN_utf() 67 { 68 ST_ER_AR02=" : " 69 ST_LANG="JPN" 70 ST_SMALL_N="n" 71 ST_ER_AR01=" : " 72 ST_ICE_INFO_03="Web " 73 ST_ER_AR04=" : TMPDIR " 74 ST_ICE_INFO_05="" 75 ST_ER_DIR=" : %s " 76 ST_YES="yes" 77 ST_ER_AR03=" : %s " 78 ST_ICE_INFO_07="openssl openssl PATH " 79 ST_INFO_AR04=" : " 80 ST_ICE_INFO_09=":" 81 ST_VERSION="" 82 ST_INFO_AR01="%s OS " 83 ST_ICE_INFO_04=" (y|n) " 84 ST_CAPS_Y="Y" 85 ST_ICE_INFO_01="Web ...." 86 ST_ICE_INFO_02="...." 87 ST_ICE_INFO_08="" 88 ST_INFO_AR03="" 89 ST_ICE_INFO_06="" 90 ST_SMALL_Y="y" 91 ST_ER_AR05="%s %s " 92 } 93 94 95 set_lang_FRA() 96 { 97 ST_ER_AR02="ERREUR : rpertoire d\'installation introuvable" 98 ST_LANG="FRA" 99 ST_SMALL_N="n" 100 ST_ER_AR01="ERREUR : impossible de dterminer le rpertoire actuel" 101 ST_ICE_INFO_03="Ce site Web a prsent le certificat suivant" 102 ST_ER_AR04="ERREUR : la variable d\'environnement TMPDIR pointe sur un chemin incorrect." 103 ST_ICE_INFO_05="Le certificat a t correctement install." 104 ST_ER_DIR="ERREUR : impossible de crer le rpertoire %s." 105 ST_YES="oui" 106 ST_ER_AR03="ERREUR : impossible de trouver %s." 107 ST_ICE_INFO_07="Impossible de trouver le fichier openssl, assurez-vous que le fichier openssl binaire se trouve dans le chemin." 108 ST_INFO_AR04="Parmi les plate-formes installes figurent les suivantes :" 109 ST_ICE_INFO_09="Veuillez lire le Certificat suivant:" 110 ST_VERSION="version" 111 ST_INFO_AR01="Le systme d\'exploitation %s n\'est pas install." 112 ST_ICE_INFO_04="Voulez-vous l\'accepter et l\'installer (o|n) ? " 113 ST_CAPS_Y="O" 114 ST_ICE_INFO_01="Recherche d\'un certificat sur le site Web...." 115 ST_ICE_INFO_02="Traitement en cours..." 116 ST_ICE_INFO_08="Non installation du certificat." 117 ST_INFO_AR03="Essayez l\'excution sur une plate-forme installe, puis tablissez une connexion votre cran." 118 ST_ICE_INFO_06="Un problme est survenu lors de l\'installation du certificat." 119 ST_SMALL_Y="o" 120 ST_ER_AR05="%s n\'est pas install pour cette configuration, %s." 121 } 122 123 124 set_lang_FRA_utf() 125 { 126 ST_ER_AR02="ERREUR : rpertoire d\'installation introuvable" 127 ST_LANG="FRA" 128 ST_SMALL_N="n" 129 ST_ER_AR01="ERREUR : impossible de dterminer le rpertoire actuel" 130 ST_ICE_INFO_03="Ce site Web a prsent le certificat suivant" 131 ST_ER_AR04="ERREUR : la variable d\'environnement TMPDIR pointe sur un chemin incorrect." 132 ST_ICE_INFO_05="Le certificat a t correctement install." 133 ST_ER_DIR="ERREUR : impossible de crer le rpertoire %s." 134 ST_YES="oui" 135 ST_ER_AR03="ERREUR : impossible de trouver %s." 136 ST_ICE_INFO_07="Impossible de trouver le fichier openssl, assurez-vous que le fichier openssl binaire se trouve dans le chemin." 137 ST_INFO_AR04="Parmi les plate-formes installes figurent les suivantes :" 138 ST_ICE_INFO_09="Veuillez lire le Certificat suivant:" 139 ST_VERSION="version" 140 ST_INFO_AR01="Le systme d\'exploitation %s n\'est pas install." 141 ST_ICE_INFO_04="Voulez-vous l\'accepter et l\'installer (o|n) ? " 142 ST_CAPS_Y="O" 143 ST_ICE_INFO_01="Recherche d\'un certificat sur le site Web...." 144 ST_ICE_INFO_02="Traitement en cours..." 145 ST_ICE_INFO_08="Non installation du certificat." 146 ST_INFO_AR03="Essayez l\'excution sur une plate-forme installe, puis tablissez une connexion votre cran." 147 ST_ICE_INFO_06="Un problme est survenu lors de l\'installation du certificat." 148 ST_SMALL_Y="o" 149 ST_ER_AR05="%s n\'est pas install pour cette configuration, %s." 150 } 151 152 153 set_lang_DEU() 154 { 155 ST_ER_AR02="FEHLER: Aktuelles Installationsverzeichnis kann nicht gefunden werden." 156 ST_LANG="DEU" 157 ST_SMALL_N="n" 158 ST_ER_AR01="FEHLER: Aktuelles Verzeichnis kann nicht ermittelt werden." 159 ST_ICE_INFO_03="Folgendes Zertifikat steht auf der Website zur Verfgung:" 160 ST_ER_AR04="FEHLER: Die Umgebungsvariable TMPDIR verweist auf einen ungltigen Pfad." 161 ST_ICE_INFO_05="Das Zertifikat wurde installiert." 162 ST_ER_DIR="FEHLER: Verzeichnis %s kann nicht erstellt werden." 163 ST_YES="ja" 164 ST_ER_AR03="FEHLER: %s wurde nicht gefunden." 165 ST_ICE_INFO_07="OpenSSL wurde nicht gefunden. Prfen Sie, ob sich die OpenSSL-Binrdatei im Pfad befindet." 166 ST_INFO_AR04="Installierte Plattform(en):" 167 ST_ICE_INFO_09="Lesen des folgenden Zertifikats:" 168 ST_VERSION="Version" 169 ST_INFO_AR01="Das Betriebssystem %s ist derzeit nicht installiert." 170 ST_ICE_INFO_04="Mchten Sie es akzeptieren und installieren (j|n)? " 171 ST_CAPS_Y="J" 172 ST_ICE_INFO_01="Zertifikat wird von Website abgerufen..." 173 ST_ICE_INFO_02="Verarbeitung luft..." 174 ST_ICE_INFO_08="Das Zertifikat wird nicht installiert." 175 ST_INFO_AR03="Fhren Sie den Vorgang auf einer installierten Plattform aus, und verbinden Sie diese mit Ihrem Bildschirm." 176 ST_ICE_INFO_06="Beim Installieren des Zertifikats ist ein Problem aufgetreten." 177 ST_SMALL_Y="j" 178 ST_ER_AR05="%s wurde nicht fr diese Konfiguration installiert, %s." 179 } 180 181 182 set_lang_DEU_utf() 183 { 184 ST_ER_AR02="FEHLER: Aktuelles Installationsverzeichnis kann nicht gefunden werden." 185 ST_LANG="DEU" 186 ST_SMALL_N="n" 187 ST_ER_AR01="FEHLER: Aktuelles Verzeichnis kann nicht ermittelt werden." 188 ST_ICE_INFO_03="Folgendes Zertifikat steht auf der Website zur Verfgung:" 189 ST_ER_AR04="FEHLER: Die Umgebungsvariable TMPDIR verweist auf einen ungltigen Pfad." 190 ST_ICE_INFO_05="Das Zertifikat wurde installiert." 191 ST_ER_DIR="FEHLER: Verzeichnis %s kann nicht erstellt werden." 192 ST_YES="ja" 193 ST_ER_AR03="FEHLER: %s wurde nicht gefunden." 194 ST_ICE_INFO_07="OpenSSL wurde nicht gefunden. Prfen Sie, ob sich die OpenSSL-Binrdatei im Pfad befindet." 195 ST_INFO_AR04="Installierte Plattform(en):" 196 ST_ICE_INFO_09="Lesen des folgenden Zertifikats:" 197 ST_VERSION="Version" 198 ST_INFO_AR01="Das Betriebssystem %s ist derzeit nicht installiert." 199 ST_ICE_INFO_04="Mchten Sie es akzeptieren und installieren (j|n)? " 200 ST_CAPS_Y="J" 201 ST_ICE_INFO_01="Zertifikat wird von Website abgerufen..." 202 ST_ICE_INFO_02="Verarbeitung luft..." 203 ST_ICE_INFO_08="Das Zertifikat wird nicht installiert." 204 ST_INFO_AR03="Fhren Sie den Vorgang auf einer installierten Plattform aus, und verbinden Sie diese mit Ihrem Bildschirm." 205 ST_ICE_INFO_06="Beim Installieren des Zertifikats ist ein Problem aufgetreten." 206 ST_SMALL_Y="j" 207 ST_ER_AR05="%s wurde nicht fr diese Konfiguration installiert, %s." 208 } 209 210 # Determine default language based on current system language. 211 # Defaults to English (ENU). 212 LING=`echo $LC_ALL` 213 LING=${LING:-$LANG} 214 LING=${LING:-$LC_MESSAGES} 215 # check if it's a UTF-8 locale 216 MYUTF8="" 217 echo $LING | grep -i utf > /dev/null 218 219 if [ $? -eq 0 ]; then 220 MYUTF8="_utf" 221 fi 222 223 LING=`echo $LING | sed 's/\(.*\)\.\(.*\)/\1/'` 224 225 case $LING in 226 ja*) MYLANG=JPN;; 227 fr*) MYLANG=FRA;; 228 de*) MYLANG=DEU;; 229 *) MYLANG=ENU;; 230 esac 231 232 if [ $MYLANG != "ENU" ]; then 233 MYLANG="$MYLANG$MYUTF8" 234 fi 235 236 set_lang_${MYLANG} 237 238 ver="9.2" 239 240 if [ "$1" = "-version" ]; then 241 echo "$ver" 242 exit 243 fi 244 245 246 LaunchBinary() 247 { 248 # We are not LSB compliant yet, so let's not use ld-lsb.so.3 as loader. 249 # if [ "`uname -s`" = "Linux" ] && [ ! -x /lib/ld-lsb.so.3 ]; then 250 # exec /lib/ld-linux.so.2 ${1+"$@"} 251 # else 252 exec ${1+"$@"} 253 # fi 254 } 255 256 257 MkTempInternal() 258 { 259 if [ "${mktemp_count+set}" != "set" ]; then 260 mktemp_count="0" 261 fi 262 263 mktemp_file="/tmp/acrobat.$$.${mktemp_count}" 264 265 while /usr/bin/test -e "$mktemp_file" 266 do 267 mktemp_count="`expr $mktemp_count + 1`" 268 mktemp_file="/tmp/acrobat.$$.${mktemp_count}" 269 done 270 271 touch "$mktemp_file" && chmod 600 "$mktemp_file" && echo "$mktemp_file" 272 } 273 274 MkTemp() 275 { 276 MKTEMP="`which mktemp 2>/dev/null`"; 277 if [ "$MKTEMP" != "" ]; then 278 : 279 else 280 MKTEMP="MkTempInternal"; 281 fi 282 283 $MKTEMP /tmp/acrobat.$1 284 } 285 286 readlink() 287 { 288 OLDPWD="`/bin/pwd`" 289 lfile="$1" 290 291 while [ -h "$lfile" -a -f "$lfile" ]; do 292 CWD="`dirname "$lfile"`" 293 if [ "`expr "${CWD}" : "\.\."`" = "2" ]; then 294 CWD="`/bin/pwd`/$CWD" 295 fi 296 lfile="`basename "$lfile"`" 297 cd "$CWD" 298 lfile="`/bin/ls -l "$lfile"|sed 's/^.*-> *\(.*\) *$/\1/'`" 299 done 300 301 if [ -f "$lfile" ]; then 302 CWD="`dirname "$lfile"`" 303 lfile="`basename "$lfile"`" 304 if [ "`expr "${CWD}" : "\.\."`" = "2" ]; then 305 CWD="`/bin/pwd`/$CWD" 306 fi 307 cd "$CWD" 308 echo `/bin/pwd`/$lfile 309 cd "$OLDPWD" 310 return 0 311 fi 312 313 cd "$OLDPWD" 314 return 1 315 } 316 317 318 majorRelease="`echo $ver | cut -d. -f1`.0" 319 cwd="`/bin/pwd 2> /dev/null`" 320 321 if [ -h "$0" ]; then 322 ScriptVariable=`readlink $0` 323 ScriptDirectory=`dirname "$ScriptVariable"` 324 else 325 ScriptDirectory=`dirname "$0"` 326 cd "$ScriptDirectory" 327 ScriptDirectory="`/bin/pwd 2> /dev/null`" 328 cd "$cwd" 329 fi 330 install_dir="`dirname "$ScriptDirectory"`/Reader" 331 332 333 # 334 # Prepend a colon separated environment variable 335 # $1 string to be prepended 336 # $2 environment variable 337 # 338 prepend() 339 { 340 if [ -z "$2" -o "$2" = "$1" ] ; then 341 echo "$1" 342 else 343 first="`expr "$2" : '\([^:]*\):'`" 344 if [ "$first" = "$1" ] ; then 345 echo "$2" 346 else 347 echo "${1}:${2}" 348 fi 349 fi 350 } 351 352 353 # 354 # Tests the version file in an installation directory. 355 # 356 test_install_dir() 357 { 358 if [ "`cat "$1"/AcroVersion 2>/dev/null`" = "$ver" ] ; then 359 return 0 360 else 361 return 1 362 fi 363 } 364 365 366 # 367 # Check a given file in given path 368 # 369 370 Which() 371 { 372 OLD_IFS="$IFS" 373 IFS=":" 374 status=1 375 376 for i in $PATH; do 377 if [ -x "$i/$1" ]; then 378 echo "$i/$1" 379 status=0 380 break 381 fi 382 done 383 384 IFS="$OLD_IFS" 385 return $status 386 } 387 388 yesno() 389 { 390 msg="$1" 391 def="$2" 392 while : ; do 393 printf "\n%s" "$msg" 394 read answer 395 if [ "$answer" ] ; then 396 case "$answer" in 397 "$ST_SMALL_Y" | "$ST_CAPS_Y" | "$ST_YES") 398 return 0 399 ;; 400 *) 401 return 1 402 ;; 403 esac 404 else 405 return $def 406 fi 407 done 408 } 409 410 InstallCertificateFromPath() 411 { 412 #$1 is install_dir 413 #$2 is Certificate Version, can be -PEM -DER 414 #$3 is path to Certificate 415 # TODO: test with - other cert versions, test with http addr instead of path 416 RETVAL=0 417 INSTALL_DIR="$1" 418 LOGFILE="`MkTemp ssl_logXXXXXX`" 419 CERTNAME="`MkTemp certi.cerXXXXXX`" 420 CERTDATA="`MkTemp certDataXXXXXX`" 421 INFORM=`echo "$2" | sed 's/^-//'` 422 INPATH="$3" 423 424 CertificateInstallDirectory="$HOME/.adobe/Acrobat/$majorRelease/Cert" 425 426 if Which openssl >/dev/null 427 then 428 : 429 else 430 printf "%s\n" "$ST_ICE_INFO_07" 431 exit 1 432 fi 433 434 printf "%s\n" "$ST_ICE_INFO_09" 435 436 openssl x509 -inform "${INFORM}" -in "${INPATH}" -text -out "${CERTDATA}" 437 438 beginCert=`cat "${CERTDATA}" |grep -n "BEGIN CERTIFICATE---" |cut -f1 -d":"` 439 endCert=`cat "${CERTDATA}" |grep -n "END CERTIFICATE---" |cut -f1 -d":"` 440 441 head -$endCert "${CERTDATA}" | tail -`expr $endCert - $beginCert + 1` >$CERTNAME 442 443 HASH=`openssl x509 -hash -noout -in $CERTNAME` 444 445 more "$CERTDATA" 446 if yesno "$ST_ICE_INFO_04[$ST_SMALL_N] " 1 447 then 448 if [ ! -d "$CertificateInstallDirectory" ] 449 then 450 mkdir -p "$CertificateInstallDirectory" 451 if [ $? -ne 0 ] 452 then 453 printf "$ST_ER_DIR\n" "$CertificateInstallDirectory" 454 rm -f "$CERTNAME" 455 rm -f "$CERTDATA" 456 exit 1 457 fi 458 fi 459 460 cp $CERTNAME "$CertificateInstallDirectory"/${HASH}.0 461 if [ $? -eq 0 ] 462 then 463 printf "%s\n" "$ST_ICE_INFO_05" 464 else 465 printf "%s\n" "$ST_ICE_INFO_06" 466 RETVAL=1 467 fi 468 else 469 printf "%s\n" "$ST_ICE_INFO_08" 470 RETVAL=2 471 fi 472 473 474 rm -f $CERTNAME 475 rm -f "$CERTDATA" 476 return $RETVAL 477 } 478 479 480 481 InstallCertificateFromWeb() 482 { 483 #$1 is install_dir 484 #$2 is URL 485 #$3 is port 486 RETVAL=0 487 INSTALL_DIR="$1" 488 LOGFILE="`MkTemp ssl_logXXXXXX`" 489 CERTNAME="`MkTemp certi.cerXXXXXX`" 490 CERTDATA="`MkTemp certDataXXXXXX`" 491 492 CertificateInstallDirectory="$HOME/.adobe/Acrobat/$majorRelease/Cert" 493 494 if Which openssl >/dev/null 495 then 496 : 497 else 498 printf "%s\n" "$ST_ICE_INFO_07" 499 exit 1 500 fi 501 502 printf "%s\n" "$ST_ICE_INFO_01" 503 printf "%s\n" "QUIT" | openssl s_client -connect $2:$3 >$LOGFILE 504 505 if [ $? -ne 0 ] 506 then 507 exit 1 508 else 509 printf "%s\n" "$ST_ICE_INFO_02" 510 fi 511 512 513 beginCert=`cat $LOGFILE |grep -n "BEGIN CERTIFICATE---" |cut -f1 -d":"` 514 endCert=`cat $LOGFILE |grep -n "END CERTIFICATE---" |cut -f1 -d":"` 515 516 head -$endCert $LOGFILE | tail -`expr $endCert - $beginCert + 1` >$CERTNAME 517 518 openssl x509 -inform PEM -in $CERTNAME -text -out "${CERTDATA}" 519 HASH=`openssl x509 -hash -noout -in $CERTNAME` 520 521 printf "%s\n\n" "$ST_ICE_INFO_03" 522 523 more "$CERTDATA" 524 if yesno "$ST_ICE_INFO_04[$ST_SMALL_N] " 1 525 then 526 if [ ! -d "$CertificateInstallDirectory" ] 527 then 528 mkdir -p "$CertificateInstallDirectory" 529 if [ $? -ne 0 ] 530 then 531 printf "$ST_ER_DIR\n" "$CertificateInstallDirectory" 532 rm -f "$CERTNAME" 533 rm -f "$CERTDATA" 534 rm -f "$LOGFILE" 535 exit 1 536 fi 537 fi 538 539 cp $CERTNAME "$CertificateInstallDirectory"/${HASH}.0 540 if [ $? -eq 0 ] 541 then 542 printf "%s\n" "$ST_ICE_INFO_05" 543 else 544 printf "%s\n" "$ST_ICE_INFO_06" 545 RETVAL=1 546 fi 547 else 548 printf "%s\n" "$ST_ICE_INFO_08" 549 RETVAL=2 550 fi 551 552 553 rm -f $CERTNAME 554 rm -f $CERTDATA 555 rm -f $LOGFILE 556 return $RETVAL 557 } 558 559 560 # 561 # Get the current working directory. 562 # Try to avoid automounter directories by checking 563 # if $HOME or $PWD is the same directory as pwd, 564 # and removing the automount directory component. 565 # 566 if [ -z "$cwd" -o ! -d "$cwd" ] ; then 567 printf "%s\n" "$ST_ER_AR01" 568 exit 1 569 fi 570 571 if [ "$HOME" -a -d "$HOME" ] && [ "`cd / ; cd "$HOME" ; /bin/pwd`" = "$cwd" ] ; then 572 cwd="$HOME" 573 elif [ "$PWD" -a -d "$PWD" ] && [ "`cd / ; cd "$PWD" ; /bin/pwd`" = "$cwd" ] ; then 574 cwd="$PWD" 575 fi 576 577 578 PWD="$cwd" 579 export PWD 580 581 582 # 583 # Setup ACRO_ARG0 to this script 584 # 585 arg0="$0" 586 if [ "$arg0" ] ; then 587 case "$arg0" in 588 /*) ;; 589 ./*) arg0="$cwd/`expr "$arg0" : '\./\(.*\)'`" ;; 590 *) arg0="$cwd/$arg0" ;; 591 esac 592 593 ACRO_ARG0="$arg0" 594 export ACRO_ARG0 595 fi 596 597 598 # 599 # Try to find the installation directory 600 # 601 if ( test_install_dir "$install_dir" ) ; then 602 ACRO_INSTALL_DIR="$install_dir" 603 export ACRO_INSTALL_DIR 604 605 else 606 script="$arg0" 607 while [ "$script" ] ; do 608 install_dir="`dirname "$script"`" 609 if ( test_install_dir "$install_dir/Reader" ) ; then 610 ACRO_INSTALL_DIR="$install_dir/Reader" 611 export ACRO_INSTALL_DIR 612 break 613 fi 614 615 install_dir="`dirname "$install_dir"`" 616 if ( test_install_dir "$install_dir/Reader" ) ; then 617 ACRO_INSTALL_DIR="$install_dir/Reader" 618 export ACRO_INSTALL_DIR 619 break 620 fi 621 622 if [ -h "$script" ] ; then 623 new_script=`readlink "$script"` 624 if [ "$new_script" -a "`expr "$new_script" : '/.*'`" = 0 ] ; then 625 new_script="`dirname "$script"`/$new_script" 626 fi 627 script="$new_script" 628 else 629 break 630 fi 631 done 632 633 if ( test_install_dir "$ACRO_INSTALL_DIR" ) ; then 634 : 635 elif ( test_install_dir "$ACRO_HOME" ) ; then 636 ACRO_INSTALL_DIR="$ACRO_HOME" 637 export ACRO_INSTALL_DIR 638 else 639 printf "%s\n" "$ST_ER_AR02" 640 exit 1 641 fi 642 fi 643 644 645 # 646 # setup the configuration from uname 647 # 648 os_name=`uname -s` 649 os_release=`uname -r` 650 651 case "$os_name" in 652 SunOS) 653 case "$os_release" in 654 4.1.3*|4.1.4*|4.1C) 655 ACRO_CONFIG=sparcsun 656 export ACRO_CONFIG 657 ;; 658 5.*) 659 machine_type=`uname -p` 660 case "$machine_type" in 661 sparc) 662 ACRO_CONFIG=sparcsolaris 663 export ACRO_CONFIG 664 ;; 665 intel|i386) 666 ACRO_CONFIG=intelsolaris 667 export ACRO_CONFIG 668 ;; 669 ppc) 670 ACRO_CONFIG=ppcsolaris 671 export ACRO_CONFIG 672 ;; 673 esac 674 ;; 675 esac 676 ;; 677 Linux) 678 ACRO_CONFIG=intellinux 679 export ACRO_CONFIG 680 ;; 681 AIX) 682 ACRO_CONFIG=rs6000aix 683 export ACRO_CONFIG 684 ;; 685 HP-UX) 686 ACRO_CONFIG=hppahpux 687 export ACRO_CONFIG 688 esac 689 690 if [ -z "$ACRO_CONFIG" ] ; then 691 printf "$ST_INFO_AR01" "$os_name $ST_VERSION $os_release" 692 printf "%s\n%s\n" "$ST_INFO_AR03" "$ST_INFO_AR04" 693 694 if [ -d "$ACRO_INSTALL_DIR"/sparcsolaris ] ; then 695 printf " SPARC/Solaris version 2.x\n" 696 fi 697 if [ -d "$ACRO_INSTALL_DIR"/intelsolaris ] ; then 698 printf " Intel/Solaris\n" 699 fi 700 if [ -d "$ACRO_INSTALL_DIR"/intellinux ] ; then 701 printf " Intel/Linux\n" 702 fi 703 exit 1 704 fi 705 706 # Enable this if you donot want Adobe Reader to cache Font-config fonts 707 # ACRO_DISABLE_FONT_CONFIG=1 708 # export ACRO_DISABLE_FONT_CONFIG 709 710 # Enable this if you want to set the MOZILLA_COMP_PATH globally (for all the users) 711 #if [ -f "$ACRO_INSTALL_DIR/GlobalPrefs/mozilla_config" ]; then 712 # . "$ACRO_INSTALL_DIR/GlobalPrefs/mozilla_config" 713 # export MOZILLA_COMP_PATH 714 #fi 715 716 if [ -x /usr/bin/test ]; then 717 TestCmd=/usr/bin/test 718 else 719 TestCmd=test 720 fi 721 722 if $TestCmd -e . 2>/dev/null; then 723 TestCmdOption="-e" 724 else 725 TestCmdOption="-f" 726 fi 727 728 greConfigFile="${HOME}/.adobe/Acrobat/$majorRelease/Preferences/acrogre.conf" 729 730 if [ -f "$greConfigFile" ]; then 731 mozillaPath="`cat "$greConfigFile"`" 732 if [ -n "$mozillaPath" ]; then 733 MOZILLA_COMP_PATH="$mozillaPath" 734 export MOZILLA_COMP_PATH 735 fi 736 else 737 for i in /etc/gre.d/gre.conf /etc/gre.d/firefox.conf /etc/gre.d/mozilla.conf /etc/gre.d/*.conf /etc/gre.conf 738 do 739 if [ -f "$i" ]; then 740 mozillaPath="`grep "^GRE_PATH=" "$i" | cut -d= -f2 | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`" 741 if [ -n "$mozillaPath" ]; then 742 MOZILLA_COMP_PATH="$mozillaPath" 743 export MOZILLA_COMP_PATH 744 break 745 fi 746 fi 747 done 748 fi 749 750 if [ -z "$mozillaPath" ]; then 751 MozPath="`gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null | cut -d ' ' -f1 2>/dev/null`" 752 [ -x "${MozPath}" ] || MozPath="`Which "$MozPath"`" 753 mozillaPath="`readlink "$MozPath" | xargs dirname`" 754 if [ -n "$mozillaPath" ] && $TestCmd $TestCmdOption "$mozillaPath/libgtkembedmoz.so" || $TestCmd $TestCmdOption "$mozillaPath/libxul.so" ; then 755 MOZILLA_COMP_PATH="$mozillaPath" 756 export MOZILLA_COMP_PATH 757 fi 758 fi 759 760 ADOBE_USER_PREFERENCES="$HOME/.adobe/Acrobat/$majorRelease/Preferences" 761 export ADOBE_USER_PREFERENCES 762 763 MOZILLA_FIVE_HOME="$MOZILLA_COMP_PATH" 764 export MOZILLA_FIVE_HOME 765 766 LIB_NSPR_PATH=/usr/lib/mps/ 767 768 # 769 # Setup configuration specific environment variables 770 # 771 ACRO_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" 772 export ACRO_LD_LIBRARY_PATH 773 774 case "$ACRO_CONFIG" in 775 sparcsolaris) 776 LD_LIBRARY_PATH="`prepend "$ACRO_INSTALL_DIR/$ACRO_CONFIG/lib:$ACRO_INSTALL_DIR/$ACRO_CONFIG/sidecars:${MOZILLA_COMP_PATH}" "${LD_LIBRARY_PATH}"`" 777 export LD_LIBRARY_PATH 778 ;; 779 intelsolaris) 780 LD_LIBRARY_PATH="`prepend "$ACRO_INSTALL_DIR/$ACRO_CONFIG/lib:$ACRO_INSTALL_DIR/$ACRO_CONFIG/sidecars:${MOZILLA_COMP_PATH}:${LIB_NSPR_PATH}" "${LD_LIBRARY_PATH}"`" 781 export LD_LIBRARY_PATH 782 ;; 783 intellinux) 784 LD_LIBRARY_PATH="`prepend "$ACRO_INSTALL_DIR/$ACRO_CONFIG/lib:$ACRO_INSTALL_DIR/$ACRO_CONFIG/sidecars:${MOZILLA_COMP_PATH}" "${LD_LIBRARY_PATH}"`" 785 export LD_LIBRARY_PATH 786 ;; 787 rs6000aix) 788 LIBPATH="`prepend "$ACRO_INSTALL_DIR/$ACRO_CONFIG/lib:$ACRO_INSTALL_DIR/$ACRO_CONFIG/sidecars:/opt/freeware/lib" "$LIBPATH"`" 789 export LIBPATH 790 ;; 791 hppahpux) 792 SHLIB_PATH="`prepend "$ACRO_INSTALL_DIR/$ACRO_CONFIG/lib:$ACRO_INSTALL_DIR/$ACRO_CONFIG/sidecars:/opt/graphics/OpenGL/lib" "$SHLIB_PATH"`" 793 LD_PRELOAD=/opt/graphics/OpenGL/lib/libGL.sl 794 export SHLIB_PATH 795 export LD_PRELOAD 796 ;; 797 esac 798 799 800 directory="`basename \"$ACRO_INSTALL_DIR\"`" 801 802 if [ "$directory" = "Reader" ]; then 803 cmd="acroread" 804 prod="Adobe Reader" 805 else 806 if [ "$directory" = "Acrobat" ]; then 807 cmd="acroexch" 808 prod="Adobe Acrobat" 809 fi 810 fi 811 812 # 813 # Set the command. Process any debug flags and exec. 814 # 815 ACRO_EXEC_CMD="$ACRO_INSTALL_DIR/$ACRO_CONFIG/bin/$cmd" 816 SYNCAPP_EXEC_CMD="$ACRO_INSTALL_DIR/$ACRO_CONFIG/bin/SynchronizerApp" 817 export SYNCAPP_EXEC_CMD 818 export ACRO_EXEC_CMD 819 820 ACRO_RES_DIR=$ACRO_INSTALL_DIR/../Resource 821 export ACRO_RES_DIR 822 823 ACRO_LANG="$ST_LANG" 824 export ACRO_LANG 825 826 ADOBE_HELP_PATH="$ACRO_INSTALL_DIR/../../.." 827 export ADOBE_HELP_PATH 828 829 #Checking if TMPDIR points to a valid directory 830 if [ -n "$TMPDIR" ] && [ ! -d "$TMPDIR" -o ! -w "$TMPDIR" ] 831 then 832 printf "%s\n" "$ST_ER_AR04" 833 exit 1 834 fi 835 # Adobe Reader/Acrobat uses gconftool-2 to check whether accessibility support is enabled. Please refer to the Readme file to work around this. 836 837 if Which gconftool-2 >/dev/null 838 then 839 ACRO_AT_ACTIVE=`gconftool-2 -g /desktop/gnome/interface/accessibility 2>/dev/null` 840 else 841 # gconftool-2 is not there on system, turn off AT support 842 ACRO_AT_ACTIVE="false" 843 fi 844 845 export ACRO_AT_ACTIVE 846 847 # Required for Multimedia plugin 848 # look for installed realplayer 849 850 if [ "$ACRO_CONFIG" = "intellinux" ] || [ "$ACRO_CONFIG" = "intelsolaris" ]; then 851 if ARG0="`which realplay 2> /dev/null`"; then 852 if [ -d "$REALPLAYER_HOME" ] ; then 853 true 854 elif [ "$REALPLAYER_HOME" = "" -a -L ${ARG0} ] ; then 855 REALPLAYER_HOME=`readlink ${ARG0} 2> /dev/null` 856 REALPLAYER_HOME=`dirname ${REALPLAYER_HOME} 2> /dev/null` # Delete trailing file name. 857 export REALPLAYER_HOME 858 elif [ "$REALPLAYER_HOME" = "" -a -f ${ARG0} ] ; then 859 REALPLAYER_HOME=$ARG0 860 REALPLAYER_HOME=`dirname ${REALPLAYER_HOME} 2> /dev/null` # Delete trailing file name. 861 REALPLAYER_HOME=`cd $REALPLAYER_HOME; pwd;` 862 export REALPLAYER_HOME 863 fi 864 fi 865 fi 866 867 if [ "$ACRO_AT_ACTIVE" = "true" ]; then 868 GTK_MODULES=gail:atk-bridge 869 export GTK_MODULES 870 fi 871 872 if [ "$1" = "-installCertificate" ] 873 then 874 if [ "$2" = "-PEM" -o "$2" = "-DER" ]; then 875 InstallCertificateFromPath $ACRO_INSTALL_DIR $2 $3 876 exit $? 877 else 878 InstallCertificateFromWeb $ACRO_INSTALL_DIR $2 $3 879 exit $? 880 fi 881 fi 882 883 PATH="$PATH:$ACRO_INSTALL_DIR/$ACRO_CONFIG/bin" 884 export PATH 885 886 rm -rf "${HOME}/.adobe/Acrobat/$majorRelease/Preferences/mozilla" >/dev/null 2>&1 887 mkdir -p "${HOME}/.adobe/Acrobat/$majorRelease/Preferences/mozilla" >/dev/null 2>&1 && \ 888 cp -f "$ACRO_INSTALL_DIR/$ACRO_CONFIG/mozilla/prefs.js" "${HOME}/.adobe/Acrobat/$majorRelease/Preferences/mozilla/prefs.js" >/dev/null 2>&1 889 890 if [ "$1" = "-DEBUG" ] ; then 891 ACRODEBUG=1 892 ACRO_CRASHLOG=1 893 export ACRODEBUG ACRO_CRASHLOG 894 895 if [ "`ulimit -c 2>/dev/null`" = "0" ] 896 then 897 ulimit -c 1000000 >/dev/null 2>&1 898 fi 899 900 if [ $# = 1 ] ; then 901 export ACRO_EXEC_CMD 902 exec "$SHELL" 903 else 904 shift 905 exec ${1+"$@"} "$ACRO_EXEC_CMD" 906 fi 907 fi 908 909 if [ -f "$ACRO_EXEC_CMD" ] ; then 910 LaunchBinary "$ACRO_EXEC_CMD" ${1+"$@"} 911 else 912 printf "$ST_ER_AR03\n" "$ACRO_EXEC_CMD" 913 printf "$ST_ER_AR05\n" "$prod" "\"$ACRO_CONFIG\"" 914 exit 1 915 fi 916