From 6812a3c15d18d48ecb9ce554ea31d488fe1b5ddf Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 21 Jul 2012 02:33:03 +0200 Subject: [PATCH] move to new build system --- CLIENT_DATA/delsub32.ins | 15 ++- CLIENT_DATA/opsi-softmaker.office2010.ini | 6 ++ CLIENT_DATA/setup32.ins | 71 +++++++------ CLIENT_DATA/uninstall32.ins | 50 +++++---- OPSI/changelog.txt | 2 + OPSI/control | 9 +- SoftMaker-Logo.png.png.sha1sum | 1 + SoftMakerOffice2010.msi.sha1sum | 1 - Testing.txt | 28 +++++ build.sh | 121 ---------------------- builder-product.cfg | 40 +++++++ builder-targets-cb.sh | 25 +++++ ofw2010.exe.sha1sum | 1 + softmaker.png.sha1sum | 1 - 14 files changed, 193 insertions(+), 178 deletions(-) create mode 100644 CLIENT_DATA/opsi-softmaker.office2010.ini create mode 100644 SoftMaker-Logo.png.png.sha1sum delete mode 100644 SoftMakerOffice2010.msi.sha1sum create mode 100644 Testing.txt delete mode 100644 build.sh create mode 100644 builder-product.cfg create mode 100644 builder-targets-cb.sh create mode 100644 ofw2010.exe.sha1sum delete mode 100644 softmaker.png.sha1sum diff --git a/CLIENT_DATA/delsub32.ins b/CLIENT_DATA/delsub32.ins index a660d78..0f955e8 100644 --- a/CLIENT_DATA/delsub32.ins +++ b/CLIENT_DATA/delsub32.ins @@ -4,11 +4,19 @@ ; credits: http://www.opsi.org/credits/ -Set $MsiId$ = '{AC76BA86-1033-F400-BA7E-100000000002}' Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe" +Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini" Message "Uninstalling " + $ProductId$ + " ..." +if FileExists($IniFile$) + Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old + sub_check_exitcode + endif +endif if FileExists($UninstallProgram$) comment "Uninstall program found, starting uninstall" Winbatch_uninstall @@ -36,9 +44,12 @@ LinkFolder_uninstall ; "$UninstallProgram$" /S ; ; === Inno Setup ======================================================================================== -; "$UninstallProgram$" /silent /norestart +; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES +[Winbatch_uninstall_msi_old] +msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress + [Winbatch_uninstall_msi] msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress diff --git a/CLIENT_DATA/opsi-softmaker.office2010.ini b/CLIENT_DATA/opsi-softmaker.office2010.ini new file mode 100644 index 0000000..d5e889b --- /dev/null +++ b/CLIENT_DATA/opsi-softmaker.office2010.ini @@ -0,0 +1,6 @@ +[X86] +MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} + +[COMMON] +PN=softmaker.office2010 +VERSION=2010 diff --git a/CLIENT_DATA/setup32.ins b/CLIENT_DATA/setup32.ins index d3c044c..5e0db78 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -6,8 +6,11 @@ [Actions] requiredWinstVersion >= "4.10.8.6" -DefVar $MsiId$ +; DefVar $MsiId$ +DefVar $MsiIdOld$ DefVar $UninstallProgram$ +DefVar $IniFile$ +DefVar $IniCfgFile$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ @@ -19,16 +22,27 @@ 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 - ; ---------------------------------------------------------------- ;$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$ = "smoffice2010" -Set $MinimumSpace$ = "285 MB" +Set $ProductId$ = "softmaker.office2010" +Set $MinimumSpace$ = "300 MB" ; the path were we find the product after the installation -Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker\" +Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker Office 2010" +Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ ; ---------------------------------------------------------------- @@ -53,10 +67,22 @@ else Sub_get_licensekey endif + comment "Remove Setup Files" + Winbatch_remove + Sub_check_exitcode + + comment "Extract setup program" + Winbatch_extract + Sub_check_exitcode + comment "Start setup program" Winbatch_install Sub_check_exitcode + comment "Remove Setup Files" + Winbatch_remove + Sub_check_exitcode + comment "Copy files" Files_install /32Bit @@ -74,40 +100,27 @@ else ; else ; comment "Successful Installation" ; endif - - comment "Reboot" - ExitWindows /Reboot endif +[Winbatch_extract] +copy "$InstallExe$" "$LogDir$" +"$LogDir$/ofw2010.exe /ExtractCab /qb + [Winbatch_install] -; 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%\Setup.exe" /S -; ; === MSI package ======================================================================================= ; You may use the parameter PIDKEY=$Licensekey$ -msiexec /i "%ScriptPath%\files\X86FILE" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress TRANSFORMS=:lng_de.mst ADDLOCAL="ALL" +msiexec /i "$LogDir$\SupportFiles\SoftMaker Office 2010.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress TRANSFORMS=:lng_de.mst ADDLOCAL="ALL" + +[Winbatch_remove] +delete -sf "$LogDir$\SupportFiles\" +delete -sf "$LogDir$\ofw2010.exe" -; -; === 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 [Files_install] +; copy the ini file to the InstallDir +copy "$IniCfgFile$" "$InstallDir$" + ; Example of recursively copying some files into the installation directory: ; ; copy -s "%ScriptPath%\files\*.*" "$InstallDir$" diff --git a/CLIENT_DATA/uninstall32.ins b/CLIENT_DATA/uninstall32.ins index 7e88b97..8a9031d 100644 --- a/CLIENT_DATA/uninstall32.ins +++ b/CLIENT_DATA/uninstall32.ins @@ -6,9 +6,12 @@ [Actions] requiredWinstVersion >= "4.10.8.6" -DefVar $MsiId$ +; DefVar $MsiId$ +DefVar $MsiIdOld$ DefVar $UninstallProgram$ DefVar $LogDir$ +DefVar $IniFile$ +DefVar $IniCfgFile$ DefVar $ExitCode$ DefVar $ProductId$ DefVar $InstallDir$ @@ -17,12 +20,22 @@ 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 - ; ---------------------------------------------------------------- -Set $ProductId$ = "smoffice2010" -Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker" -Set $LicenseRequired$ = "true" +Set $ProductId$ = "softmaker.office2010" +Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker Office 2010" +Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ ; ---------------------------------------------------------------- @@ -43,23 +56,16 @@ if $LicenseRequired$ = "true" 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 - +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$) diff --git a/OPSI/changelog.txt b/OPSI/changelog.txt index e69de29..bc69317 100644 --- a/OPSI/changelog.txt +++ b/OPSI/changelog.txt @@ -0,0 +1,2 @@ +Don't add cahngelog entries here! +It get autogenerated by the opsi-builder.sh \ No newline at end of file diff --git a/OPSI/control b/OPSI/control index 4d2242a..1110191 100644 --- a/OPSI/control +++ b/OPSI/control @@ -5,9 +5,9 @@ incremental: False [Product] type: localboot -id: smoffice2010 +id: softmaker.office2010 name: SoftMaker Office 2010 -description: SoftMaker Office is an office suite for Microsoft Windows, Linux, FreeBSD, Windows CE, and the Pocket PC. +description: SoftMaker Office 2010 advice: ADVICE version: VERSION priority: PRIORITY @@ -30,3 +30,8 @@ description: which architecture (32/64 bit) has to be installed values: ["32 only", "64 only", "both", "system specific"] default: ["system specific"] +[ProductDependency] +action: setup +requiredProduct: sereby.aio +requiredStatus: installed +requirementType: before diff --git a/SoftMaker-Logo.png.png.sha1sum b/SoftMaker-Logo.png.png.sha1sum new file mode 100644 index 0000000..95bd454 --- /dev/null +++ b/SoftMaker-Logo.png.png.sha1sum @@ -0,0 +1 @@ +e1eebb3357be5ff64a706d0ecd9e45dd39d9f392 /home/mario/.opsi-dist-cache/softmaker.office2010-2010//SoftMaker-Logo.png.png diff --git a/SoftMakerOffice2010.msi.sha1sum b/SoftMakerOffice2010.msi.sha1sum deleted file mode 100644 index 5a3e187..0000000 --- a/SoftMakerOffice2010.msi.sha1sum +++ /dev/null @@ -1 +0,0 @@ -b7d4fcd9f2f0a66f54d5d171e99eafc35dc56260 /usr/portage/distfiles/SoftMakerOffice2010.msi diff --git a/Testing.txt b/Testing.txt new file mode 100644 index 0000000..d6b5e6c --- /dev/null +++ b/Testing.txt @@ -0,0 +1,28 @@ +*** Qualitiymanagement/Testing procedure + +- Product: + - Name: productname + - Version: xxx + - Release: yyyy + +- Environment + - OS: Native windows XP-32Bit installation + - Preinstalled packages: None (also no aio) + - Files used while testing: + File1: http://domain.de/file.ext + +- Testing process: + OPSI-action: + - Installation (without dependencies like AIO/Firefox): ?? + Result: + - File extensions related to program: ?? + - Start menu entry: ?? + - Starting/using program: viewer works, File1 is shown correctly: ?? + + OPSI-action: + - Uninstall + Result: + - File extensions related to program: unrelated: ?? + - Start menu entry: none: ?? + + diff --git a/build.sh b/build.sh deleted file mode 100644 index a60e49c..0000000 --- a/build.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -PN="smoffice2010" -VERSION="2010" -RELEASE="1" -PRIORITY="0" -ADVICE="" -TYPE="restrict" -# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python) -ICON="http://img156.imageshack.us/img156/6532/softmaker.png" -X86="http://internal.graz.disconnected-by-peer.at/Orig/SoftMaker/Office/HB/2010/SoftMakerOffice2010.msi" -#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 - 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 - 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 - diff --git a/builder-product.cfg b/builder-product.cfg new file mode 100644 index 0000000..ae7aa25 --- /dev/null +++ b/builder-product.cfg @@ -0,0 +1,40 @@ +############################ +# Setup product information +############################ +VENDOR="softmaker.de" +PN="softmaker.office2010" +VERSION="2010" +RELEASE="3" +PRIORITY="0" +ADVICE="" + +# TYPE - defines, if the install files are public or restricted. +# Valid value: restricted | public +TYPE="public" + +DL_FILE[0]="SoftMaker-Logo.png.png" +DL_SOURCE[0]="http://www.android-user.de/var/ezflow_site/storage/images/artikel/exklusiv-vorschau-auf-softmaker-office-fuer-android/softmaker-logo.png/25888-1-ger-DE/SoftMaker-Logo.png.png" + +DL_FILE[1]="ofw2010.exe" +DL_SOURCE[1]="http://www.softmaker.net/down/2010/ofw2010.exe" +DL_ARCH[1]="X86" +DL_WINST_NAME[1]=InstallExe + +# File array index for the image showing while installing the program +ICON_DL_INDEX=0 + +######################### +# Setup required WINST variables +# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ ) +# +# The following tokens inside the WINST_VALUE will be replaced dynamically +# +# if your package is not msi based then you can remove the msi part from *.ins files and drop this variables compleatly +# !!! These Variables are requred if you remove them in this cfg file you will get error's about not defined Variables !!! +# +######################### +# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one MsiId + +WINST_NAME[0]="MsiId" +WINST_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" + diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh new file mode 100644 index 0000000..9a3d4a8 --- /dev/null +++ b/builder-targets-cb.sh @@ -0,0 +1,25 @@ +############################################################################## +# This optional file "builder-targets-cb.sh" will be called by builder.sh +# +# The targets will be called from thde opsi-builder using the following +# order: config, prepare, retrieve, create, package, publish, commit, cleanup +# You can overwrite the target functions in builder-targets-cb.sh +# +# You can define callback functions. The functions are called from +# opsi-builder within processing a target +# cb_package_makeproductfile +# +# You can use every variable defined in any configuration file or by +# the defined builder script itself. Also, calling the predefined +# targets builder_ is possible. +# +# Abstract: +# target order: config, prepare, retrieve, create, package, publish, commit, cleanup +# callbacks: +# +############################################################################## + +function cleanup() { + echo "Cleanup" + builder_cleanup +} diff --git a/ofw2010.exe.sha1sum b/ofw2010.exe.sha1sum new file mode 100644 index 0000000..a3bbb70 --- /dev/null +++ b/ofw2010.exe.sha1sum @@ -0,0 +1 @@ +fbcd5ec64a6ad955a38152ee0989750bd522589b /home/mario/.opsi-dist-cache/softmaker.office2010-2010/X86/ofw2010.exe diff --git a/softmaker.png.sha1sum b/softmaker.png.sha1sum deleted file mode 100644 index 3c1fa4c..0000000 --- a/softmaker.png.sha1sum +++ /dev/null @@ -1 +0,0 @@ -68c5a0b3f04e810823b5075aecd4e184eaf07d9b /usr/portage/distfiles/softmaker.png