Abbruch ohne Reboot einer Installation im Fehlerfall

Antworten
Nils
Beiträge: 185
Registriert: 16 Sep 2011, 08:59

Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von Nils »

Hallo zusammen,

ich habe ein Skript, in dessen Verlauf bei fehlerfreier Teilinstallation ein Reboot durchgeführt wird. Diesen Reboot möchte ich gerne verhindern, wenn der erste Teil der Installation fehlschlägt. Hierzu setze ich mit "MarkErrorNumber" den Marker auf "0" und führe den ersten Teil der Installation durch. Kommt es hierbei zu einem Fehler, so wird der Marker wie gewünscht erhöht und in der Auswertungsbedingung in den "true"-Zweig gewechselt. Der Code hierzu lautet wie folgt:

Code: Alles auswählen

if errorsOccuredSinceMark > 0
				LogError "Fehler bei der Installation aufgetreten. Evtl. beim Erstellen der Verzeichnisse."
				comment "error occured"
				Set $Flag$ = "0"
				Registry_SaveRebootFlag
				isFatalError
			else
				; kein Fehler aufgetreten, gibt folgendes aus:
				comment "no error occured"
				; Reboot initialisieren
				Set $Flag$ = "1"
				Registry_SaveRebootFlag
				ExitWindows /ImmediateReboot
			endif	
Das Setzen des Reboot-Flags funktioniert auch. Auch die Kennzeichnung der Installation als fehlerhaft. Allerdings wird dennoch ein Reboot durchgeführt, was ich eigentlich verhindern möchte.
Im Log steht dazu Folgendes:
If
errorsOccuredSinceMark > 0 <<< result true
Then
Error: Fehler bei der Installation aufgetreten. Evtl. beim Erstellen der Verzeichnisse.
comment: error occured

Set $Flag$ = "0"
The value of the variable "$Flag$" is now: "0"

Execution of Registry_SaveRebootFlag
Registry started with redirection (32 Bit)
Key is: HKLM\SOFTWARE\opsi.org\winst
Key0 is: HKLM
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Variable "RebootFlag" had value "0"
Info: "RebootFlag" keeping it's value "0"
Key closed
Error level set to fatal
Process aborted
___________________
script finished
2 errors
0 warnings

installed product: XYZ-alt Version: 2.0-7

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
Temp bat files deleted, next: free script
End of CreateAndProcessScript
After CreateAndProcessScript
End ProcessNonZeroScript
First ProcessNonZeroScript finished
We do not look for a update script, because the setup script is failed
In opsi4data.UpdateSwitches, Actionstr: setup

...

Registry started with redirection (32 Bit)
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Variable "RebootRequested" had value "0"
Info: "RebootRequested" changed to "4"
Variable "LastLogFilename" is keeping its value "c:\tmp\instlog.txt"
Variable "ContinueLogFile" had value "0"
Info: "ContinueLogFile" changed to "1"
Variable "NumberOfErrors" had value "0"
Info: "NumberOfErrors" changed to "2"
Key flushed
Key closed
-------- submitted part of log file ends here, see the rest of log file on client ----------
Meine Fragen sind:
1.) Warum wird "RebootRequested" auf "4" gesetzt?
2.) Wo erfolgt diese Einstellung? (Setze ich im Skript im Fehlerfall manuell auf "0", so wird dieser Wert später wieder überschrieben.)
3.) Nach dem (unerwünschten) Reboot werden die Werte für "ContinueLogFile", "NumberOfErrors" etc. nicht wieder auf ihre Ursprungswerte ("0") zurückgesetzt.
4.) Wie kann ich den Reboot im Fehlerfall verhindern und erreichen, dass die o. g. Werte wieder auf Standard zurückgesetzt werden?

Solltet Ihr weitere Infos benötigen, so lasst es mich bitte wissen.

Vielen Dank im Voraus für Eure Hilfe und im Voraus ein entspanntes Wochenende.
Viele Grüße
Nils
bmsoft
Beiträge: 43
Registriert: 02 Feb 2012, 12:30

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von bmsoft »

Vielleicht eine blöde Frage, aber ...
$Flag$ kommt auch wirklich in Registry_SaveRebootFlag an?
Und wird vor dem "nächsten" Lauf auch wieder aus der Registry in die Variable eingelesen?
Nils
Beiträge: 185
Registriert: 16 Sep 2011, 08:59

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von Nils »

Hallo bmsoft,

danke für Deine Antwort. Ich habe gerade wieder weiter "geforscht". Folgendes gibt das LogFile aus:
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Variable "RebootFlag" is keeping its value "0"
Key closed

Execution of Registry_Reset
Registry started with redirection (32 Bit)
Key is: HKLM\SOFTWARE\opsi.org\winst
Key0 is: HKLM
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Variable "ContinueLogFile" is keeping its value "0"
Variable "NumberOfErrors" is keeping its value "0"
Variable "RebootRequested" is keeping its value "0"
Key closed
Error level set to fatal
Process aborted
___________________
script finished
2 errors
0 warnings

installed product: XYZ

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
We do not look for a update script, because the setup script is failed
JSON service request https://xxx.xxx.xxx.xxx:4447/rpc productOnClient_updateObject
JSON Bench for productOnClient_updateObject "params":[{"clientId":"yyy.yyy.yyy","action Start: 07:53:36:847 Time: 00:00:00:067
Registry started with redirection (32 Bit)
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Variable "RebootRequested" had value "0"
Info: "RebootRequested" changed to "4"
Variable "LastLogFilename" is keeping its value "c:\tmp\instlog.txt"
Variable "ContinueLogFile" had value "0"
Info: "ContinueLogFile" changed to "1"
Variable "NumberOfErrors" had value "0"
Info: "NumberOfErrors" changed to "2"
Key flushed
Key closed
Dem zufolge sieht es für mich so aus, als würde das Skript die Werte zwar wie gewünscht eintragen. "Nach" dem Skript scheinen diese Werte jedoch - wodurch auch immer - wieder geändert zu werden. Oder verstehe ich das falsch?

In wieweit der Wert vor dem "nächsten" Lauf wieder eingelesen wird, dürfte meines Erachtens nach keine Rolle spielen, da es ja keinen "nächsten Lauf" (nach einem Reboot) geben soll, sofern die Installation fehlgeschlagen ist.

Nach dem Reboot sind in der Registry weiterhin die folgenden Werte:
"ContinueLogFile"="1"
"NumberOfErrors"="2"
"RebootFlag"="0"
und "RebootRequested"="0".

Wodurch der Wert "RebootRequested" nach dem Reboot wieder auf "0" gesetzt wird, kann ich leider nicht sagen. In meinem Skript setze ich den Wert nur VOR dem Reboot.
Nach dem Reboot erkennt OPSI übrigens korrekt, dass "keine Aktionen" gesetzt sind.

Im OPSI-Handbuch fand ich gerade noch folgenden Hinweis:
Diese Registry Einträge werden vom Winst selbst verwaltet und sollten nicht verändert werden.
"LastLogFilename"="C:\\TMP\\syslogin.log"
"ContinueLogFile"=dword:00000000
"RebootRequested"=dword:00000000
"SendLogToService"=dword:00000001
"NumberOfErrors"=dword:00000000
"ShutdownRequested"=dword:00000000
Dies erklärt wohl, warum die von mir gesetzten Werte wieder überschrieben werden. :oops:

Aber: Irgendwie muss es doch möglich sein, einen Reboot bei fehlgeschlagener (Teil-)Installation zu verhindern. :?

Nebenbei: Es gibt keine blöden Fragen, nur blöde Antworten. ;)

Vielen Dank für weitere Tipps und Ratschläge. Solltest Du weitere Fragen haben, so lass es mich bitte wissen.
Viele Grüße und einen guten Start in eine hoffentlich erfolgreiche Woche.
Nils
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von d.oertel »

Hi,

irgendetwas muß im Script stehen das den Reboot Request setzt.
Aber ohne das komplette Script und den kompletten Log ist das schwierig zu raten.

Wie wäre es mit einem Supportvertrag ?

gruß
d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Nils
Beiträge: 185
Registriert: 16 Sep 2011, 08:59

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von Nils »

Hallo Herr Dr. Oertel,

vielen Dank für Ihre Nachricht. Mein Skript lautet derzeit:

Code: Alles auswählen

[Actions]
SetLogLevel = 9
requiredWinstVersion >= "4.10.8.6"

DefVar $MsiId32$
DefVar $UninstallProgram32$
DefVar $MsiId64$
DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $MSVersion$

DefVar $QL$
DefVar $sql_informixserver$
DefVar $service$
DefVar $protocol$
DefVar $informixserver$

Set $MSVersion$ = GetMsVersionInfo
Set $INST_SystemType$ = GetSystemType
Set $INST_architecture$ = GetProductProperty("install_architecture","system specific")

Set $sql_informixserver$ = GetProductProperty("sql_informixserver","fossrv")
Set $service$ = GetProductProperty("service","ifos")
Set $protocol$ = GetProductProperty("protocol","onsoctcp")
Set $informixserver$ = GetProductProperty("informixserver","ol_fossrv")

DefVar $AdobeReader$

Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - 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$       = "IFOS"
Set $MinimumSpace$    = "300 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "C:\Programme\ifos"
Set $InstallDir64$      = "C:\Programme\ifos"
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
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
	
	if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
	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..."
		DefVar $Flag$
		DefVar $WinstRegKey$
		DefVar $RebootRegVar$
		Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
		Set $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")
		if not ($Flag$ = "1")
			;=========================
			comment "Anweisungen vor Reboot"	
			if FileExists("%ScriptPath%\delsub.ins")
				comment "Start uninstall sub section"
				Sub "%ScriptPath%\delsub.ins"
			endif
			Message "Installing " + $ProductId$ + " 32 Bit..."
			comment "Copy files"
			Message "Dateien kopieren"
			markErrorNumber
			Files_install_32 /32Bit
			comment "Datei services patchen"
			Message "services patchen"
			PatchTextFile_services %System%\drivers\etc\services
			comment "Datei hosts patchen"
			Message "hosts patchen"
			PatchTextFile_hosts  %System%\drivers\etc\hosts
			comment "ocx registrieren"
			Message "ocx-Dateien registrieren"
			DosInAnIcon_ocx /32Bit
			comment "Verzeichnisberechtigung vergeben"
			Message "Verzeichnisberechtigungen vergeben"
			DosInAnIcon_setacl /32Bit
			comment "Patch Registry"
			Message "Registry patchen"
			Registry_install /32Bit
			comment "Font-Installation unter Windows 7"
			Message "Schriftarten installieren"
			Registry_install_fonts /32Bit
			if errorsOccuredSinceMark > 0
				comment "Fehler bei der Installation aufgetreten. Evtl. beim Erstellen der Verzeichnisse."
				isFatalError
			else
				; kein Fehler aufgetreten, gibt folgendes aus:
				comment "no error occured"
				; Reboot initialisieren
				Set $Flag$ = "1"
				Registry_SaveRebootFlag
				ExitWindows /ImmediateReboot
			endif
			Set $QL$ = GetProductProperty("install_ql", "true")
			if $QL$ = "true"
				comment "Copy QL files"
				Message "Installing QL"
				Files_install_QL /32Bit
				LinkFolder_QL_install
				comment "QL unter Systemsteuerung - Programme und Funktionen eintragen"
				Registry_install_ql /32Bit
			endif
		else
			;=========================
			; Anweisungen nach Reboot
			; Rebootflag zurücksetzen
			Set $Flag$ = "0"
			Registry_SaveRebootFlag
		endif
		Set $AdobeReader$ = GetRegistryStringValue("[HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe] ")
		set $AdobeReader$ = takeString(1, splitString ($AdobeReader$, '"'))
		comment "Datei ifos.ein patchen"
		PatchTextFile_ifos  %systemdrive%\Programme\ifos\prog\ifos.ein
		comment "Datei 'zpdf.ein' patchen"
		DosInAnIcon_zpdf
		comment "Create shortcuts"
		LinkFolder_install
	endif

	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
		Message "Installing " + $ProductId$ + " 32 Bit..."
		if ( $MSVersion$ >= "6" )
			DefVar $Flag$
			DefVar $WinstRegKey$
			DefVar $RebootRegVar$
			Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
			Set $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")
			if not ($Flag$ = "1")
				;=========================
				comment "Anweisungen vor Reboot"
				if FileExists("%ScriptPath%\delsub.ins")
					comment "Start uninstall sub section"
					Sub "%ScriptPath%\delsub.ins"
				endif
				Message "Installing " + $ProductId$ + " 64 Bit..."
				comment "IFOS-Dateien kopieren"
				Files_install_64 /32Bit
				comment "Datei 'services' patchen"
				PatchTextFile_services %System%\drivers\etc\services
				comment "Datei 'hosts' patchen"
				PatchTextFile_hosts  %System%\drivers\etc\hosts
				comment "ocx-Dateien registrieren"
				DosInAnIcon_ocx
				comment "Verzeichnisberechtigung vergeben"
				DosInAnIcon_setacl /32Bit
				comment "Registry patchen"
				Registry_install /32Bit
				comment "Font-Installation unter Windows 7"
				;DosInAnIcon_win7font
				Registry_install_fonts /32Bit
				; Reboot initialisieren
				;Set $Flag$ = "1"
				;Registry_SaveRebootFlag
				;ExitWindows /ImmediateReboot
				if errorsOccuredSinceMark > 0
					comment "Fehler bei der Installation aufgetreten. Evtl. beim Erstellen der Verzeichnisse."
					isFatalError
				else
					; kein Fehler aufgetreten, gibt folgendes aus:
					comment "no error occured"
					; Reboot initialisieren
					Set $Flag$ = "1"
					Registry_SaveRebootFlag
					ExitWindows /ImmediateReboot
				endif
				Set $QL$ = GetProductProperty("install_ql", "true")
				if $QL$ = "true"
					comment "Copy QL files"
					Files_install_QL /32Bit
					LinkFolder_QL_install
					comment "QL unter Systemsteuerung - Programme und Funktionen eintragen"
					Registry_install_ql /32Bit
				endif
			else
				;=========================
				; Anweisungen nach Reboot
				; Rebootflag zurücksetzen
				Set $Flag$ = "0"
				Registry_SaveRebootFlag
			endif
		endif
		Set $AdobeReader$ = GetRegistryStringValue("[HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe] ")
		set $AdobeReader$ = takeString(1, splitString ($AdobeReader$, '"'))
		comment "Detei 'ifos.ein' patchen"
		PatchTextFile_ifos  c:\Programme\ifos\prog\ifos.ein
		comment "Datei 'zpdf.ein' patchen"
		DosInAnIcon_zpdf
		comment "Verknuepfungen anlegen"
		LinkFolder_install
	endif
	
endif

[Registry_SaveRebootFlag]
openKey [$WinstRegKey$]
set "RebootFlag" = "$Flag$"

[Registry_reset]
;openKey [$WinstRegKey$]
;set "ContinueLogFile" = REG_DWORD:0000
;set "NumberOfErrors" = REG_DWORD:0000
;set "RebootRequested" = REG_DWORD:0000
deletekey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt]
deletekey [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\$informixserver$]

openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
DeleteVar "INFORMIXSERVER"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
DeleteVar "Code-128 Standard"
DeleteVar "Code_39 3_0 Standard"
DeleteVar "baeurer Standard"

[DosInAnIcon_ocx_remove]
regsvr32 /s /u "$InstallDir32$\prog\tx4ole11.ocx"
regsvr32 /s /u "$InstallDir32$\prog\TiffViewer.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12sx.dll"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12o.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12ox.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12fx.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12v.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cmll12r.ocx"
regsvr32 /s /u "$InstallDir32$\jamrt\bin\win32\cull12o.ocx"


[Files_install_QL]
; copy QL-files
copy -s "\\FOSSRV\Install\QL-Dateien\windows\*.*" "%Systemroot%"
copy -s "\\FOSSRV\Install\QL-Dateien\start\*.*" "$InstallDir32$\start"
copy -s "\\FOSSRV\Install\QL-Dateien\jamrt\*.*" "$InstallDir32$\jamrt"
copy -s "\\FOSSRV\Install\QL-Dateien\etc\*.*" "$InstallDir32$\etc"

[Files_install_32]
; recursively copying some files into the installation directory:
;
;CheckTargetPath = $InstallDir32$
copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "Z:\"
;copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "$InstallDir32$"
copy -s "\\FOSSRV\Install\IFOS\Client\ifosspool\*.*" "%SystemDrive%\ifosspool"
copy -s "\\FOSSRV\Install\IFOS\WINNT\ifos*.ini" "%Systemroot%"
copy -s "\\FOSSRV\Install\IFOS\WINNT\l*.ini" "%Systemroot%"
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.ttf" "%Systemroot%\fonts"
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.fon" "%Systemroot%\fonts"
copy "%ScriptPath%\setacl\x86\setacl.exe" "%System%"
copy "%ScriptPath%\fonts.vbs" "%System%"

[PatchTextFile_services]
; Datei services patchen
FindLine_Containing '1525'
DeleteTheLine
FindLine_Containing '1524'
AdvanceLine 1
InsertLine 'ifos		 1525/tcp'

[PatchTextFile_hosts]
; Datei hosts patchen
FindLine_Containing 'fossrv'
DeleteTheLine
AddLine '172.21.0.12	fossrv'
FindLine_Containing "rapsrv01"
DeleteTheLine
AddLine '172.21.0.11	rapsrv01'

[PatchTextFile_ifos]
; Datei ifos.ein patchen
FindLine_Containing '-Graf'
AdvanceLine 1
DeleteTheLine
InsertLine '$AdobeReader$'
FindLine_Containing '-PDF'
AdvanceLine 1
DeleteTheLine
InsertLine '$AdobeReader$'

[DosInAnIcon_ocx]
regsvr32 /s "$InstallDir32$\prog\tx4ole11.ocx"
regsvr32 /s "$InstallDir32$\prog\TiffViewer.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12sx.dll"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12o.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12ox.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12fx.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12v.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cmll12r.ocx"
regsvr32 /s "$InstallDir32$\jamrt\bin\win32\cull12o.ocx"

[DosInAnIcon_zpdf]
"%ScriptPath%\ZPDF_configersteller.exe" "$AdobeReader$"

[DosInAnIcon_setacl]
; Setzen der Berechtigungen für den Ordner ifosspool und das Programmverzeichnis von IFOS
SetACL.exe -on "%SystemDrive%\ifosspool" -ot file -actn ace -ace "n:Jeder;p:full"
SetACL.exe -on "$InstallDir32$" -ot file -actn ace -ace "n:Jeder;p:change"

[DosInAnIcon_win7font]
; Schriftarten unter Windows 7 installieren
cscript %System%\fonts.vbs

[Files_install_64]
; Recursively copying some files into the installation directory:
;
;copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "Z:\"
copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "$InstallDir32$"
copy -s "\\FOSSRV\Install\IFOS\Client\ifosspool\*.*" "%SystemDrive%\ifosspool"
copy -s "\\FOSSRV\Install\IFOS\WINNT\ifos*.ini" "%Systemroot%"
copy -s "\\FOSSRV\Install\IFOS\WINNT\l*.ini" "%Systemroot%"
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.ttf" "%Systemroot%\fonts"
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.fon" "%Systemroot%\fonts"
copy -s "%ScriptPath%\setacl\x64\setacl.exe" "%System%"
copy -s "%ScriptPath%\fonts.vbs" "%System%"

[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
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\$informixserver$]
set "HOST" = "$sql_informixserver$"
set "SERVICE" = "$service$"
set "PROTOCOL" = "$protocol$"

openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
set "INFORMIXSERVER" = "$informixserver$"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt]
set "DisplayName"="ifos-alt"
set "DisplayIcon"="C:\Programme\ifos\jamrt\bin\win32\ifos.ico"
set "DisplayVersion"="1.0"
set "UninstallString"="C:\Programme\ifos\start\ifosstart32.exe"
set "Publisher"="XXXXXXX"

[Registry_install_fonts]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
set "baeurer Standard"="baeurer.fon"
set "Code_39 3_0 Standard"="CODE_39C.TTF"
set "Code-128 Standard"="code_128.ttf"

[Registry_install_ql]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QL]
set "DisplayName"="QL"
set "DisplayIcon"="C:\Programme\ifos\jamrt\bin\win32\ql.ico"
set "DisplayVersion"="1.0"
set "UninstallString"="C:\Programme\ifos\start\ifosstart32.exe"
set "Publisher"="XXXXX"

[LinkFolder_install]
; Creating an shortcut to IFOS and Zeichnung in AllUsers startmenu:
;
set_basefolder common_programs
set_subfolder "$ProductId$"

set_link
 	name: $ProductId$
 	target: "C:\Programme\ifos\start\ifosstart32.exe"
 	parameters: IFOS_ECHT
 	working_dir: "C:\Programme\ifos\start"
 	icon_file: "C:\Programme\ifos\jamrt\bin\win32\ifos.ico"
 end_link
 set_link
 	name: "Zeichnungen"
 	target: "C:\Programme\ifos\prog\zpdf.exe"
 	working_dir: "C:\Programme\ifos\prog"
end_link
;
; Creating an shortcut to IFOS and Zeichnung on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""

set_link
 	name: $ProductId$
 	target: "C:\Programme\ifos\start\ifosstart32.exe"
 	parameters: IFOS_ECHT
 	working_dir: "C:\Programme\ifos\start"
 	icon_file: "C:\Programme\ifos\jamrt\bin\win32\ifos.ico"
end_link
set_link
 	name: "Zeichnungen"
 	target: "C:\Programme\ifos\prog\zpdf.exe"
 	working_dir: "C:\Programme\ifos\prog"
end_link

[LinkFolder_QL_install]
; Creating QL-link in AllUsers startmenu:
;
set_basefolder common_programs
set_subfolder "$ProductId$"

set_link
 	name: QL
 	target: "C:\Programme\ifos\start\ifosstart32.exe"
 	parameters: IFOS_QL
 	working_dir: "C:\Programme\ifos\start"
 	icon_file: "C:\Programme\ifos\jamrt\bin\win32\ql.ico"
 end_link

; Creating an shortcut to QL on AllUsers desktop:
;
set_basefolder common_desktopdirectory
set_subfolder ""

set_link
 	name: QL
 	target: "C:\Programme\ifos\start\ifosstart32.exe"
 	parameters: IFOS_QL
 	working_dir: "C:\Programme\ifos\start"
 	icon_file: "C:\Programme\ifos\jamrt\bin\win32\ql.ico"
end_link


[Sub_get_licensekey]
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

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($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."
		else
			if ($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."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
Das Log gibt Folgendes aus:
opsi-winst 4.11.3.6 started at 30.04.2013 08:16:52

============ Version 4.11.3.6 WIN32 script "\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\setup.ins"
start: 2013-04-30 08:20:01
on client named "IT062"
loggedin user "ntadmin"
winst running as "admin"
winst running with admin privileges
winst running in standard script mode
executing: "C:\Program Files\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"
...
Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
Key closed
LogLevel was 6
LogLevel set to 9
opsi-winst has version 4.11.3.6, required is : >= 4.10.8.6

Set $MSVersion$ = GetMsVersionInfo
The value of the variable "$MSVersion$" is now: "6.1"

Set $INST_SystemType$ = GetSystemType
The value of the variable "$INST_SystemType$" is now: "x86 System"

Set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
The value of the variable "$INST_architecture$" is now: "system specific"

Set $sql_informixserver$ = GetProductProperty("sql_informixserver","fossrv")
The value of the variable "$sql_informixserver$" is now: "fossrv"

Set $service$ = GetProductProperty("service","ifos")
The value of the variable "$service$" is now: "ifos"

Set $protocol$ = GetProductProperty("protocol","onsoctcp")
The value of the variable "$protocol$" is now: "onsoctcp"

Set $informixserver$ = GetProductProperty("informixserver","ol_fossrv")
The value of the variable "$informixserver$" is now: "ol_fossrv"

Set $LogDir$ = "C:\tmp"
The value of the variable "$LogDir$" is now: "C:\tmp"

Set $ProductId$ = "IFOS"
The value of the variable "$ProductId$" is now: "IFOS"

Set $MinimumSpace$ = "300 MB"
The value of the variable "$MinimumSpace$" is now: "300 MB"

Set $InstallDir32$ = "C:\Programme\ifos"
The value of the variable "$InstallDir32$" is now: "C:\Programme\ifos"

Set $InstallDir64$ = "C:\Programme\ifos"
The value of the variable "$InstallDir64$" is now: "C:\Programme\ifos"

Set $LicenseRequired$ = "false"
The value of the variable "$LicenseRequired$" is now: "false"

Set $LicensePool$ = "p_" + $ProductId$
The value of the variable "$LicensePool$" is now: "p_IFOS"

If
Free on Disk C:: 11.814.895.616 bytes This is more than the required amount of 300.000.000 bytes
HasMinimumSpace ("C:", $MinimumSpace$) <<< result true
not(HasMinimumSpace ("C:", $MinimumSpace$)) <<< result false
Then

Else
comment: Show product picture

If
$LicenseRequired$ = "true" <<< result false
Then
EndIf
comment: installing

If
$INST_SystemType$ = "x86 System" <<< result true
$INST_architecture$ = "system specific" <<< result true
($INST_architecture$ = "system specific") <<< result true
($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific") <<< result true
$INST_architecture$ = "both" <<< result false
$INST_architecture$ = "32 only" <<< result false
($INST_architecture$ = "32 only") <<< result false
($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") <<< result false
(($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") <<< result true
Then

Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
The value of the variable "$WinstRegKey$" is now: "HKLM\SOFTWARE\opsi.org\winst"

Set $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")
key0 = HKLM
Registry started with redirection (32 Bit)
Registry key [HKLM\SOFTWARE\opsi.org\winst] opened
Key closed
The value of the variable "$Flag$" is now: "0"

If
$Flag$ = "1" <<< result false
not ($Flag$ = "1") <<< result true
Then
comment: Anweisungen vor Reboot

If
Starting query if file exist ...
FileExists("\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\delsub.ins") <<< result true
Then
comment: Start uninstall sub section

~~~~~~~ Start Sub ~~~~~~~ Sub "\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\delsub.ins"

Set $MsiId32$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
The value of the variable "$MsiId32$" is now: "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe"
The value of the variable "$UninstallProgram32$" is now: "C:\Programme\ifos\uninstall.exe"

Set $MsiId64$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
The value of the variable "$MsiId64$" is now: "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

Set $UninstallProgram64$ = $InstallDir32$ + "\uninstall.exe"
The value of the variable "$UninstallProgram64$" is now: "C:\Programme\ifos\uninstall.exe"

Set $MSVersion$ = GetMsVersionInfo
The value of the variable "$MSVersion$" is now: "6.1"

If
$INST_SystemType$ = "x86 System" <<< result true
$INST_architecture$ = "system specific" <<< result true
($INST_architecture$ = "system specific") <<< result true
($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific") <<< result true
$INST_architecture$ = "both" <<< result false
$INST_architecture$ = "32 only" <<< result false
($INST_architecture$ = "32 only") <<< result false
($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") <<< result false
(($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") <<< result true
Then
message Uninstalling IFOS 32 Bit...

Set $QL$ = GetProductProperty("install_ql", "true")
The value of the variable "$QL$" is now: "true"

If
$QL$ = "true" <<< result true
Then
comment: Uninstall QL files

Execution of Files_uninstall_QL
delete -f "C:\Windows\ql32.ini"
we try to delete: C:\Windows\ql32.ini
Delete "C:\Windows\ql32.ini"
Search "C:\Windows\"
delete -f "C:\Programme\ifos\jamrt\bin\win32\ql*.*"
we try to delete: C:\Programme\ifos\jamrt\bin\win32\ql*.*
Delete "C:\Programme\ifos\jamrt\bin\win32\ql*.*"
Notice: Directory C:\Programme\ifos\jamrt\bin\win32\ does not exist, nothing deleted

Execution of LinkFolder_QL_uninstall
Base folder is the COMMON PROGRAMS folder
Created "IFOS" in the COMMON PROGRAMS folder
Info: Link "QL" does not exist
Base folder is the COMMON DESKTOPDIRECTORY folder
Opened "" in the COMMON DESKTOPDIRECTORY folder
Info: Link "QL" does not exist
comment: Uninstall Ql-Registry

Execution of Registry_uninstall_ql
Registry started with redirection (32 Bit)
Info: Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QL] could not be opened by RegOpenKeyEx, Errorno 2 "Das System kann die angegebene Datei nicht finden.<"
we should try to delete SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QL in HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\] opened
Info: key "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\QL" not found
Key closed
EndIf
comment: ocx deregistrieren
message ocx-Dateien werden deregistriert

3 DosInAnIcon_ocx
c:\opsi.org\tmp\_winstbat_5.bat saved back
Executing "cmd.exe" /C "c:\opsi.org\tmp\_winstbat_5.bat"
ExitCode 3

output:
--------------
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\prog\tx4ole11.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\prog\TiffViewer.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12sx.dll"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12o.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12ox.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12fx.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12v.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12r.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cull12o.ocx"

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
File "c:\opsi.org\tmp\_winstbat_5.bat"
The file has been deleted
comment: Deregistrieren der Schriftarten

Execution of Registry_uninstall_fonts
Registry started with redirection (32 Bit)
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Key0 is: HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] opened
Variable "Code-128 Standard" not found. Code: 2
Variable "Code_39 3_0 Standard" not found. Code: 2
Variable "baeurer Standard" not found. Code: 2
Key closed
comment: Datei hosts patchen
message Datei 'hosts' patchen

Execution of PatchTextFile_hosts

Patching: C:\Windows\system32\drivers\etc\hosts
FILE C:\Windows\system32\drivers\etc\hosts
Item Pointer set to Top (before first line)
Item no. 21 is containing 'FOSSRV'
Item Pointer set to 21
Deleted item no. 21: 172.21.0.12 fossrv
Item no. 21 is containing 'RAPSRV01'
Deleted item no. 21: 172.21.0.11 rapsrv01
C:\Windows\system32\drivers\etc\hosts saved back with 8 Bit system encoding
comment: Datei services patchen
message Datei 'services' patchen

Execution of PatchTextFile_services

Patching: C:\Windows\system32\drivers\etc\services
FILE C:\Windows\system32\drivers\etc\services
Item Pointer set to Top (before first line)
Item no. 173 is containing '1525'
Item Pointer set to 173
Deleted item no. 173: ifos 1525/tcp
C:\Windows\system32\drivers\etc\services saved back with 8 Bit system encoding
comment: Delete files
message IFOS-Dateien entfernen

Execution of Files_uninstall_32
delete -sf "C:\Programme\ifos\"
we try to delete: C:\Programme\ifos\
Delete recursively "C:\Programme\ifos\"
Notice: Directory C:\Programme\ifos\ does not exist, nothing deleted
delete -sf "C:\ifosspool\"
we try to delete: C:\ifosspool\
Delete recursively "C:\ifosspool\"
Search "C:\ifosspool\"
Directory "C:\ifosspool" deleted
delete -f "C:\Windows\ifos*.ini"
we try to delete: C:\Windows\ifos*.ini
Delete "C:\Windows\ifos*.ini"
Search "C:\Windows\"
File "C:\Windows\ifos32.ini"
The file has been deleted
File "C:\Windows\ifosdev32.ini"
The file has been deleted
delete -f "C:\Windows\libsti.ini"
we try to delete: C:\Windows\libsti.ini
Delete "C:\Windows\libsti.ini"
Search "C:\Windows\"
File "C:\Windows\libsti.ini"
The file has been deleted
delete -f "C:\Windows\fonts\code_39c.ttf"
we try to delete: C:\Windows\fonts\code_39c.ttf
Delete "C:\Windows\fonts\code_39c.ttf"
Search "C:\Windows\fonts\"
File "C:\Windows\fonts\CODE_39C.TTF"
The file has been deleted
delete -f "C:\Windows\fonts\code_128.ttf"
we try to delete: C:\Windows\fonts\code_128.ttf
Delete "C:\Windows\fonts\code_128.ttf"
Search "C:\Windows\fonts\"
File "C:\Windows\fonts\code_128.ttf"
The file has been deleted
delete -f "C:\Windows\fonts\baeurer.fon"
we try to delete: C:\Windows\fonts\baeurer.fon
Delete "C:\Windows\fonts\baeurer.fon"
Search "C:\Windows\fonts\"
File "C:\Windows\fonts\baeurer.fon"
The file has been deleted
delete -f "C:\Windows\system32\setacl.exe"
we try to delete: C:\Windows\system32\setacl.exe
Delete "C:\Windows\system32\setacl.exe"
Search "C:\Windows\system32\"
File "C:\Windows\system32\setacl.exe"
The file has been deleted
comment: Cleanup registry
message Registry aufraeumen

Execution of Registry_uninstall
Registry started with redirection (32 Bit)
Info: Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\ol_fossrv] could not be opened by RegOpenKeyEx, Errorno 2 "Das System kann die angegebene Datei nicht finden.<"
we should try to delete SOFTWARE\Informix\SqlHosts\ol_fossrv in HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\] opened
Info: key "SOFTWARE\Informix\SqlHosts\ol_fossrv" not found
Key closed
Info: Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt] could not be opened by RegOpenKeyEx, Errorno 2 "Das System kann die angegebene Datei nicht finden.<"
we should try to delete SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt in HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\] opened
Info: key "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt" not found
Key closed
Key is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Key0 is: HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] opened
Variable "INFORMIXSERVER" not found. Code: 2
Key closed
EndIf

If
$INST_SystemType$ = "64 Bit System" <<< result false
$INST_architecture$ = "system specific" <<< result true
$INST_architecture$ = "both" <<< result false
$INST_architecture$ = "64 only" <<< result false
($INST_architecture$ = "64 only") <<< result false
($INST_architecture$ = "both") or ($INST_architecture$ = "64 only") <<< result false
($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only") <<< result true
(($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) <<< result true
($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) <<< result false
Then

If
Then
EndIf
EndIf

If
$MSVersion$ >= "6.0" <<< result true
($MSVersion$ >= "6.0") <<< result true
Then
comment: Delete VirtualStore
message IFOS aus VirtualStore entfernen

Execution of Files_uninstall_VirtualStore
basekey : HKLM
relkey : SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
Registry started with redirection (32 Bit)
Registry started with redirection (32 Bit)
found profile reg entry for sid: S-1-5-18 and path: %systemroot%\system32\config\systemprofile
Registry started with redirection (32 Bit)
found profile reg entry for sid: S-1-5-19 and path: C:\Windows\ServiceProfiles\LocalService
Registry started with redirection (32 Bit)
found profile reg entry for sid: S-1-5-20 and path: C:\Windows\ServiceProfiles\NetworkService
Registry started with redirection (32 Bit)
found profile reg entry for sid: S-1-5-21-1409082233-789336058-1060284298-500 and path: C:\Users\admin
Make it for user directory: C:\Users\admin\
delete -sf "C:\Users\admin\AppData\Local\VirtualStore\Program Files\IFOS\"
we try to delete: C:\Users\admin\AppData\Local\VirtualStore\Program Files\IFOS\
Delete recursively "C:\Users\admin\AppData\Local\VirtualStore\Program Files\IFOS\"
Notice: Directory C:\Users\admin\AppData\Local\VirtualStore\Program Files\IFOS\ does not exist, nothing deleted
Make it for user directory: C:\Users\Default\
delete -sf "C:\Users\Default\AppData\Local\VirtualStore\Program Files\IFOS\"
we try to delete: C:\Users\Default\AppData\Local\VirtualStore\Program Files\IFOS\
Delete recursively "C:\Users\Default\AppData\Local\VirtualStore\Program Files\IFOS\"
Notice: Directory C:\Users\Default\AppData\Local\VirtualStore\Program Files\IFOS\ does not exist, nothing deleted
EndIf
comment: Delete program shortcuts
message Verknuepfungen entfernen

Execution of LinkFolder_uninstall
Base folder is the COMMON PROGRAMS folder
Delete folder "IFOS" in the COMMON PROGRAMS folder
Delete recursively "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\IFOS\"
Search "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\IFOS\"
Directory "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\IFOS" deleted
Base folder is the COMMON DESKTOPDIRECTORY folder
Opened "" in the COMMON DESKTOPDIRECTORY folder
Info: Link "IFOS" does not exist
Info: Link "Zeichnungen" does not exist
Section ending since next line is starting with "["

~~~~~~~ End Sub ~~~~~~~ Sub "\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\delsub.ins"

EndIf
message Installing IFOS 32 Bit...
comment: Copy files
message Dateien kopieren
Marked error number 0

Execution of Files_install_32
copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "Z:\"
Error: Directory Z:\ does not exist and cannot be created

ExitWindows set to Reboot
;copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "C:\Programme\ifos"
copy -s "\\FOSSRV\Install\IFOS\Client\ifosspool\*.*" "C:\ifosspool"
path C:\ifosspool created
Copying \\FOSSRV\Install\IFOS\Client\ifosspool\*.* -----> C:\ifosspool
0 File(s) found
No (non-directory) file with mask \\FOSSRV\Install\IFOS\Client\ifosspool\*.* found
0 File(s) treated
copy -s "\\FOSSRV\Install\IFOS\WINNT\ifos*.ini" "C:\Windows"
Copying \\FOSSRV\Install\IFOS\WINNT\ifos*.ini -----> C:\Windows
2 File(s) found
Source \\FOSSRV\Install\IFOS\WINNT\ifos32.ini
\\FOSSRV\Install\IFOS\WINNT\ifos32.ini copied to C:\Windows\
Source \\FOSSRV\Install\IFOS\WINNT\ifosdev32.ini
\\FOSSRV\Install\IFOS\WINNT\ifosdev32.ini copied to C:\Windows\
2 File(s) treated
copy -s "\\FOSSRV\Install\IFOS\WINNT\l*.ini" "C:\Windows"
Copying \\FOSSRV\Install\IFOS\WINNT\l*.ini -----> C:\Windows
1 File(s) found
Source \\FOSSRV\Install\IFOS\WINNT\libsti.ini
\\FOSSRV\Install\IFOS\WINNT\libsti.ini copied to C:\Windows\
1 File(s) treated
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.ttf" "C:\Windows\fonts"
Copying \\FOSSRV\Install\IFOS\WINNT\*.ttf -----> C:\Windows\fonts
2 File(s) found
Source \\FOSSRV\Install\IFOS\WINNT\code_128.ttf
\\FOSSRV\Install\IFOS\WINNT\code_128.ttf copied to C:\Windows\fonts\
Source \\FOSSRV\Install\IFOS\WINNT\CODE_39C.TTF
\\FOSSRV\Install\IFOS\WINNT\CODE_39C.TTF copied to C:\Windows\fonts\
2 File(s) treated
copy -s "\\FOSSRV\Install\IFOS\WINNT\*.fon" "C:\Windows\fonts"
Copying \\FOSSRV\Install\IFOS\WINNT\*.fon -----> C:\Windows\fonts
1 File(s) found
Source \\FOSSRV\Install\IFOS\WINNT\baeurer.fon
\\FOSSRV\Install\IFOS\WINNT\baeurer.fon copied to C:\Windows\fonts\
1 File(s) treated
copy "\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\setacl\x86\setacl.exe" "C:\Windows\system32"
Copying \\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\setacl\x86\setacl.exe -----> C:\Windows\system32
1 File(s) found
Source \\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\setacl\x86\setacl.exe
\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\setacl\x86\setacl.exe copied to C:\Windows\system32\
1 File(s) treated
copy "\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\fonts.vbs" "C:\Windows\system32"
Copying \\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\fonts.vbs -----> C:\Windows\system32
1 File(s) found
Source \\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\fonts.vbs
Info: Target C:\Windows\system32\fonts.vbs exists and shall be overwritten
\\opsisrv02\opsi_workbench\ifos-alt\CLIENT_DATA\fonts.vbs copied to C:\Windows\system32\
1 File(s) treated
comment: Datei services patchen
message services patchen

Execution of PatchTextFile_services

Patching: C:\Windows\system32\drivers\etc\services
FILE C:\Windows\system32\drivers\etc\services
Item Pointer set to Top (before first line)
No item found containing '1525'
Item pointer shows not to valid item, nothing to delete
Item no. 172 is containing '1524'
Item Pointer set to 172
Item Pointer set to 173
Inserted item 'ifos 1525/tcp' at position 173
C:\Windows\system32\drivers\etc\services saved back with 8 Bit system encoding
comment: Datei hosts patchen
message hosts patchen

Execution of PatchTextFile_hosts

Patching: C:\Windows\system32\drivers\etc\hosts
FILE C:\Windows\system32\drivers\etc\hosts
Item Pointer set to Top (before first line)
No item found containing 'FOSSRV'
Item pointer shows not to valid item, nothing to delete
Added item '172.21.0.12 fossrv'
No item found containing 'RAPSRV01'
Item pointer shows not to valid item, nothing to delete
Added item '172.21.0.11 rapsrv01'
C:\Windows\system32\drivers\etc\hosts saved back with 8 Bit system encoding
comment: ocx registrieren
message ocx-Dateien registrieren

3 DosInAnIcon_ocx
c:\opsi.org\tmp\_winstbat_6.bat saved back
Executing "cmd.exe" /C "c:\opsi.org\tmp\_winstbat_6.bat" /32Bit
ExitCode 3

output:
--------------

C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\prog\tx4ole11.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\prog\TiffViewer.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12sx.dll"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12o.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12ox.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12fx.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12v.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cmll12r.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s "C:\Programme\ifos\jamrt\bin\win32\cull12o.ocx"

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
File "c:\opsi.org\tmp\_winstbat_6.bat"
The file has been deleted
comment: Verzeichnisberechtigung vergeben
message Verzeichnisberechtigungen vergeben

3 DosInAnIcon_setacl
c:\opsi.org\tmp\_winstbat_7.bat saved back
Executing "cmd.exe" /C "c:\opsi.org\tmp\_winstbat_7.bat" /32Bit
ExitCode 5

output:
--------------

C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>SetACL.exe -on "C:\ifosspool" -ot file -actn ace -ace "n:Jeder;p:full"
INFORMATION: Processing ACL of: <\\?\C:\ifosspool>

SetACL finished successfully.

C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>SetACL.exe -on "C:\Programme\ifos" -ot file -actn ace -ace "n:Jeder;p:change"
INFORMATION: Processing ACL of: <\\?\C:\Programme\ifos>
ERROR: Reading the SD from <\\?\C:\Programme\ifos> failed with: Das System kann die angegebene Datei nicht finden.

SetACL finished with error(s):
SetACL error message: The call to GetNamedSecurityInfo () failed
Operating system error message: Das System kann die angegebene Datei nicht finden.

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
File "c:\opsi.org\tmp\_winstbat_7.bat"
The file has been deleted
comment: Patch Registry
message Registry patchen

Execution of Registry_install
Registry started with redirection (32 Bit)
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts
Key0 is: HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts] opened
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\ol_fossrv
Key0 is: HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\ol_fossrv] created
Variable "HOST" set to "fossrv"
Variable "SERVICE" set to "ifos"
Variable "PROTOCOL" set to "onsoctcp"
Key is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Key0 is: HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] opened
Variable "INFORMIXSERVER" set to "ol_fossrv"
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt
Key0 is: HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt] created
Variable "DisplayName" set to "ifos-alt"
Variable "DisplayIcon" set to "C:\Programme\ifos\jamrt\bin\win32\ifos.ico"
Variable "DisplayVersion" set to "1.0"
Variable "UninstallString" set to "C:\Programme\ifos\start\ifosstart32.exe"
Variable "Publisher" set to "XXXXX"
Key closed
comment: Font-Installation unter Windows 7
message Schriftarten installieren

Execution of Registry_install_fonts
Registry started with redirection (32 Bit)
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Key0 is: HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] opened
Variable "baeurer Standard" set to "baeurer.fon"
Variable "Code_39 3_0 Standard" set to "CODE_39C.TTF"
Variable "Code-128 Standard" set to "code_128.ttf"
Key closed

If
errorsOccuredSinceMark > 0 <<< result true
Then
comment: Fehler bei der Installation aufgetreten. Evtl. beim Erstellen der Verzeichnisse.

Execution of Registry_Reset
Registry started with redirection (32 Bit)
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt] opened
we should try to delete SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt in HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\] opened
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ifos-alt deleted
Key closed
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\ol_fossrv] opened
we should try to delete SOFTWARE\Informix\SqlHosts\ol_fossrv in HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\] opened
SOFTWARE\Informix\SqlHosts\ol_fossrv deleted
Key closed
Key is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Key0 is: HKEY_LOCAL_MACHINE
Registry key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] opened
Entry "INFORMIXSERVER" = "ol_fossrv" deleted
Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Key0 is: HKEY_LOCAL_MACHINE
Key closed
Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] opened
Entry "Code-128 Standard" = "code_128.ttf" deleted
Entry "Code_39 3_0 Standard" = "CODE_39C.TTF" deleted
Entry "baeurer Standard" = "baeurer.fon" deleted
Key closed

3 DosInAnIcon_ocx_remove
c:\opsi.org\tmp\_winstbat_8.bat saved back
Executing "cmd.exe" /C "c:\opsi.org\tmp\_winstbat_8.bat" /32Bit
ExitCode 3

output:
--------------

C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\prog\tx4ole11.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\prog\TiffViewer.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12sx.dll"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12o.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12ox.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12fx.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12v.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cmll12r.ocx"
C:\Program Files\opsi.org\opsi-client-agent\opsi-winst>regsvr32 /s /u "C:\Programme\ifos\jamrt\bin\win32\cull12o.ocx"

Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
File "c:\opsi.org\tmp\_winstbat_8.bat"
The file has been deleted
Error level set to fatal
Process aborted
___________________
script finished
1 error
0 warnings


Delete "c:\opsi.org\tmp\_winstbat_*"
Search "c:\opsi.org\tmp\"
Temp bat files deleted, next: free script
End of CreateAndProcessScript
Dass es in dem Skript bei der Installation zu einem Fehler (Dateien können nicht auf Laufwerk "Z:\" kopiert werden) kommt, ist beabsichtigt, da ich hiermit den Fehlerfall teste.
Im Log habe ich die Angaben am Anfang der Zeilen entfernt, um Zeichen zu sparen. Außerdem habe ich das Skript sowie das Log etwas "anonymisiert".

Einen Supportvertrag bekomme ich derzeit leider hier im Hause nicht durch. :( Bin aber "dran".

Vielen Dank im Voraus für jede Hilfe und jeden Tipp.
Ich wünsche Ihnen und allen "Mitlesern" / Helfern einen schönen und erfolgreichen Tag.
Viele Grüße
Nils
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von d.oertel »

Hi,

der Reboot wird hier gesetzt:

Code: Alles auswählen

Execution of Files_install_32
copy -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "Z:\"
Error: Directory Z:\ does not exist and cannot be created

ExitWindows set to Reboot
Das passiert normalerweise nur wenn eine entsprechende Datei im Ziel existiert und in Verwendung ist und kann mit der Option '-c' unterdrückt werden. Allerdings passt das nicht so ganz weil in diesem Befehl ja gar nichts kopiert wird.

Aber Vielleicht hilft das ja schon weiter.

gruß
d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von d.oertel »

Hi,

ich habe mir das noch mal im Code angeschaut und da ist wohl ein Bug im opsi-winst.
Wahrscheinlich hilft die Option -c aber ich baue bald einen fix.

Danke für den Hinweis.

gruß
d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Nils
Beiträge: 185
Registriert: 16 Sep 2011, 08:59

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von Nils »

Hallo Herr Dr. Oertel,

vielen Dank für Ihre Nachricht. :)
Vielleicht eine etwas "blöde" Frage: Was soll ich wo mit der Option "-c" aufrufen? :?:

Nochmals vielen Dank für Ihre Hilfe.
Ich wünsche Ihnen einen guten Start in eine hoffentlich erfolgreiche neue Woche.
Viele Grüße
Nils
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von d.oertel »

Hi,

http://download.uib.de/opsi4.0/doc/html ... _kommandos
Befehl: copy
Option: -c

Der Bug ist, dass wenn bei einem Kopierbefehl der Zielpfad nicht erstellt werden kann auch der Rebootflag gesetzt wird. Es sei denn, der copy Befehl wurde mit -c aufgerufen.
Wird der Copx Befehl nach 'Z:' in Deinem Script weggelassen taucht das Problem auch nicht auf.

gruß
d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Nils
Beiträge: 185
Registriert: 16 Sep 2011, 08:59

Re: Abbruch ohne Reboot einer Installation im Fehlerfall

Beitrag von Nils »

Hallo Herr Dr. Oertel,

vielen Dank für Ihren Tipp mit der Option "-c" für den copy-Befehl. Leider gibt es bei Verwendung dieser Option eine neue Schwierigkeit.
Rufe ich die Kopier-Aktion mit dem Befehl

Code: Alles auswählen

copy -c -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "$InstallDir32$"
auf, so wird zwar der Neustart nicht durchgeführt wenn das Zielverzeichnis nicht existiert, dafür bricht die Installation jedoch mit einem neuen Fehler ab. Im Log erscheint dann die Meldung
copy -c -s "\\FOSSRV\Install\IFOS\Client\ifos\*.*" "C:\Programme\ifos"
Error: Directory \\FOSSRV\Install\IFOS\Client\ifos\*.* does not exist and cannot be created
Bei dem o. g. Verzeichnis handelt es sich jedoch um das QUELL-Verzeichnis; nicht das Ziel. :?

Mache ich hier einen (Denk-)Fehler?

Vielen Dank im Voraus für Ihre Hilfe und einen erfolgreichen Tag.
Viele Grüße
Nils
Antworten