Views
WinstScripts
>>
ooffice2.4.2
last edited 1 year ago by sehlers
Three Scripts ooffice2.ins (install) and delsub.ins and delooffice2.ins (uninstall)
Qualified for opsi 3.3
---------------------------------------------------------------------
ooffice2.ins
*************************************************************
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
[Initial]
; Message at install time:
Message=Installiere OpenOffice.org 2.4.2
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 $RebootFlag$
DefVar $WinstRegKey$
DefVar $RebootRegVar$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $NewExe$
DefVar $InstLogfile$
DefVar $SYSTEMROOT$
DefVar $SYSTEMDRIVE$
DefVar $TEMP$
DefVar $OS$
DefVar $UninstallCommand$
DefVar $DisplayName$
DefVar $MsiCode$
DefVar $HandleWord$
DefVar $HandleExcel$
DefVar $HandlePowerpoint$
DefVar $UserProfileName$
DefStringList $UserProfileNames$
Set $SYSTEMDRIVE$ = "%SYSTEMDRIVE%"
Set $SYSTEMROOT$ = "%SYSTEMROOT%"
Set $TEMP$= EnvVar("TEMP")
set $ProductId$ = "ooffice2"
set $InstallDir$="%ProgramFilesDir%\OpenOffice.org 2.4"
set $NewExe$=$InstallDir$+"\program\soffice.exe"
Set $InstLogfile$ = "%SYSTEMDRIVE%\tmp\ooffice2_install_log.txt"
Set $OS$ = GetOS
; is this a win32 system ?
if ( $OS$ = "Windows_NT" OR $OS$ = "Windows_95" )
ShowBitmap /3 "%scriptpath%\ooffice.png" "OpenOffice.org 2"
if HasMinimumSpace ("%SYSTEMDRIVE%", "300 MB")
; installing ooffice over old version is no problem
; reinstalling over actual version hangs so we need to deinstall first
;
if FileExists("%ScriptPath%\delsub.ins")
; start uninstall
sub "%ScriptPath%\delsub.ins"
endif
Message "installing ....."
if inivar("handle_word_doc") = "off"
set $HandleWord$ = "SELECT_WORD=0"
else
set $HandleWord$ = "SELECT_WORD=1"
endif
if inivar("handle_excel_xls") = "off"
set $HandleExcel$ = "SELECT_EXCEL=0"
else
set $HandleExcel$ = "SELECT_EXCEL=1"
endif
if inivar("handle_powerpoint_ppt") = "off"
set $HandlePowerpoint$ = "SELECT_POWERPOINT=0"
else
set $HandlePowerpoint$ = "SELECT_POWERPOINT=1"
endif
WinBatch_OpenOffice2
if not(FileExists($NewExe$))
logError "Fatal: After Installation "+$NewExe$+" not found"
isFatalError
endif
; Update user profiles
Set $UserProfileNames$ = getOutStreamFromSection('DosInAnIcon_list_profiledir')
for $entry$ in $UserProfileNames$ do Sub_update_user_profile
; kundenspezifisches
if FileExists("%ScriptPath%\custom_ins_dir\custom_ins.ins")
sub "%ScriptPath%\custom_ins_dir\custom_ins.ins"
endif
else
LogError "Nicht gen�gend Platz auf C:"
isFatalError
endif
else
Message=Dies ist kein 32-Bit Betriebssystem
endif
[WinBatch_OpenOffice2]
%SCRIPTPATH%\files\instmsiw.exe /q
msiexec /l* $TEMP$\openoffice242.txt /qb-! /i %SCRIPTPATH%\files\openofficeorg24.msi ALLUSERS=2 $HandleWord$ $HandleExcel$ $HandlePowerpoint$
[DosInAnIcon_list_profiledir]
@echo off
dir "%ProfileDir%" /b
[Files_create_ooo2_profile]
copy -s "%SCRIPTPATH%\user\*" "%ProfileDir%\$UserProfileName$\Anwendungsdaten\OpenOffice.org2\user\"
[Sub_update_user_profile]
Set $UserProfileName$ = "$entry$"
if not ($UserProfileName$ = "") and not ($UserProfileName$ = "All Users")
if FileExists("%ProfileDir%\" + $UserProfileName$ + "\Anwendungsdaten\OpenOffice.org2\user")
comment "OOo2 user profile exist for user " + $UserProfileName$ + ", leaving as is"
else
comment "Creating new OOo2 profile for user " + $UserProfileName$
Files_create_ooo2_profile
endif
endif
***********************************************************
delsub.ins
***********************************************************
; Message at install time:
Message "Deinstalling "+$ProductId$+" ..."
;ooffice210 {8FB1A5EA-7DA8-4D57-80FB-BD923CCCC852}
;
set $MsiCode$="{8FB1A5EA-7DA8-4D57-80FB-BD923CCCC852}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.2
set $MsiCode$="{E7DA9B23-5715-45D8-965E-E76688A2B948}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.2.1
set $MsiCode$="{E4C7B3EF-B3DB-4BB6-A812-E8FAE47534D3}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.3.0
set $MsiCode$="{A625D45F-1DC4-47FB-ABCF-6B27684AA717}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.3.1
set $MsiCode$="{DD5B65F7-7CA5-4DE4-AEE7-7E8F26BF78F5}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.4.0
set $MsiCode$="{1B14B0C3-2D60-477C-A1FE-B88E60948854}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.4.1
set $MsiCode$="{CCD90636-D97D-4130-A44A-3AD4E63B9220}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
; ooo2.4.2
set $MsiCode$="{50E21B3A-FF06-412D-879B-DEA30815736E}"
set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
LinkFolder_Delete_OpenOffice.org
[LinkFolder_Delete_OpenOffice.org]
set_basefolder common_programs
delete_subfolder "OpenOffice.org 1.9.125"
delete_subfolder "OpenOffice.org2.0beta"
delete_subfolder "OpenOffice.org 2.0"
delete_subfolder "OpenOffice.org 2.1"
delete_subfolder "OpenOffice.org 2.2"
delete_subfolder "OpenOffice.org 2.3"
delete_subfolder "OpenOffice.org 2.4"
[WinBatch_uninstall]
$UninstallCommand$
****************************************************************
delooffice2.ins
****************************************************************
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
[Initial]
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 $ProductId$
DefVar $InstallDir$
DefVar $UninstallCommand$
DefVar $DisplayName$
DefVar $MsiCode$
; This should be edited
set $ProductId$ = "ooffice2"
set $InstallDir$="%ProgramFilesDir%\OpenOffice.org 2.4"
DefVar $TEMP$
Set $TEMP$ = EnvVar("TEMP")
;Variables for OS version
DefVar $OS$
set $OS$ = GetOS
; is this a win32 system ?
if ( $OS$ = "Windows_NT" OR $OS$ = "Windows_95" )
; show product picture
ShowBitmap /3 "%scriptpath%\"+$ProductId$+".png" $ProductId$
if FileExists("%ScriptPath%\delsub.ins")
; start uninstall
sub "%ScriptPath%\delsub.ins"
endif
endif