User Tools

Site Tools


userspace:libreoffice_4.0

This is an old revision of the document!


LibreOffce 4.0

darpakiss 2013/02/20 15:38

Tested on Windows 7 64bit

Tested with opsi 4.0.2
required Winst Version >= 4.11.3.1
Files can be downloaded at here

Tree:

CLIENT_DATA
check_msi-exitcode.ins
delsub.ins
hunart-0.3.oxt
LibreOffice_4.0.0_Win_x86_helppack_de.msi
LibreOffice_4.0.0_Win_x86_helppack_en-US.msi
LibreOffice_4.0.0_Win_x86_helppack_fr.msi
LibreOffice_4.0.0_Win_x86_helppack_hu.msi
LibreOffice_4.0.0_Win_x86.msi
Libreoffice.png
numbertext-0.9.4.oxt
Sun_ODF_Template_Pack2_en-US.oxt
Sun_ODF_Template_Pack_en-US.oxt
setup.ins
uninstall.ins
OPSI
control

Steps

  1. Download the installer and the helppacks from here
  2. Download the needed extensions from here
  3. You can customize the installer if you follow this instruction, and change the value of Inst_Cmd32 variable
  4. You should create a logo from an images from internet, and save with name Libreoffice.png
  5. If you want to use from other path, check and change the path of check_msi-exitcode.ins in the scripts

setup.ins

[Initial]
LogLevel=9
;  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
 
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $UninstallProgram32$
DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_version$
DefVar $Lang$
DefVar $Extension$
DefVar $Version$
DefVar $Inst_Cmd32$
DefVar $Inst_Cmd64$
DefVar $Inst_Prg32$
DefVar $Inst_Prg64$
DefVar $Uninst_Prg$
DefVar $InstallCommandList$
DefStringList $result1$
 
DefVar $Inst_Help_HU_32$
DefVar $Inst_Help_US_32$
DefVar $Inst_Help_FR_32$
DefVar $Inst_Help_DE_32$
 
Set $INST_SystemType$ = GetSystemType
set $Lang$ = GetProductProperty("lang","US English")
set $Extension$ = GetProductProperty("extension","Yes")
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
Set $InstallCommandList$ = ""
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $ProductId$			= "Libreoffice"
Set $Version$			= "4.0.0"
Set $MinimumSpace$		= "300 MB"
; the path were we find the product after the installation
Set $InstallDir32$		= "%ProgramFiles32Dir%\LibreOffice 4.0\"
Set $Inst_Prg32$		= "LibreOffice_4.0.0_Win_x86.msi"
Set $Inst_Prg64$		= "LibreOffice_4.0.0_Win_x86.msi"
Set $Inst_Help_HU_32$	= "LibreOffice_4.0.0_Win_x86_helppack_hu.msi"
Set $Inst_Help_US_32$	= "LibreOffice_4.0.0_Win_x86_helppack_en-US.msi"
Set $Inst_Help_FR_32$	= "LibreOffice_4.0.0_Win_x86_helppack_fr.msi"
Set $Inst_Help_DE_32$	= "LibreOffice_4.0.0_Win_x86_helppack_de.msi"
 
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
Set $Uninst_Prg$      = "uninstall.exe"
Set $Inst_Cmd32$      = '/quiet /norestart '
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'SELECT_WORD=1 SELECT_EXCEL=1 SELECT_POWERPOINT=1 '
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'REGISTER_ALL_MSO_TYPES=1 RebootYesNo=No ISCHECKFORPRODUCTUPDATES=0 QUICKSTART=0 VC_REDIST=1 '
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'ADDLOCAL=ALL REMOVE=gm_o_Quickstart,gm_o_jf_Palm,gm_o_jf_Pocketpc,gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be,gm_r_ex_Dictionary_Bg,gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Br,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Pt_Br,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Cs,gm_r_ex_Dictionary_Da,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_It,gm_r_ex_Dictionary_Ku_Tr,gm_r_ex_Dictionary_Lt,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Ro,gm_r_ex_Dictionary_Ru,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Es,gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Uk,gm_r_ex_Dictionary_Vi,'
Set $Inst_Cmd32$      = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Zu,'
; ----------------------------------------------------------------
 
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 "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
	if FileExists("%ScriptPath%\delsub.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub.ins"
	endif
 
    if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
    endif
 
	if $Lang$ = "French"
		Set $Inst_Cmd32$ = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_De UI_LANGS=en_US,fr,hu'
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_HU_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_US_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_FR_32$" + " /quiet /norestart::"
	endif				
	if $Lang$ = "German"
		Set $Inst_Cmd32$ = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Fr UI_LANGS=en_US,de,hu'
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_HU_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_US_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_DE_32$" + " /quiet /norestart::"
	endif				
	if $Lang$ = "Hungarian"
		Set $Inst_Cmd32$ = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Fr,gm_r_ex_Dictionary_De UI_LANGS=en_US,hu'
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_HU_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_US_32$" + " /quiet /norestart::"
	endif				
	if $Lang$ = "US English"
		Set $Inst_Cmd32$ = $Inst_Cmd32$ + 'gm_r_ex_Dictionary_Fr,gm_r_ex_Dictionary_De UI_LANGS=en_US,hu'
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_HU_32$" + " /quiet /norestart::"
		Set $InstallCommandList$ = $InstallCommandList$ + "MsiExec.exe /i %ScriptPath%\" + "$Inst_Help_US_32$" + " /quiet /norestart::"
	endif				
 
	if ($INST_SystemType$ = "x86 System")
		Message "Installing " + $ProductId$ + " on 32 Bit..."
		comment "Start setup program"
		Winbatch_install_32
		Sub "%ScriptPath%\check_msi-exitcode.ins"
	endif
 
    if ($INST_SystemType$ = "64 Bit System")
		Message "Installing " + $ProductId$ + " on 64 Bit..."
		comment "Start setup program"
		Winbatch_install_64
		Sub "%ScriptPath%\check_msi-exitcode.ins"
	endif
 
	if not ($InstallCommandList$ = "")
		set $result1$ = splitString($InstallCommandList$,"::")
		for $InstallCommand$ in $result1$ do Winbatch_Install
		sub "%ScriptPath%\check_msi-exitcode.ins"
	endif
 
	if $Extension$ = "Yes"
		Winbatch_Install_extension_hunart
		sub "%ScriptPath%\check_msi-exitcode.ins"
 
		Winbatch_Install_extension_numtext
		sub "%ScriptPath%\check_msi-exitcode.ins"
 
		Winbatch_Install_extension_templpack
		sub "%ScriptPath%\check_msi-exitcode.ins"
 
		Winbatch_Install_extension_templpack2
		sub "%ScriptPath%\check_msi-exitcode.ins"
	endif
 
endif
 
 
[Winbatch_install_32]
msiexec /i %ScriptPath%\$Inst_Prg32$ $Inst_Cmd32$
 
[Winbatch_install_64]
msiexec /i %ScriptPath%\$Inst_Prg64$ $Inst_Cmd32$
 
[Winbatch_Install]
$InstallCommand$
 
[Winbatch_Install_extension_hunart]
"$InstallDir32$\program\unopkg.com" add  --force --shared --verbose --suppress-license %ScriptPath%\hunart-0.3.oxt
 
[Winbatch_Install_extension_numtext]
"$InstallDir32$\program\unopkg.com" add  --force --shared --verbose --suppress-license %ScriptPath%\numbertext-0.9.4.oxt
 
[Winbatch_Install_extension_templpack]
"$InstallDir32$\program\unopkg.com" add  --force --shared --verbose --suppress-license %ScriptPath%\Sun_ODF_Template_Pack_en-US.oxt
 
[Winbatch_Install_extension_templpack2]
"$InstallDir32$\program\unopkg.com" add  --force --shared --verbose --suppress-license %ScriptPath%\Sun_ODF_Template_Pack2_en-US.oxt

uninstall.ins

[Initial]
LogLevel=9
;  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
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $DisplayName$
 
Set $INST_SystemType$ = GetSystemType
 
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$		= "LibreOffce"
Set $InstallDir32$	= "%ProgramFiles32Dir%\LibreOffice 4.0\"
Set $LicenseRequired$	= "false"
Set $LicensePool$	= "p_" + $ProductId$
; ----------------------------------------------------------------
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\delsub.ins")
        comment "Start uninstall sub section"
        Sub "%ScriptPath%\delsub.ins"
endif
 
if $LicenseRequired$ = "true"
        comment "Licensing required, free license used"
        Sub_free_license
endif
 
[Sub_free_license]
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$)

delsub.ins

DefStringList $result$
DefStringList $result1$
 
DefVar $INST_arch$
Set $INST_arch$ = "Both"
 
DefVar $INST2_SystemType$
Set $INST2_SystemType$ = GetSystemType
 
DefVar $appKey$
DefVar $UninstallCommandList$
DefVar $UninstallCommandList2$
DefVar $appString$
DefVar $appKeyString$
DefVar $testName$
DefVar $exeString$
Set $appKeyString$ = "DisplayName"
Set $appString$ = "LibreOffice"
 
if ($INST2_SystemType$ = "x86 System" OR $INST_arch$ = "Both")
	Message "Uninstalling " + $appString$ + " 32 Bit..."
	comment "Start setup program"
	Set $result$ = getRegistryKeyList32("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
	for $app$ in $result$ do Sub_searchApp32
endif
 
if ($INST2_SystemType$ = "64 Bit System" OR $INST_arch$ = "Both")
	Message "Uninstalling " + $appString$ + " 64 Bit..."
    comment "Start setup program"
	Set $result$ = getRegistryKeyList64("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
	for $app$ in $result$ do Sub_searchApp64
endif
 
if not ($UninstallCommandList$ = "")
	set $result1$ = splitString($UninstallCommandList$,"::")
	for $UninstallCommand$ in $result1$ do Winbatch_Uninstall
	sub "%ScriptPath%\check_msi-exitcode.ins"
endif
 
if fileExists($InstallDir32$)
	Files_delete_installdir
endif
 
[Sub_searchApp32]
	set $appKey$ = "[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + "$app$" + "] " + $appKeyString$
	Set $testName$ = GetRegistryStringValue32($appKey$)
	if contains($testName$,$appString$)
		set $appKey$ = "[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + "$app$" + "] UninstallString"
		Set $testName$ = GetRegistryStringValue32($appKey$)
		if contains(lower($testName$),lower("MsiExec.exe"))
			set $UninstallCommandList$ = $UninstallCommandList$ + "MsiExec.exe /x " + "$app$" + " /qb-! REBOOT=ReallySuppress::"
		else
			Set $testName$ = unquote($testName$,'"')
			Set $testName$ = unquote($testName$,"'")
			Set $exeString$ = takeString(0, splitString ($testName$, "exe"))
			set $UninstallCommandList$ = $UninstallCommandList$ + $exeString$ + "exe /S::"
		endif
	endif
 
[Sub_searchApp64]
	set $appKey$ = "[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + "$app$" + "] " + $appKeyString$
	Set $testName$ = GetRegistryStringValue64($appKey$)
	if contains($testName$,$appString$)
		set $appKey$ = "[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + "$app$" + "] UninstallString"
		Set $testName$ = GetRegistryStringValue64($appKey$)
		if contains(lower($testName$),lower("MsiExec.exe"))
			set $UninstallCommandList$ = $UninstallCommandList$ + "MsiExec.exe /x " + "$app$" + " /qb-! REBOOT=ReallySuppress::"
		else
			Set $testName$ = unquote($testName$,'"')
			Set $testName$ = unquote($testName$,"'")
			Set $exeString$ = takeString(0, splitString ($testName$, "exe"))
			set $UninstallCommandList$ = $UninstallCommandList$ + '"' + $exeString$ + 'exe /S"::'
		endif
	endif
 
[Winbatch_Uninstall]
$UninstallCommand$
 
[Files_delete_installdir]
del -f -s "$InstallDir32$"

control

[Package]
version: 2
depends: 
incremental: False

[Product]
type: localboot
id: libreoffice
name: LibreOffice 4
description: LibreOffice, the open source soluton to office programs
advice: 
version: 4.0.0
priority: 0
licenseRequired: False
productClasses: 
setupScript: setup.ins
uninstallScript: uninstall.ins
updateScript: 
alwaysScript: 
onceScript: 
customScript: 
userLoginScript: 

[ProductDependency]
action: setup
requiredProduct: jdk
requiredAction: setup
requirementType: before

[ProductProperty]
type: unicode
name: lang
multivalue: False
editable: False
description: Which lang do you want to install
values: ["French", "German", "Hungarian", "US English"]
default: ["US English"]

[ProductProperty]
type: unicode
name: extensions
multivalue: False
editable: False
description: Install extensions
values: ["No", "Yes"]
default: ["Yes"]
userspace/libreoffice_4.0.1362050483.txt.gz · Last modified: 2021/08/23 08:37 (external edit)