Datei ist gleichzeitig da aber auch nicht da

Antworten
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

Datei ist gleichzeitig da aber auch nicht da

Beitrag von larsg »

OPSI's Interpretation von Schrödingers Katze, auf Windows 7 x64:

Log -

Code: Alles auswählen

[1] [Okt 18 16:51:52:912] --
[1] [Okt 18 16:51:52:913] --
[1] [Okt 18 16:51:52:913] c:\opsi.org\log\opsi-script-part-Ku21Te94.log
[1] [Okt 18 16:51:52:913] opsi-script 4.11.6.2 started at 18.10.2016 16:51:49
[1] [Okt 18 16:51:52:914] opsi-script log file with encoding utf8
[1] [Okt 18 16:51:52:915] 
[1] [Okt 18 16:51:52:915] ============ Version 4.11.6.2 script "C:\Users\Administrator\Desktop\test.opsiscript"
[1] [Okt 18 16:51:52:916]              used script encoding: cp1252
[1] [Okt 18 16:51:52:916]              used system encoding: cp1252
[1] [Okt 18 16:51:52:917]              start: 2016-10-18  16:51:52 
[1] [Okt 18 16:51:52:917]              on client named    "CLIENT-W7-X64"
[1] [Okt 18 16:51:52:918]              loggedin user    "Administrator"
[1] [Okt 18 16:51:52:919]              opsi-script running as    "Administrator"
[1] [Okt 18 16:51:52:920]              opsi-script running with admin privileges
[1] [Okt 18 16:51:52:920]              opsi-script running in standard script mode
[1] [Okt 18 16:51:52:921] executing: "C:\Program Files (x86)\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"
[1] [Okt 18 16:51:52:924] system infos:
[1] [Okt 18 16:51:52:928] 00-80-27-00-03-02  -  PC hardware address
[1] [Okt 18 16:51:52:930] client-w7-x64  -  IP name 
[1] [Okt 18 16:51:52:931] 10.0.4.15  -  IP address
[1] [Okt 18 16:51:52:932] DEU  -  System default locale 
[1] [Okt 18 16:51:52:934] MS Windows 6.1 64 Bit, Edition: PRODUCT_PROFESSIONAL
[1] [Okt 18 16:51:52:935] 
[6] [Okt 18 16:51:52:936] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion]  opened
[6] [Okt 18 16:51:52:938] Key closed
[6] [Okt 18 16:51:52:991] LogLevel was 6
[6] [Okt 18 16:51:52:992] LogLevel set to 9
[5] [Okt 18 16:51:52:993] Set  $File$ = "C:\Windows\system32\wuaueng.dll"
[6] [Okt 18 16:51:52:996]   The value of the variable "$File$" is now: "C:\Windows\system32\wuaueng.dll"
[6] [Okt 18 16:51:52:997] If
[9] [Okt 18 16:51:52:998]   EvaluateBoolean: Parsing: (FileExists($File$)) 
[9] [Okt 18 16:51:52:999]   EvaluateBoolean: Parsing: FileExists($File$)) 
[5] [Okt 18 16:51:53:001]     Starting query if file exist ...
[9] [Okt 18 16:51:53:002]   Executing "C:\Windows\\cmd64.exe" /C "dir C:\Windows\system32\wuaueng.dll"
[9] [Okt 18 16:51:53:105]   ExitCode 0
[9] [Okt 18 16:51:53:106]   output:
[9] [Okt 18 16:51:53:108]   --------------
[9] [Okt 18 16:51:53:109]    Datenträger in Laufwerk C: ist WINDOWS
[9] [Okt 18 16:51:53:110]    Volumeseriennummer: 32FB-6201
[9] [Okt 18 16:51:53:111]   
[9] [Okt 18 16:51:53:112]    Verzeichnis von C:\Windows\system32
[9] [Okt 18 16:51:53:114]   
[9] [Okt 18 16:51:53:115]   21.11.2010  05:24         2.420.736 wuaueng.dll
[9] [Okt 18 16:51:53:116]                  1 Datei(en),      2.420.736 Bytes
[9] [Okt 18 16:51:53:117]                  0 Verzeichnis(se), 24.995.000.320 Bytes frei
[9] [Okt 18 16:51:53:118]   
[5] [Okt 18 16:51:53:119]   FileExists($File$)   <<< result true
[5] [Okt 18 16:51:53:120]   (FileExists($File$))   <<< result true
[6] [Okt 18 16:51:53:123] Then
[5] [Okt 18 16:51:53:125]   Set  $Version$  = GetValue("file version with dots",GetFileInfoMap($File$))
[4] [Okt 18 16:51:53:127]       File "C:\Windows\system32\wuaueng.dll" does not exist
[6] [Okt 18 16:51:53:129]       retrieving strings from GetFileInfoMap [switch to loglevel 7 for debugging]
[7] [Okt 18 16:51:53:130]           
[6] [Okt 18 16:51:53:132]     The value of the variable "$Version$" is now: "NULL"
[6] [Okt 18 16:51:53:134] EndIf
[1] [Okt 18 16:51:53:138] ___________________
[1] [Okt 18 16:51:53:141] script finished
[1] [Okt 18 16:51:53:143] 0 errors
[1] [Okt 18 16:51:53:145] 1 warning
[1] [Okt 18 16:51:53:147] 
[1] [Okt 18 16:51:53:150] 
[8] [Okt 18 16:51:53:152] End of CreateAndProcessScript
Skript -

Code: Alles auswählen

[Actions]
SetLogLevel = 9
DefVar $File$
DefVar $Version$
Set $File$ = "%System%\wuaueng.dll"
If (FileExists($File$))
	Set $Version$  = GetValue("file version with dots",GetFileInfoMap($File$))
EndIf
Auf Windows 7 x86 läuft das selbe Skript einwandfrei durch.
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Datei ist gleichzeitig da aber auch nicht da

Beitrag von d.oertel »

Hi,

yep - das sieht nach Bug aus.

Konkret: ein Bug und ein Problem:
1.Bug:
Eigentlich sollte FileExist die Datei nicht finden, da selbige im 64 Bit System Verzeichnis steht.
Die Funktion FileExist64 hingegen sollte die Datei finden.
(Siehe 64 Bit Kapitel im Winst-Handbuch.)

2. Problem:
Die Funktion getFileInfoMap hat keine 32bit/64Bit/Sysnative schalter und arbeiet daher 32 bittig und findet daher völlig korrekt nichts
unter dem Pfad "C:\Windows\system32\wuaueng.dll".
Das schreibe ich mir als Featurerequest auf.

Workaround:
Die Datei mit einer Files - Sektion /64Bit in ein nicht architektur Abhängiges Verzeichnis kopieren (z.B. %opsiTmpDir%) und dort untersuchen.

gruss
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

Re: Datei ist gleichzeitig da aber auch nicht da

Beitrag von larsg »

d.oertel hat geschrieben: Workaround:
Die Datei mit einer Files - Sektion /64Bit in ein nicht architektur Abhängiges Verzeichnis kopieren (z.B. %opsiTmpDir%) und dort untersuchen.
Mit Files /SysNative funktioniert der Workaround auf allen Systemen bestens :D

Danke für's aufnehmen (:
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Datei ist gleichzeitig da aber auch nicht da

Beitrag von d.oertel »

Zum testen:

http://download.uib.de/opsi4.0/experime ... 6.6-1.opsi

Diese Version sollte beide von mir oben genannten Probleme lösen:
Fileexists sollte auf einem 64 Bit system eine Datei welche nur unter system32 existiert nicht finden.
von getFileInfoMap gibt es jetzt die Varianten: getFileInfoMap32, getFileInfoMap64, getFileInfoMapSysnative

gruß
d.oertel
PS:
Lang lebe Schrödingers Katze

-------
opsi-winst/opsi-script (4.11.6.6) stable; urgency=low

* osmain: GetParameter: log error if readconfig failed
* osparser: CreateAndProcessScript: log error if readconfig failed
* osparser: CreateAndProcessScript: backup depot path and restor if rad config failed
* osparser: CreateAndProcessScript: backup depot path and restor if rad config failed
* osparser: evaluateBoolean: Fileexists* calling execShellCall architecture dependent
* osparser: produceStinglist: getFileInfoMap32, getFileInfoMap64, getFileInfoMapSysnative

-- Detlef Oertel <d.oertel@uib.de> Thu, 20 Oct 2016:15:00:00 +0200

-----------
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
larsg
Beiträge: 283
Registriert: 16 Dez 2014, 18:06

Re: Datei ist gleichzeitig da aber auch nicht da

Beitrag von larsg »

d.oertel hat geschrieben:Lang lebe Schrödingers Katze
So und nicht anders.
Besten Dank xD
Antworten