Update to new buildsystem and integrate sp3

This commit is contained in:
Mario Fetka 2012-04-25 20:27:02 +02:00
parent 583725a8ed
commit 461913d8d7
6 changed files with 42 additions and 173 deletions

View File

@ -1 +0,0 @@
add639872cad35b4e162ea7d96ce35fb7900307f /usr/portage/distfiles/48331096-260x260-0-0_Microsoft+MS+1x+Office+2007+Small+Business+V2+Offi.jpg

View File

@ -5,15 +5,9 @@
Set $MsiId$ = '{91120000-00CA-0000-0000-0000000FF1CE}'
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
sub_check_exitcode
endif
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi
@ -29,16 +23,6 @@ Registry_uninstall /32Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; "$UninstallProgram$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram$" /silent /norestart
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress

View File

@ -7,7 +7,6 @@
requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
@ -19,6 +18,16 @@ DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
@ -53,6 +62,18 @@ else
Sub_get_licensekey
endif
comment "Extract Office"
Winbatch_extract
Sub_check_exitcode
comment "Extract Office Updates"
Winbatch_update
Sub_check_exitcode
comment "Create License File"
Dosbatch_license
Sub_check_exitcode
comment "Start setup program"
Winbatch_install
Sub_check_exitcode
@ -77,36 +98,17 @@ else
endif
[Winbatch_extract]
$InstallExe$ /quiet /extract:$LogDir$\msoffice2007
[Winbatch_update]
$InstallSp3Exe$ /quiet /extract:$LogDir$\msoffice2007\Updates
[Dosbatch_license]
xml ed -O -u "/Configuration/PIDKEY/@Value" -v $LicenseKey$ -u "/Configuration/USERNAME/@Value" -v %HostID% -u "/Configuration/COMPANYNAME/@Value" -v %HostID% -u "/Configuration/INSTALLLOCATION/@Value" -v $InstallDir$ %ScriptPath%\config.xml > $LogDir$\msoffice2007.xml
[Winbatch_install]
xml ed -O -u "/Configuration/PIDKEY/@Value" -v $LicenseKey$ -u "/Configuration/USERNAME/@Value" -v %HostID% -u "/Configuration/COMPANYNAME/@Value" -v %HostID% -u "/Configuration/INSTALLLOCATION/@Value" -v $InstallDir$ %ScriptPath%\config.xml > %ScriptPath%\opsiconfig.xml
; Choose one of the following examples as basis for your installation
; You can use $LicenseKey$ var to pass a license key to the installer
;
; === Nullsoft Scriptable Install System ================================================================
"%ScriptPath%\files\SETUP.EXE" /config "%ScriptPath%\opsiconfig.xml"
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress
;
; === InstallShield + MSI=====================================================================================
; Attention: The path to the log file should not contain any whitespaces
; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb! ALLUSERS=2 REBOOT=ReallySuppress"
; "%ScriptPath%\setup.exe" /s /v" /qb! ALLUSERS=2 REBOOT=ReallySuppress"
;
; === InstallShield =====================================================================================
; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss"
; "%ScriptPath%\setup.exe" /s /sms /f1"%ScriptPath%\setup.iss" /f2"$LogDir$\$ProductId$.install_log.txt"
;
; === Inno Setup ========================================================================================
; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
; You may create setup answer file by: setup.exe /SAVEINF="filename"
; You may use an answer file by the parameter /LOADINF="filename"
; "%ScriptPath%\setup.exe" /sp- /silent /norestart
"$LogDir$\msoffice2007\SETUP.EXE" /config "$LogDir$\msoffice2007.xml"
[Files_install]
; Example of recursively copying some files into the installation directory:

View File

@ -7,7 +7,6 @@
requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
@ -17,6 +16,16 @@ DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------

View File

@ -1 +0,0 @@
fd4975b0633406781b7ec8b2e1237684b6a0105f /usr/portage/distfiles/Microsoft-Office-2007sbe-disk1.iso

124
build.sh
View File

@ -1,124 +0,0 @@
#!/bin/sh
PN="msoffice2007"
VERSION="2007"
RELEASE="2"
PRIORITY="0"
ADVICE=""
TYPE="restrict"
# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python)
ICON="http://di1-1.shoppingshadow.com/images/pi/36/84/bc/48331096-260x260-0-0_Microsoft+MS+1x+Office+2007+Small+Business+V2+Offi.jpg"
X86="http://internal.graz.disconnected-by-peer.at/Orig/Microsoft/Office/SBE/2007/Microsoft-Office-2007sbe-disk1.iso"
#AMD64="http://downloads.sourceforge.net/sevenzip/7z920-x64.msi"
ICONFILE=${ICON##*/}
X86FILE=${X86##*/}
#AMD64FILE=${AMD64##*/}
if [ -e /var/tmp/opsi/upload/$TYPE/${PN}_${VERSION}-${RELEASE}.opsi ]
then
echo "package ${PN}_${VERSION}-${RELEASE}.opsi already generated"
exit 1
fi
OUT=$(mktemp -d /tmp/output.XXXXXXXXXX) || { echo "Failed to create temp dir"; exit 1; }
mkdir $OUT/$PN
cp -Rv OPSI CLIENT_DATA $OUT/$PN
unix2dos $OUT/$PN/CLIENT_DATA/*
if [ -e /usr/portage/distfiles/$ICONFILE ]
then
if [ -e $ICONFILE.sha1sum ]
then
SHA1SUM=`cat $ICONFILE.sha1sum`
CHECKSUM=`sha1sum /usr/portage/distfiles/$ICONFILE`
if [ "$CHECKSUM" = "$SHA1SUM" ]
then
convert -colorspace rgb /usr/portage/distfiles/$ICONFILE -transparent white -background transparent -resize 160x160\> \
-size 160x160 xc:transparent +swap -gravity center -composite $OUT/$PN/CLIENT_DATA/$PN.png
else
echo "The checksums do not match."
exit 1
fi
else
echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$ICONFILE > $ICONFILE.sha1sum"
exit 1
fi
else
echo "Downloading file"
wget -P /usr/portage/distfiles/ $ICON
exit 1
fi
if [ -e /usr/portage/distfiles/$X86FILE ]
then
if [ -e $X86FILE.sha1sum ]
then
SHA1SUM=`cat $X86FILE.sha1sum`
CHECKSUM=`sha1sum /usr/portage/distfiles/$X86FILE`
if [ "$CHECKSUM" = "$SHA1SUM" ]
then
#cp /usr/portage/distfiles/$X86FILE $OUT/$PN/CLIENT_DATA
mkdir -p $OUT/$PN/CLIENT_DATA/files
7z x -o$OUT/$PN/CLIENT_DATA/files /usr/portage/distfiles/$X86FILE
else
echo "The checksums do not match."
exit 1
fi
else
echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$X86FILE > $X86FILE.sha1sum"
exit 1
fi
else
echo "Downloading file"
#wget -O /usr/portage/distfiles/$X86FILE $X86
plowdown -o /usr/portage/distfiles $X86
exit 1
fi
# if [ -e /usr/portage/distfiles/$AMD64FILE ]
# then
# if [ -e $AMD64FILE.sha1sum ]
# then
# SHA1SUM=`cat $AMD64FILE.sha1sum`
# CHECKSUM=`sha1sum /usr/portage/distfiles/$AMD64FILE`
# if [ "$CHECKSUM" = "$SHA1SUM" ]
# then
# cp /usr/portage/distfiles/$AMD64FILE $OUT/$PN/CLIENT_DATA
# else
# echo "The checksums do not match."
# exit 1
# fi
# else
# echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$AMD64FILE > $AMD64FILE.sha1sum"
# exit 1
# fi
# else
# echo "Downloading file"
# wget -P /usr/portage/distfiles/ $AMD64
# exit 1
# fi
sed -e "s!VERSION!$VERSION!g" -e "s!RELEASE!$RELEASE!g" -e "s!PRIORITY!$PRIORITY!g" -e "s!ADVICE!$ADVICE!g" -i $OUT/$PN/OPSI/control
#sed -e "s!X86FILE!$X86FILE!g" -e "s!AMD64FILE!$AMD64FILE!g" -i $OUT/$PN/CLIENT_DATA/setup.ins
sed -e "s!X86FILE!$X86FILE!g" -i $OUT/$PN/CLIENT_DATA/setup32.ins
if test -d ".git"; then
git log --date-order --date=short | \
sed -e '/^commit.*$/d' | \
awk '/^Author/ {sub(/\\$/,""); getline t; print $0 t; next}; 1' | \
sed -e 's/^Author: //g' | \
sed -e 's/>Date: \([0-9]*-[0-9]*-[0-9]*\)/>\t\1/g' | \
sed -e 's/^\(.*\) \(\)\t\(.*\)/\3 \1 \2/g' > $OUT/$PN/OPSI/changelog.txt
else
echo "No git repository present."
exit 1
fi
pushd $OUT
opsi-makeproductfile -v $OUT/$PN
popd
mkdir -p /var/tmp/opsi/upload/$TYPE/
cp -afv $OUT/*.opsi /var/tmp/opsi/upload/$TYPE/
#rm -rf $OUT