Views
WinstScripts
>>
flashplayer
last edited 3 months ago by sehlers
Three Scripts: install (flashplayer.ins) and delete (delsub.ins and delflahplayer.ins)
Qualified for opsi 3.4
---------------------------------------------------------------------
flashplayer.ins
**************************************************************
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
[Initial]
requiredWinstVersion >= "4.8.6"
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; Let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
ShowBitmap /3 "%SCRIPTPATH%\flashplayer.png" "Adobe Flashplayer 10"
;Variable fuer temporaeres Verzeichnis
DefVar $Temp$
set $Temp$ = EnvVar("TEMP")
;Variablen fuer BetriebssystemsVersion (OS)-Test
DefVar $OS$
DefVar $MinorOS$
set $OS$ = GetOS
set $MinorOS$ = GetNTVersion
DefVar $ProductId$
Set $ProductId$ = "flashplayer"
DefVar $MinimumSpace$
Set $MinimumSpace$ = "50 MB"
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap /3 "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
if FileExists("%ScriptPath%\delsub.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins"
endif
if ( $OS$ = "Windows_NT" )
Message "Installing " + $ProductId$ + " ..."
Files_copy
Winbatch_unattended_install
Files_Delete
endif
if (IniVar("NoAutoUpdate") = "on")
Files_copy_noautoupdate
else
Files_delete_noautoupdate
endif
endif
[Files_copy]
checktargetpath="$TEMP$\flashplayer"
copy -svx "%SCRIPTPATH%\files\"
[Winbatch_unattended_install]
$TEMP$\flashplayer\install_flash_player.exe /s
$TEMP$\flashplayer\install_flash_player_ax.exe /s
[Files_Delete]
delete -sf $TEMP$\flashplayer\
[Files_copy_noautoupdate]
copy -svx "%SCRIPTPATH%\files\mms.cfg" "%SYSTEM%\Macromed\Flash"
[Files_delete_noautoupdate]
delete -sf "%SYSTEM%\Macromed\Flash\mms.cfg"
**************************************************************
delsub.ins
**************************************************************
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%System%\Macromed\Flash\uninstall_plugin.exe")
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
sub_check_exitcode
else
comment "No uninstall program found, start to install"
endif
[Winbatch_uninstall]
"%System%\Macromed\Flash\uninstall_plugin.exe" /SILENT /SUPPRESSMSGBOXES /NORESTART
"%System%\Macromed\Flash\uninstall_activeX.exe" /SILENT /SUPPRESSMSGBOXES /NORESTART
[Sub_check_exitcode]
comment "Test for installation success via exit code"
DefVar $ExitCode$
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif
********************************************************************
delflashplayer.ins
********************************************************************
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
[Initial]
requiredWinstVersion >= "4.8.6"
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; Let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
DefVar $TEMP$
Set $TEMP$ = EnvVar("TEMP")
DefVar $LogDir$
Set $LogDir$ = "%SystemDrive%\tmp"
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $ProductId$ = "flashplayer"
Set $InstallDir$ = "%ProgramFilesDir%\" + $ProductId$
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
comment "Show product picture"
ShowBitmap /3 "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins"
endif
if not ($LicenseRequired$ = "false")
comment "Licensing required, free license used"
Sub_free_license
endif
[Sub_free_license]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"
comment "Trying to free license used for the product"
DefVar $result$
Set $result$ = FreeLicense($LicensePool$)
; If there is an assignment of a license pool to the product, it is possible to use
; Set $result$ = FreeLicense("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
else
LogError "Error: licensing required, but license management not enabled"
isFatalError
endif