update to new opsi builder template

This commit is contained in:
Mario Fetka 2013-03-14 22:24:28 +01:00
parent 835cfb0d5f
commit d179028de2
6 changed files with 125 additions and 33 deletions

View File

@ -1,16 +1,29 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
Set $MsiId32$ = '{529125EF-E3AC-4B74-97E6-F688A7C0F1BF}'
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $MsiId64$ = '{529125EF-E3AC-4B74-97E6-F688A7C0F1BF}'
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 $OLD_VERSION$ = GetValueFromInifile($IniFile32$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile32$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile32$,"COMMON","RELEASE","")
endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 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 not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "")
comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi_32
@ -24,8 +37,21 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif
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 $OLD_VERSION$ = GetValueFromInifile($IniFile64$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile64$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile64$,"COMMON","RELEASE","")
endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 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 not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId64$ + "] DisplayName") = "")
comment "MSI id " + $MsiId64$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi_64
@ -41,6 +67,9 @@ endif
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall_msi_old_32]
msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi_32]
msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
@ -49,13 +78,16 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
;
delete -sf "$InstallDir32$\"
[Winbatch_uninstall_msi_old_64]
msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi_64]
msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
[Files_uninstall_64]
; Example for recursively deleting the installation directory (don't forget the trailing backslash):
; Example for recursively deleting the installation directory:
;
delete -sf "$InstallDir64$\"
del -sf "$InstallDir64$\"
[Registry_uninstall]
; Example of deleting a registry key:

24
CLIENT_DATA/login.ins Normal file
View File

@ -0,0 +1,24 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
[Actions]
Message "Profile Patch for VLC ...."
comment "Did we run this script before ? - and set version stamp in profile"
if getValue("installationstate", getProductMap) = "installed"
comment "Product is installed"
if not (scriptWasExecutedBefore)
comment "loginscript was not run yet "
Files_profile_copy
Registry_currentuser_set
endif
endif
[Files_profile_copy]
copy "%Scriptpath%\profiles\*.*" "%CurrentAppdataDir%\ACME"
[Registry_currentuser_set]
openkey [HKCU\Software\ACME]
set "show_greeting_window" = "no"

View File

@ -0,0 +1,9 @@
[X86]
MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[X86_64]
MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[COMMON]
PN=name
VERSION=version

View File

@ -1,13 +1,16 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
requiredWinstVersion >= "4.11.2.6"
DefVar $MsiId32$
DefVar $MsiId64$
DefVar $MsiIdOld32$
DefVar $IniFile32$
DefVar $MsiIdOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
@ -16,11 +19,13 @@ DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -39,31 +44,33 @@ Set $LogDir$ = "%SystemDrive%\tmp"
;$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$ = "paintdotnet.paintdotnet"
Set $MinimumSpace$ = "60 MB"
Set $MinimumSpace$ = "100 MB"
; the path were we find the product after the installation
Set $InstallDir32$ = "%CommonProgramsDir%\Paint.NET"
Set $InstallDir64$ = "%CommonProgramsDir%\Paint.NET"
Set $InstallDir32$ = "%ProgramFiles32Dir%\Paint.NET"
Set $InstallDir64$ = "%ProgramFiles64Dir%\Paint.NET"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
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$
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub.ins")
if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins"
Sub "%ScriptPath%\delsub3264.ins"
endif
comment "installing"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Installing " + $ProductId$ + " 32 Bit..."
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 32 Bit..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install_32
Sub_check_exitcode
comment "Copy files"
@ -75,8 +82,9 @@ else
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Installing " + $ProductId$ + " 64 Bit..."
Message "Installing " + $ProductId$ + " " + $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install_64
Sub_check_exitcode
comment "Copy files"
@ -93,6 +101,9 @@ endif
"$InstallExe$" /auto
[Files_install_32]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir32$"
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
@ -101,6 +112,9 @@ endif
"$InstallExe$" /auto
[Files_install_64]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir64$"
; Example of recursively copying some files into the installation directory:
;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"

View File

@ -1,13 +1,16 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
requiredWinstVersion >= "4.11.2.6"
DefVar $MsiId32$
DefVar $MsiId64$
DefVar $MsiIdOld32$
DefVar $IniFile32$
DefVar $MsiIdOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
@ -15,11 +18,13 @@ DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -35,19 +40,19 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $ProductId$ = "paintdotnet.paintdotnet"
Set $InstallDir32$ = "%CommonProgramsDir%\Paint.NET"
Set $InstallDir64$ = "%CommonProgramsDir%\Paint.NET"
Set $InstallDir32$ = "%ProgramFiles32Dir%\Paint.NET"
Set $InstallDir64$ = "%ProgramFiles64Dir%\Paint.NET"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub.ins")
if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins"
Sub "%ScriptPath%\delsub3264.ins"
endif

View File

@ -3,6 +3,8 @@
############################
VENDOR="getpaint.net"
PN="paintdotnet.paintdotnet"
NAME="Paint.NET"
DESCRIPTION="Paint.NET is free image and photo editing software for computers that run Windows."
VERSION="3.5.10"
RELEASE="1"
PRIORITY="0"
@ -19,7 +21,6 @@ DL_SOURCE[0]="http://iyds.net/wp-content/paintnet.jpg"
DL_FILE[1]="Paint.NET.${VERSION}.Install.zip"
DL_SOURCE[1]="http://www.dotpdn.com/files/Paint.NET.${VERSION}.Install.zip"
DL_ARCH[1]="X86"
DL_DOWNLOADER[1]="wget"
DL_EXTRACT_FORMAT[1]="unzip"
# File array index for the image showing while installing the program
@ -28,3 +29,10 @@ ICON_DL_INDEX=0
WINST_NAME[0]="InstallExe"
WINST_VALUE[0]="@DL_EXTRACT_WINST_PATH[1]@\\Paint.NET.${VERSION}.Install.exe"
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="MsiId32"
OPSI_INI_VALUE[0]="{529125EF-E3AC-4B74-97E6-F688A7C0F1BF}"
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="MsiId64"
OPSI_INI_VALUE[1]="{529125EF-E3AC-4B74-97E6-F688A7C0F1BF}"