This commit is contained in:
Mario Fetka 2018-03-18 13:50:27 +01:00
parent 03eac47f5d
commit d8aef68130
8 changed files with 58 additions and 51 deletions

View File

@ -4,8 +4,10 @@
; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram32$ = $InstallDir32$ + "\" + $UninstallProg32$
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $UninstallProgram64$ = $InstallDir64$ + "\" + $UninstallProg64$
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")
@ -17,19 +19,20 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif
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
Set $UninstallProg32$ = GetValueFromInifile($IniFile32$,"X86","UninstallProg32","XXXXXXXX.exe")
Set $UninstallProgramOld32$ = $InstallDir32$ + "\" + $UninstallProg32$
if FileExists($UninstallProgramOld32$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_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
if FileExists($UninstallProgram32$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_32
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall_32 /32Bit
comment "Cleanup registry"
@ -45,19 +48,20 @@ if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system spe
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
Set $UninstallProg64$ = GetValueFromInifile($IniFile64$,"X86_64","UninstallProg64","XXXXXXXX.exe")
Set $UninstallProgramOld64$ = $InstallDir64$ + "\" + $UninstallProg64$
if FileExists($UninstallProgramOld64$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_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
if FileExists($UninstallProgram64$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_64
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall_64 /64Bit
comment "Cleanup registry"
@ -67,22 +71,22 @@ endif
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall_msi_old_32]
msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_old_32]
"$UninstallProgramOld32$" /SILENT
[Winbatch_uninstall_msi_32]
msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_32]
"$UninstallProgram32$" /SILENT
[Files_uninstall_32]
; Example for recursively deleting the installation directory (don't forget the trailing backslash):
;
delete -sf "$InstallDir32$\"
[Winbatch_uninstall_msi_old_64]
msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_old_64]
"$UninstallProgramOld64$" /SILENT
[Winbatch_uninstall_msi_64]
msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_64]
"$UninstallProgram64$" /SILENT
[Files_uninstall_64]
; Example for recursively deleting the installation directory:

View File

@ -6,9 +6,11 @@
[Actions]
requiredWinstVersion >= "4.11.2.6"
DefVar $MsiIdOld32$
DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $MsiIdOld64$
DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$
@ -44,7 +46,7 @@ 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 $MinimumSpace$ = "20 MB"
Set $MinimumSpace$ = "15 MB"
; the path were we find the product after the installation
Set $InstallDir32$ = "%ProgramFiles32Dir%\PeaZip"
Set $InstallDir64$ = "%ProgramFiles64Dir%\PeaZip"
@ -82,7 +84,7 @@ 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$ + " " + $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..."
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install_64
@ -98,7 +100,7 @@ else
endif
[Winbatch_install_32]
msiexec /i "$Instal32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
"$Install32Exe$" /SILENT
[Files_install_32]
; copy the ini file to the InstallDir
@ -109,7 +111,7 @@ copy "$IniCfgFile$" "$InstallDir32$"
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
[Winbatch_install_64]
msiexec /i "$Install64Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
"$Install64Exe$" /SILENT
[Files_install_64]
; copy the ini file to the InstallDir

View File

@ -6,9 +6,13 @@
[Actions]
requiredWinstVersion >= "4.11.2.6"
DefVar $MsiIdOld32$
DefVar $UninstallProg32$
DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $MsiIdOld64$
DefVar $UninstallProg64$
DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$

View File

@ -17,26 +17,23 @@ TYPE="public"
DL_FILE[0]="peazip_2.png"
DL_SOURCE[0]="http://rocketdock.com/images/screenshots/peazip_2.png"
DL_FILE[1]="peazip-${VERSION}.WINDOWS.msi"
DL_SOURCE[1]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WINDOWS.msi"
DL_FILE[1]="peazip-${VERSION}.WINDOWS.exe"
DL_SOURCE[1]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WINDOWS.exe"
DL_ARCH[1]="X86"
DL_WINST_NAME[1]=Install32Msi
DL_WINST_NAME[1]=Install32Exe
DL_FILE[2]="peazip-${VERSION}.WIN64.Msi"
DL_SOURCE[2]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WIN64.msi"
DL_FILE[2]="peazip-${VERSION}.WIN64.exe"
DL_SOURCE[2]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WIN64.exe"
DL_ARCH[2]="X86_64"
DL_WINST_NAME[2]=Install64Msi
DL_WINST_NAME[2]=Install64Exe
# File array index for the image showing while installing the program
ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="MsiId32"
OPSI_INI_VALUE[0]="{9B755822-B264-4E31-933B-9C5E90E4E295}"
# AND
OPSI_INI_OPTION[0]="UninstallProg32"
OPSI_INI_VALUE[0]="unins000.exe"
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="MsiId64"
OPSI_INI_VALUE[1]="{AFCD9F92-38B4-4EE5-B746-7F7DA8D83D1D}"
OPSI_INI_OPTION[1]="UninstallProg64"
OPSI_INI_VALUE[1]="unins000.exe"

View File

@ -1 +0,0 @@
ef0eea96109506256b9d051342ce582811bb3892 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86_64/peazip-6.5.1.WIN64.Msi

View File

@ -0,0 +1 @@
94c639cd3f12a3164b549315ba6fb5810bc588ae /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86_64/peazip-6.5.1.WIN64.exe

View File

@ -0,0 +1 @@
871cf60f8fc8d1f3dfc48390b2f0ec90bc89a821 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86/peazip-6.5.1.WINDOWS.exe

View File

@ -1 +0,0 @@
964e2f189318354cbf975f67c63f442368a16741 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86/peazip-6.5.1.WINDOWS.msi