da ich mich in den letzten zwei Monaten ausschließlich mit OPSI beschäftigt, hauptsächlich Installation und Konfiguration.
Nun bin ich dabei Software zu paketieren und ggf. anzupassen für die Verteilung.
Da ich viel mit Deployment Systeme arbeite und auch einen Standard (ISO/IEC 25051) habe würde ich dieses auch mit der OPSI umsetzten wollen.
z.B. nach einer erfolgreichen Installation sollte eine Stemple in der Registry gesetzt werden
HKLM\Software\{Fa. Name}\Signature\ProductID
Creator=Admin
Customer={Fa. Name}
SoftwareCode=00001
Vendor=Igor-Pavlov
ProgramName=7Zip
ProgramVersion=9.20
DateOfCreation=10.03.2014
PackageVersion=1.0
ProductCode={23170F69-40C1-2702-0920-000001000000}
Language=DE
PackageType=C
Type=x64
Nun habe ich schon versucht dies umzusetzen, aber ich bekomm das einfach nicht hin (der Wald und die Bäume


Noch schöner wäre, dass geprüft wird ob die Installation erfolgreich durchgelaufen ist und das ich alles über Variablen lösen könnte.
If ($ExitCode$ = "0" OR $ExitCode$ ="1641" OR $ExitCode$ ="3010")
openkey [HKLM\FaName\$ProductId$]
set "Software" = "$ProductId$"
set "Version" = "9.22"
endif
Installation erfolgreich setzten der Reg werte
Code: Alles auswählen
; Copyright (c) uib gmbh (http://www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.3.3"
DefVar $MsiId$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorMsg$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
include_append "%ScriptPath%\check_msi_exitcode.opsiscript"
; ----------------------------------------------------------------
; - 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$ = "7-Zip"
Set $MinimumSpace$ = "8 MB"
; the path were we find the product after the installation
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError "No Space"
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
Message "Installing " + $ProductId$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install
Sub_check_exitcode
Registry_TestPatch
endif
[Winbatch_install]
msiexec /i "%ScriptPath%\7z922-x64.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Registry_TestPatch]
openkey [HKLM\FaName\$ProductId$]
set "Software" = "$ProductId$"
set "Version" = "9.22"
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"
comment "Trying to get a license key"
Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
; If there is an assignment of exactly one licensepool to the product the following call is possible:
; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use:
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$
if $ServiceErrorClass$ = "None"
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
else
if $ServiceErrorClass$ = "LicenseConfigurationError"
LogError "Fatal: license configuration must be corrected"
LogError getLastServiceErrorMessage
isFatalError
else
if $ServiceErrorClass$ = "LicenseMissingError"
LogError "Fatal: required license is not supplied"
isFatalError
endif
endif
endif
else
LogError "Fatal: license required, but license management not enabled"
isFatalError
endif
; Copyright (c) uib gmbh (http://www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.3.3"
DefVar $MsiId$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorMsg$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
include_append "%ScriptPath%\check_msi_exitcode.opsiscript"
; ----------------------------------------------------------------
; - 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$ = "7-Zip"
Set $MinimumSpace$ = "8 MB"
; the path were we find the product after the installation
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError "No Space"
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
if FileExists("%ScriptPath%\delsub64.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub64.opsiscript"
endif
Message "Installing " + $ProductId$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install
Sub_check_exitcode
Registry_TestPatch
endif
[Winbatch_install]
msiexec /i "%ScriptPath%\7z922-x64.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Registry_TestPatch]
openkey [HKLM\FaName\$ProductId$]
set "Software" = "$ProductId$"
set "Version" = "9.22"
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used"
comment "Trying to get a license key"
Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
; If there is an assignment of exactly one licensepool to the product the following call is possible:
; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use:
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$
if $ServiceErrorClass$ = "None"
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
else
if $ServiceErrorClass$ = "LicenseConfigurationError"
LogError "Fatal: license configuration must be corrected"
LogError getLastServiceErrorMessage
isFatalError
else
if $ServiceErrorClass$ = "LicenseMissingError"
LogError "Fatal: required license is not supplied"
isFatalError
endif
endif
endif
else
LogError "Fatal: license required, but license management not enabled"
isFatalError
endif
ich bedanke mich schon mal im vor raus, für die Mühe.
Gruss
Markus