summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Trinks <[email protected]>2012-09-24 12:43:20 (GMT)
committer Dennis Trinks <[email protected]>2012-09-24 12:43:20 (GMT)
commit4e92928834be736a7b3e87566fe6256e347f6d10 (patch)
treead6ec05c422fd1c00ac3c9f7332604b19aa66035
parent93fb36ab63063b6ff5b4cac2c9c4072b7f1e6548 (diff)
parent1f212c3b4995526e85467636be82316a288421e8 (diff)
Merge branch 'master' of disconnected-by-peer.at:go-opsi/opsi.opsi-builder
-rw-r--r--lib/builder-targets.sh1
-rw-r--r--lib/builder-utils.sh4
-rw-r--r--sample/product-template/CLIENT_DATA/delsub32.ins13
-rw-r--r--sample/product-template/CLIENT_DATA/delsub3264.ins30
-rw-r--r--sample/product-template/CLIENT_DATA/delsub64.ins13
-rw-r--r--sample/product-template/CLIENT_DATA/opsi-PN.ini11
-rw-r--r--sample/product-template/CLIENT_DATA/setup32.ins9
-rw-r--r--sample/product-template/CLIENT_DATA/setup3264.ins14
-rw-r--r--sample/product-template/CLIENT_DATA/setup64.ins7
-rw-r--r--sample/product-template/CLIENT_DATA/uninstall32.ins5
-rw-r--r--sample/product-template/CLIENT_DATA/uninstall3264.ins9
-rw-r--r--sample/product-template/CLIENT_DATA/uninstall64.ins5
-rw-r--r--sample/product-template/builder-product.cfg25
13 files changed, 132 insertions, 14 deletions
diff --git a/lib/builder-targets.sh b/lib/builder-targets.sh
index 6fc3c12..381853d 100644
--- a/lib/builder-targets.sh
+++ b/lib/builder-targets.sh
@@ -16,6 +16,7 @@ builder_config() {
CMD_unrar="`which unrar`" ; builder_check_error "Command 'unrar' not installed"
CMD_zip="`which zip`" ; builder_check_error "Command 'zip' not installed"
CMD_lha="`which lha`" ; builder_check_error "Command 'lha' not installed"
+ CMD_tar="`which tar`" ; builder_check_error "Command 'tar' not installed"
CMD_unix2dos="`which unix2dos`" ; builder_check_error "Command 'unix2dos' not installed"
CMD_identify="`which identify`" ; builder_check_error "Command 'identify' (ImageMagick) not installed"
CMD_zsyncmake="`which zsyncmake`" ; builder_check_error "Command 'zsyncmake' not installed"
diff --git a/lib/builder-utils.sh b/lib/builder-utils.sh
index 6ac35ea..a0dc093 100644
--- a/lib/builder-utils.sh
+++ b/lib/builder-utils.sh
@@ -64,6 +64,10 @@ function process_file() {
$CMD_unrar x $src $dst
elif [ "$format" = "lha" ]; then
$CMD_lha x -w=$dst $src
+ elif [ "$format" = "targz" ]; then
+ $CMD_tar xzvf $src -C $dst
+ elif [ "$format" = "tarbz2" ]; then
+ $CMD_tar xjvf $src -C $dst
else
fatal_error "Unknown compression format: $format"
fi
diff --git a/sample/product-template/CLIENT_DATA/delsub32.ins b/sample/product-template/CLIENT_DATA/delsub32.ins
index f9bbf36..0f955e8 100644
--- a/sample/product-template/CLIENT_DATA/delsub32.ins
+++ b/sample/product-template/CLIENT_DATA/delsub32.ins
@@ -4,11 +4,19 @@
; credits: http://www.opsi.org/credits/
-Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
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
@@ -39,6 +47,9 @@ LinkFolder_uninstall
; "$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/sample/product-template/CLIENT_DATA/delsub3264.ins b/sample/product-template/CLIENT_DATA/delsub3264.ins
index be5e544..c3f7f1d 100644
--- a/sample/product-template/CLIENT_DATA/delsub3264.ins
+++ b/sample/product-template/CLIENT_DATA/delsub3264.ins
@@ -4,15 +4,25 @@
; credits: http://www.opsi.org/credits/
-Set $MsiId32$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe"
-
-Set $MsiId64$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram64$ = $InstallDir64$ + "\uninstall.exe"
+Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
+Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini"
+
+
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Uninstalling " + $ProductId$ + " 32 Bit..."
+ if FileExists($IniFile32$)
+ Set $MsiIdOld32$ = GetValueFromInifile($IniFile32$,"X86","MsiId32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
+ if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld32$ + "] DisplayName") = "")
+ comment "Old MSI id " + $MsiIdOld32$ + " found in registry, starting msiexec to uninstall old version"
+ Winbatch_uninstall_msi_old_32
+ sub_check_exitcode
+ endif
+ endif
+
if FileExists($UninstallProgram32$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_32
@@ -34,6 +44,14 @@ endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Uninstalling " + $ProductId$ + " 64 Bit..."
+ if FileExists($IniFile64$)
+ Set $MsiIdOld64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
+ if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld64$ + "] DisplayName") = "")
+ comment "Old MSI id " + $MsiIdOld64$ + " found in registry, starting msiexec to uninstall old version"
+ Winbatch_uninstall_msi_old_64
+ sub_check_exitcode
+ endif
+ endif
if FileExists($UninstallProgram64$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_64
@@ -65,6 +83,9 @@ LinkFolder_uninstall
; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES
+[Winbatch_uninstall_msi_old_32]
+msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress
+
[Winbatch_uninstall_msi_32]
msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
@@ -83,6 +104,9 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES
+[Winbatch_uninstall_msi_old_64]
+msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress
+
[Winbatch_uninstall_msi_64]
msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
diff --git a/sample/product-template/CLIENT_DATA/delsub64.ins b/sample/product-template/CLIENT_DATA/delsub64.ins
index a633255..894f772 100644
--- a/sample/product-template/CLIENT_DATA/delsub64.ins
+++ b/sample/product-template/CLIENT_DATA/delsub64.ins
@@ -4,11 +4,19 @@
; credits: http://www.opsi.org/credits/
-Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
+Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
Message "Uninstalling " + $ProductId$ + " ..."
+if FileExists($IniFile$)
+ Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
+ if not (GetRegistryStringValue64("[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
@@ -39,6 +47,9 @@ LinkFolder_uninstall
; "$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/sample/product-template/CLIENT_DATA/opsi-PN.ini b/sample/product-template/CLIENT_DATA/opsi-PN.ini
new file mode 100644
index 0000000..978f02e
--- /dev/null
+++ b/sample/product-template/CLIENT_DATA/opsi-PN.ini
@@ -0,0 +1,11 @@
+[X86]
+MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
+MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
+
+[X86_64]
+MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
+MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
+
+[COMMON]
+PN=name
+VERSION=version
diff --git a/sample/product-template/CLIENT_DATA/setup32.ins b/sample/product-template/CLIENT_DATA/setup32.ins
index 3333fbd..43d4214 100644
--- a/sample/product-template/CLIENT_DATA/setup32.ins
+++ b/sample/product-template/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$
@@ -39,6 +42,7 @@ Set $ProductId$ = "opsi-template"
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\<path to the product>"
+Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
@@ -114,6 +118,9 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[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/sample/product-template/CLIENT_DATA/setup3264.ins b/sample/product-template/CLIENT_DATA/setup3264.ins
index 7ff0f3e..6c9d30e 100644
--- a/sample/product-template/CLIENT_DATA/setup3264.ins
+++ b/sample/product-template/CLIENT_DATA/setup3264.ins
@@ -6,10 +6,15 @@
[Actions]
requiredWinstVersion >= "4.10.8.6"
-DefVar $MsiId32$
+; DefVar $MsiId32$
+DefVar $MsiIdOld32$
DefVar $UninstallProgram32$
-DefVar $MsiId64$
+DefVar $IniFile32$
+; DefVar $MsiId64$
+DefVar $MsiIdOld64$
DefVar $UninstallProgram64$
+DefVar $IniFile64$
+DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
@@ -49,6 +54,7 @@ Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir32$ = "%ProgramFiles32Dir%\<path to the product>"
Set $InstallDir64$ = "%ProgramFiles64Dir%\<path to the product>"
+Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
@@ -128,6 +134,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install_32]
+copy "$IniCfgFile$" "$InstallDir32$"
+
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
@@ -159,6 +167,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install_64]
+copy "$IniCfgFile$" "$InstallDir64$"
+
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
diff --git a/sample/product-template/CLIENT_DATA/setup64.ins b/sample/product-template/CLIENT_DATA/setup64.ins
index 045cf7f..d4ebde1 100644
--- a/sample/product-template/CLIENT_DATA/setup64.ins
+++ b/sample/product-template/CLIENT_DATA/setup64.ins
@@ -6,9 +6,11 @@
[Actions]
requiredWinstVersion >= "4.10.8.6"
-DefVar $MsiId$
+; DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
+DefVar $IniFile$
+DefVar $IniCfgFile$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
@@ -39,6 +41,7 @@ Set $ProductId$ = "opsi-template"
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
+Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
@@ -114,6 +117,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install]
+copy "$IniCfgFile$" "$InstallDir$"
+
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
diff --git a/sample/product-template/CLIENT_DATA/uninstall32.ins b/sample/product-template/CLIENT_DATA/uninstall32.ins
index ede4908..97e01be 100644
--- a/sample/product-template/CLIENT_DATA/uninstall32.ins
+++ b/sample/product-template/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$
diff --git a/sample/product-template/CLIENT_DATA/uninstall3264.ins b/sample/product-template/CLIENT_DATA/uninstall3264.ins
index 4dec196..2396024 100644
--- a/sample/product-template/CLIENT_DATA/uninstall3264.ins
+++ b/sample/product-template/CLIENT_DATA/uninstall3264.ins
@@ -6,10 +6,15 @@
[Actions]
requiredWinstVersion >= "4.10.8.6"
-DefVar $MsiId32$
+; DefVar $MsiId32$
+DefVar $MsiIdOld32$
DefVar $UninstallProgram32$
-DefVar $MsiId64$
+DefVar $IniFile32$
+; DefVar $MsiId64$
+DefVar $MsiIdOld64$
DefVar $UninstallProgram64$
+DefVar $IniFile64$
+DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
diff --git a/sample/product-template/CLIENT_DATA/uninstall64.ins b/sample/product-template/CLIENT_DATA/uninstall64.ins
index 0eb5f4e..e64e576 100644
--- a/sample/product-template/CLIENT_DATA/uninstall64.ins
+++ b/sample/product-template/CLIENT_DATA/uninstall64.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 $ExitCode$
DefVar $ProductId$
diff --git a/sample/product-template/builder-product.cfg b/sample/product-template/builder-product.cfg
index 7501b12..1e9ff4f 100644
--- a/sample/product-template/builder-product.cfg
+++ b/sample/product-template/builder-product.cfg
@@ -103,7 +103,7 @@ DL_WINST_NAME[2]=itWESS64
DL_FILE[3]="AiO-Runtimes-x86-v1.7.1.7z"
DL_SOURCE[3]="http://ftp.computerbase.de/dl-758/weJMhoTGCTbFI5mzRnMlAg/1327825564/AiO-Runtimes-x86-v1.7.1.7z"
DL_ARCH[3]="X86"
-DL_DOWNLOADER="wget"
+DL_DOWNLOADER[3]="wget"
DL_EXTRACT_FORMAT[3]="unzip"
DL_EXTACT_TO[3]="office"
@@ -111,6 +111,29 @@ DL_EXTACT_TO[3]="office"
ICON_DL_INDEX=0
#########################
+# Setup required WINST variables
+# which will be injected to the *.ins files (replaces token @@[email protected]@ )
+#
+# 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}"
+
+# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 MsiId's
+
+WINST_NAME[0]="MsiId32"
+WINST_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
+
+WINST_NAME[1]="MsiId64"
+WINST_VALUE[1]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
+
+#########################
# Setup additional, custom WINST variables
# which will be injected to the *.ins files (replaces token @@[email protected]@ )
#

Powered by Domaintechnik.at | Hosting - Domain - Webspace