update to new opsi builder templates

This commit is contained in:
Mario Fetka 2013-03-13 14:00:32 +01:00
parent 5c40ab647c
commit e3fd8667ee
8 changed files with 234 additions and 29 deletions

View File

@ -2,11 +2,71 @@
; This sourcecode is owned by uib gmbh ; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License. ; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/ ; credits: http://www.opsi.org/en/credits/
DefStringlist $outlist$
Set $UninstallProgram$ = $InstallDir$ + "\gpg4win-uninstall.exe" Set $UninstallProgram$ = $InstallDir$ + "\gpg4win-uninstall.exe"
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
Message "Uninstalling " + $ProductId$ + " ..." if FileExists($IniFile$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
endif
Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
if FileExists($IniFile$)
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
if FileExists($UninstallProgramOld$)
comment "Uninstall program found, starting uninstall"
killtask "kleopatra.exe"
killtask "gpg-agent.exe"
killtask "dirmngr.exe"
killtask "dbus-daemon.exe"
killtask "qdbus.exe"
Files_uninstall_special
setLoglevel = 7
set $outlist$ = getProcessList
DosInAnIcon_kill_tasks winst /32bit
set $outlist$ = getProcessList
Files_uninstall_special
Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 30
sub_check_exitcode
if not ("" = takefirststringcontaining(getProcessList,"Au_.exe"))
killtask "qdbus.exe"
killtask "kleopatra.exe"
killtask "gpg-agent.exe"
killtask "dirmngr.exe"
killtask "dbus-daemon.exe"
sleepseconds "10"
set $outlist$ = getProcessList
endif
if not ("" = takefirststringcontaining(getProcessList,"Au_.exe"))
killtask "qdbus.exe"
killtask "kleopatra.exe"
killtask "gpg-agent.exe"
killtask "dirmngr.exe"
killtask "dbus-daemon.exe"
sleepseconds "10"
set $outlist$ = getProcessList
endif
if not ("" = takefirststringcontaining(getProcessList,"Au_.exe"))
killtask "qdbus.exe"
killtask "kleopatra.exe"
killtask "gpg-agent.exe"
killtask "dirmngr.exe"
killtask "dbus-daemon.exe"
sleepseconds "10"
set $outlist$ = getProcessList
endif
if not ("" = takefirststringcontaining(getProcessList,"Au_.exe"))
set $outlist$ = getProcessList
LogError("uninstallation failed")
isFatalError
endif
setLoglevel = 6
endif
endif
if FileExists($UninstallProgram$) if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
@ -61,11 +121,21 @@ endif
comment "Delete files" comment "Delete files"
Files_uninstall /32Bit Files_uninstall /32Bit
comment "Cleanup registry"
Registry_uninstall /32Bit
comment "Delete program shortcuts"
LinkFolder_uninstall
[Winbatch_uninstall_old]
"$UninstallProgramOld$" /S
[Winbatch_uninstall] [Winbatch_uninstall]
; === Nullsoft Scriptable Install System ================================================================
"$UninstallProgram$" /S "$UninstallProgram$" /S
[Files_uninstall] [Files_uninstall]
; Example for recursively deleting the installation directory:
;
del -sf "$InstallDir$\" del -sf "$InstallDir$\"
[Files_uninstall_special] [Files_uninstall_special]
@ -77,6 +147,23 @@ taskkill /IM "gpg-agent.exe" /F
taskkill /IM "dirmngr.exe" /F taskkill /IM "dirmngr.exe" /F
taskkill /IM "dbus-daemon.exe" /F taskkill /IM "dbus-daemon.exe" /F
[Registry_uninstall]
; Example of deleting a registry key:
;
; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
[LinkFolder_uninstall]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of deleting a shortcut from AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
; delete_element $ProductId$
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode set $ExitCode$ = getLastExitCode
@ -94,12 +181,10 @@ else
if ($ExitCode$ = "1641") if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641" comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
Exitwindows /Reboot
else else
if ($ExitCode$ = "3010") if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010" comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
Exitwindows /Reboot
else else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError isFatalError

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,5 @@
[X86]
[COMMON]
PN=name
VERSION=version

View File

@ -6,18 +6,20 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $MsiId$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ProductId$ DefVar $ProductId$
DefVar $MinimumSpace$ DefVar $MinimumSpace$
DefVar $InstallDir$ DefVar $InstallDir$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $LicenseRequired$ DefVar $OLD_VERSION$
DefVar $LicenseKey$ DefVar $OLD_CREATOR_TAG$
DefVar $LicensePool$ DefVar $OLD_RELEASE$
Set $LogDir$ = "%SystemDrive%\opsi.org\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables: ; and adds the following variables:
@ -33,38 +35,122 @@ Set $LogDir$ = "%SystemDrive%\opsi.org\tmp"
; - Please edit the following values - ; - Please edit the following values -
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi ;$ProductId$ should be the name of the product in opsi
Set $ProductId$ = "gpg4win.gpg4win" ; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $MinimumSpace$ = "200 MB" Set $MinimumSpace$ = "200 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\gnupg" Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\gnupg"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$)) if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$ LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError isFatalError "No Space"
; Stop process and set installation status to failed ; Stop process and set installation status to failed
else else
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub32.ins") if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins" Sub "%ScriptPath%\delsub32.ins"
endif endif
Message "Installing " + $ProductId$ + " ..." Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
comment "Start setup program" comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%" ChangeDirectory "%SCRIPTPATH%"
Winbatch_install Winbatch_install
Sub_check_exitcode Sub_check_exitcode
comment "Copy files"
Files_install /32Bit
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
endif endif
[Winbatch_install] [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 ================================================================ ; === Nullsoft Scriptable Install System ================================================================
"$InstallExe$" /S ; "%ScriptPath%\Setup.exe" /S
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 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=1 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"
; You may use an answer file by the parameter /f1"c:\setup.iss"
; "%ScriptPath%\setup.exe" /s /sms /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 /nocancel /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$"
[Registry_install]
; Example of setting some values of an registry key:
;
; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
; set "name1" = "some string value"
; set "name2" = REG_DWORD:0001
; set "name3" = REG_BINARY:00 af 99 cd
[LinkFolder_install]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
;
; set_basefolder common_programs
; set_subfolder $ProductId$
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters:
; working_dir: $InstallDir$
; icon_file:
; icon_index:
; end_link
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
;
; set_link
; name: $ProductId$
; target: <path to the program>
; parameters: <some_param>
; working_dir: $InstallDir$
; icon_file: <path to icon file>
; icon_index: 2
; end_link
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"
@ -83,12 +169,10 @@ else
if ($ExitCode$ = "1641") if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641" comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
Exitwindows /Reboot
else else
if ($ExitCode$ = "3010") if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010" comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
Exitwindows /Reboot
else else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError isFatalError

View File

@ -6,16 +6,19 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $MsiId$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$
DefVar $InstallDir$ DefVar $InstallDir$
DefVar $LicenseRequired$ DefVar $OLD_VERSION$
DefVar $LicensePool$ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $LogDir$ = "%SystemDrive%\opsi.org\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables: ; and adds the following variables:
@ -30,14 +33,13 @@ Set $LogDir$ = "%SystemDrive%\opsi.org\tmp"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
; - Please edit the following values - ; - Please edit the following values -
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $ProductId$ = "gpg4win.gpg4win"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\gnupg" Set $InstallDir$ = "%ProgramFiles32Dir%\gnu\gnupg"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..." Message "Uninstalling " + $ProductId$ + " ..."
@ -46,4 +48,3 @@ if FileExists("%ScriptPath%\delsub32.ins")
Sub "%ScriptPath%\delsub32.ins" Sub "%ScriptPath%\delsub32.ins"
endif endif

View File

@ -1 +0,0 @@
96902fd180c2c61cac795e486dff5c5c49663e96 /home/mario/.opsi-dist-cache/gpg4win.gpg4win-2.1.0//GnuPG_logo_2006.png

View File

@ -3,6 +3,8 @@
############################ ############################
VENDOR="gpg4win.de" VENDOR="gpg4win.de"
PN="gpg4win.gpg4win" PN="gpg4win.gpg4win"
NAME="GPG \\ 4Win"
DESCRIPTION"GnuPG Windows Helper"
VERSION="2.1.0" VERSION="2.1.0"
RELEASE="3" RELEASE="3"
PRIORITY="0" PRIORITY="0"
@ -13,8 +15,8 @@ ADVICE=""
TYPE="public" TYPE="public"
DL_FILE[0]="GnuPG_logo_2006.png" DL_FILE[0]="gpg4win.jpg"
DL_SOURCE[0]="http://upload.wikimedia.org/wikipedia/ro/f/f1/GnuPG_logo_2006.png" DL_SOURCE[0]="http://petrkout.com/wp-content/uploads/2012/03/gpg4win.jpg"
DL_FILE[1]="gpg4win-${VERSION}.exe" DL_FILE[1]="gpg4win-${VERSION}.exe"
DL_SOURCE[1]="http://files.gpg4win.org/gpg4win-${VERSION}.exe" DL_SOURCE[1]="http://files.gpg4win.org/gpg4win-${VERSION}.exe"
@ -23,3 +25,7 @@ DL_WINST_NAME[1]=InstallExe
# File array index for the image showing while installing the program # File array index for the image showing while installing the program
ICON_DL_INDEX=0 ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_VALUE[0]="gpg4win-uninstall.exe"

1
gpg4win.jpg.sha1sum Normal file
View File

@ -0,0 +1 @@
0bd8715e6493e762f44ad3ab019777518753cc58 /home/mario/.opsi-dist-cache/gpg4win.gpg4win-2.1.0//gpg4win.jpg