Skip to content

opsi.orgheader image

opsi.org
Views
WinstScripts >>

acroread

Document Actions
last edited 4 months ago by sehlers
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.

; 7.12.06 update auf ver 8.0 (do)
; info: http://www.appdeploy.com/packages/detail.asp?id=915
; update 8.1.1 (bw)


[Initial]
Message= Installiere Adobe Acrobatreader ...
LogLevel=2
ExitOnError=false
ScriptErrorMessages=on
TraceMode=off
StayOnTop=false


[Aktionen]
DefVar $UninstallCommand$
DefVar $DisplayName$
DefVar $UninstallReg$
set $UninstallReg$="[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
DefVar $MsiCode$
DefVar $DesktopIconName$
DefVar $SCRIPTPATH$
Set $SCRIPTPATH$ = "%SCRIPTPATH%"

DefVar $ProgramFilesDir$
Set $ProgramFilesDir$ = "%ProgramFilesDir%"

DefVar $LOCATION_EXE$
Set $LOCATION_EXE$ = $ProgramFilesDir$+"\Adobe\Reader 8.0\Reader\acrord32.exe"

requiredWinstVersion >= "4.4"
DefStringList $languageInfo$
set  $languageInfo$ = getLocaleInfo
;	we have a 5 elements String List. In the log file we get 
;	    retrieving strings from getLocaleInfo:
;	        (string   0)DE
;	        (string   1)DEU
;	        (string   2)German
;	        (string   3)Germany
;	        (string   4)0407
;	We may now construct scripts for conditionial statements (cf. section 6.7) like 

DefVar $LANGUAGE_VER$
Set $LANGUAGE_VER$ = takeString(0, $languageInfo$)
DefVar $MSI_FILE_LOC$

DefVar $MSI_FILE$
Set $MSI_FILE$ = "\acroread.msi"

DefVar $FROM_LOCATION$
Set $FROM_LOCATION$ = $SCRIPTPATH$ + "\files\Adobe_Reader_8.1"

if ( $LANGUAGE_VER$ = "DE")
    ; install German version
    Set $MSI_FILE_LOC$ = "" + $FROM_LOCATION$ + $MSI_FILE$ + ""
else 
   if ($LANGUAGE_VER$ = "EN")
           ; install English version
           Set $MSI_FILE$ = "AdbeRdr811_en_US.msi"
           Set $MSI_FILE_LOC$ = "" + $FROM_LOCATION$ + "\" + $LANGUAGE_VER$ + "\"+ $MSI_FILE$ + ""
   else
    
    logError="Language not supported Installation failed"
    isFatalError	
   endif
endif 	


DefVar $LOG_LOCATION$
Set $LOG_LOCATION$ = "c:\tmp\adobereader_810.txt"

DefVar $OS
set $OS=GetOS
DefVar $MinorOS$
set $MinorOS$ = GetNTVersion
if ( $MinorOS$ = "Win2K" OR $MinorOS$ = "WinXP" OR $MinorOS$ = "Win NT 5.2" )

         
      
   if not (HasMinimumSpace ("%SYSTEMDRIVE%", "100 MB"))
           LogError "Nicht genügend Platz auf C: . 100 MB auf C: für Adobe Reader erforderlich."
      else
 
           
      ShowBitmap /3 "%SCRIPTPATH%\acrobat.bmp" "Adobe Reader 8.1"
      ; install msiexec 3.1
       WinBatch_msi31


      ;ver 6.0.1 !Deinstalls also Acrobat 6 Standard!!
      ;set $MsiCode$="{AC76BA86-1033-F400-BA7E-000000000001}"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
       ;Message "Found "+$DisplayName$+" => uninstalling first"
       ;set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       ;Winbatch_uninstall
      ;endif

      ;ver 6.0.2
      ;set $MsiCode$="{AC76BA86-0000-0000-0000-6028747ADE01}"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
       ;Message "Found "+$DisplayName$+" => uninstalling first"
       ;set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       ;Winbatch_uninstall
      ;endif

      ;ver 6.0.3
      ;set $MsiCode$="{AC76BA86-0000-7EC8-7489-000000000603}"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
       ;Message "Found "+$DisplayName$+" => uninstalling first"
       ;set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       ;Winbatch_uninstall
      ;endif

      ;ver 6.0.4
      ;set $MsiCode$="{AC76BA86-0000-7EC8-7489-000000000604}"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
       ;Message "Found "+$DisplayName$+" => uninstalling first"
       ;set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       ;Winbatch_uninstall
      ;endif

      ;ver 6.0.5
      ;set $MsiCode$="{AC76BA86-0000-7EC8-7489-000000000605}"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
       ;Message "Found "+$DisplayName$+" => uninstalling first"
       ;set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       ;Winbatch_uninstall
      ;endif

      ;ver 7.0.8
      ;set $MsiCode$="{AC76BA86-7AD7-1031-7B44-A70800000002}"
      ;set $DesktopIconName$="Adobe Reader 7.0"
      ;set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      ;if not ($DisplayName$ = "")
      ; Message "Found "+$DisplayName$+" => uninstalling first"
      ; set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
      ; Winbatch_uninstall
      ; LinkFolder_del_desktop
      ;endif

      ;ver 8.0
      set $MsiCode$="{AC76BA86-7AD7-1031-7B44-A80000000002}"
      set $DesktopIconName$="Adobe Reader 8"
      set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      if not ($DisplayName$ = "")
       Message "Found "+$DisplayName$+" => uninstalling first"
       set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       Winbatch_uninstall
       LinkFolder_del_desktop
      endif

      ;ver 8.1
      set $MsiCode$="{AC76BA86-7AD7-1031-7B44-A81000000003}"
      ; set $MsiCode$="{AC76BA86-7AD7-1033-7B44-A81000000003}" - englisch
      set $DesktopIconName$="Adobe Reader 8.1"
      set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
      if not ($DisplayName$ = "")
       Message "Found "+$DisplayName$+" => uninstalling first"
       set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
       Winbatch_uninstall
       LinkFolder_del_desktop
      endif

      Message "Installing Acrobat Reader"
      WinBatch_akt_acroread_installieren
      ; update 8.1.1
      if NOT ($LANGUAGE_VER$ = "EN")
        WinBatch_akt_acroread_update_811
      endif
      Registry_akt_acroread
      if not(FileExists($LOCATION_EXE$))
       logError="Installation failed"
       isFatalError	
      endif	
    endif
   ExitWindows /RebootWanted
else

    
  if ( ( $LANGUAGE_VER$ = "DE") AND ( $MinorOS$ = "NT4" OR $OS = "Windows_95" ) )        

  ;installiere acrobat reader 6

	DefVar $Kommentar

	; fuer rgm und rgu dateien
	DefVar $SYSTEMSYS$
	Set $SYSTEMSYS$ = "%System%"
	DefVar $SYSTEMROOT$
	Set $SYSTEMROOT$ = "%Systemroot%"
	DefVar $SYSTEMDRIVE$
	Set $SYSTEMDRIVE$ = "C:"

	DefVar $TRundll$
	defvar $basedir
	set $basedir = "%scriptpath%"

	if $OS = "Windows_NT"
	   Set $TRundll$ = "%SYSTEM%"
	endif
	 if $OS = "Windows_95"
	   Set $TRundll$ = "%SYSTEMROOT%"
	endif   

	;
	;test auf reader3
	      if FileExists("c:\Acrobat3")
	         sub $basedir + "\delacro3.ins"
	      endif	

	;test auf reader4
	      if FileExists("c:\Programme\adobe\Acrobat 4.0\reader\acrord32.exe")	
	         sub $basedir + "\delacroread4.ins"
	      endif	

	;test auf reader5
	      if not (FileExists("c:\Programme\adobe\Acrobat 5.0\distillr\acrodist.exe"))
	         if FileExists("c:\Programme\adobe\Acrobat 5.0\reader\acrord32.exe")	
	            sub $basedir + "\delacroread5.ins"
	         endif	
	      endif
	;test auf reader6
	      if FileExists("c:\Programme\adobe\Acrobat 6.0\reader\acrord32.exe")	
		             
	         ShowBitmap /3 "%SCRIPTPATH%\acroread6.bmp" "Adobe Reader 6"
	         winbatch_acroread_silent_reinstall
	         winbatch_acroread_silent_repatch
	      else
	         ;installiere acrobat reader 6.0.1
	         ; ShowBitmap /3 "%scriptpath%\reader.bmp" "Acrobat Reader"
	         ; sub $basedir + "\acroread60.ins"
	      
	         if not (HasMinimumSpace ("%SYSTEMDRIVE%", "60 MB"))
	            LogError "Nicht genügend Platz auf C: . 60 MB auf C: für Adobe Reader erforderlich."
	         else
	            ShowBitmap /3 "%SCRIPTPATH%\acroread6.bmp" "Adobe Reader 6"
	            if fileExists("%SYSTEM%\msiexec.exe")
	               winbatch_autoit_ignore_runnig_programs /LetThemGo
	               winbatch_acroread_silent_install
	            else
	               winbatch_bitte_warten_dauert_lang_acroread_silent_install2	
	            endif
	            winbatch_acroread_silent_patch
	         endif
  
	      endif	
      
      
	      LinkFolder_PrintMe_delete

	ExitWindows /RebootWanted
        
        
        else
          LogError "Betriebssystem prüfen"
        endif

;custom specific stuff
  DefVar $PRODUCTPATH$
  Set $PRODUCTPATH$="%ProgramFilesDir%\Adobe"

  if FileExists("%ScriptPath%\custom_ins_dir\custom.ins")
    sub "%ScriptPath%\custom_ins_dir\custom.ins"
  endif

endif

; aktueller acroread 
[WinBatch_akt_acroread_installieren]
msiexec /qb-! /l* $LOG_LOCATION$ /i "$MSI_FILE_LOC$" REBOOT=ReallySuppress EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES

[Winbatch_uninstall]
$UninstallCommand$

[LinkFolder_del_desktop]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element "$DesktopIconName$"

[Registry_akt_acroread]
openkey [HKLM\Software\Adobe\Acrobat Reader\8.1\Downtown]
set "bDontShowAtLaunch"=REG_DWORD:1
set "bGoOnline"=REG_DWORD:0

[winbatch_acroread7_silent_reinstall]
;msiexec /qb /l* %SYSTEMDRIVE%\tmp\adobe-reader_reinstall705.txt /i "%SCRIPTPATH%\files\adberdr_\Adobe Reader 7.0.5 - Deutsch.msi" REBOOT=ReallySuppress REINSTALL=ALL
msiexec /qb /l* $LOG_LOCATION$ /i "$MSI_FILE_LOC$" REBOOT=ReallySuppress REINSTALL=ALL



; [acroread 6]

[winbatch_autoit_ignore_runnig_programs]
%SCRIPTPATH%\autoit.exe %SCRIPTPATH%\acroread.aut

[WinBatchUnInstall_acroread7]
; acrordr7.0.0 full uninstall 
;MsiExec.exe /x{E114AF68-C125-40CA-9648-21931F8826E5} /q
;MsiExec.exe /x{AC76BA86-7AD7-1031-7B44-A70000000000} /q REBOOT=ReallySuppress /l* %SYSTEMDRIVE%\tmp\adobe-readerdeinstall7.txt
MsiExec.exe /x{AC76BA86-7AD7-1031-7B44-A70000000000} /q REBOOT=ReallySuppress 

[winbatch_acroread_silent_install]
msiexec /qb /i "%SCRIPTPATH%\files\Adobe Reader 6.0.1 - Deutsch.msi" REINSTALLMODE=omus
;msiexec /qb- /i %SCRIPTPATH%\files\Adobe Reader 6.0.1 - Deutsch.msi TRANSFORMS="%SCRIPTPATH%\files\rdr60deu.mst" /l c:\temp\acro.txt
;%SCRIPTPATH%\files\setup.exe -s /sms /v"/qb REBOOT=Suppress"
;%SCRIPTPATH%\files\AdbeRdr60.exe -p"-s /sms /v\"/qb REBOOT=Suppress \"" 

[winbatch_acroread_silent_reinstall]
msiexec /qb /i "%SCRIPTPATH%\files\Adobe Reader 6.0.1 - Deutsch.msi" REINSTALL=ALL

[winbatch_bitte_warten_dauert_lang_acroread_silent_install2]
;msiexec /qb- /i %SCRIPTPATH%\files\reader.msi TRANSFORMS="%SCRIPTPATH%\files\rdr60deu.mst" /l c:\temp\acro.txt
;%SCRIPTPATH%\files\setup.exe -s /sms /v"/qb REBOOT=Suppress"
%SCRIPTPATH%\files\AdbeRdr60_deu.exe -p"-s /sms /v\"/qb REBOOT=Suppress \"" 

[winbatch_acroread_silent_patch]
%SCRIPTPATH%\files\acro-reader_6.0.2_update.exe /s /v/qn

[winbatch_acroread_silent_repatch]
%SCRIPTPATH%\files\acro-reader_6.0.2_update.exe /s /v"/qn REINSTALL=ALL"

[Files_DeletePrintme]
delete -sf "C:\Programme\adobe\Acrobat 6.0\Reader\plug_ins\Printme"

[LinkFolder_PrintMe_delete]
set_basefolder common_programs
delete_subfolder "PrintMe Internet Printing"

[WinBatch_msi31]
%scriptpath%\windows-installer_31\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart /log:c:\tmp\msi31.log

[WinBatch_akt_acroread_update_811]
msiexec /p "%SCRIPTPATH%\files\Adobe_Reader_8.1\ReaderUpd811_all_incr.msp"  /qn /log c:\tmp\adoberreader811.log


file: http://www.opsi.org/opsi_wiki/Acroread/acroread.ins