ich bin geraqde an einem Script beschäftigt, welches mich etwas kirre macht:
Ich habe eine String Liste, die mit Werten aus GetProductPropertyList gefüllt wird. Danach kommt nach einer for Schleife ein Vergleich. Dieser funktioniert aber nicht. Er hat gestern einmal funktioniert und hörte dann einfach heute wieder auf.
Code: Alles auswählen
DefStringList $sprache$
set $sprache$ = createStringList("ESOffice2019")
set $sprache$ = GetProductPropertyList("sprachen",$sprache$)
set $sprache1$ = "ESOffice2019"
set $sprache2$ = "ESOffice2021"
set $sprache3$ = "NLOffice2019"
set $sprache4$ = "NLOffice2021"
for %s% in $sprache$ do sub_sprache
[sub_sprache]
if ('$sprache$' = '$sprache1$')
winbatch_office_ES2019
else
if ('$sprache$' = '$sprache2$')
winbatch_office_ES2021
else
if ('$sprache$' = '$sprache3$')
winbatch_office_NL2019
else
if ('$sprache$' = '$sprache4$')
winbatch_office_NL2021
endif
endif
endif
endif
Danach soll er prüfen wenn der Wert aus der stringliste $sprache$ = X ist soll er eine Subsection asuführen, welche in der sections.opsiinc weiter definiert ist. Ebenso sind sämtliche Variablen in der declarations.opsiinc initialisiert.
Das Log äußert sich nun wie folgt im oberen Beispiel:
Code: Alles auswählen
The value of the variable "$sprache$" is now:
[7] [2024-03-13 13:16:16.363] [] (string 0)ESOffice2019
[7] [2024-03-13 13:16:16.377] [] No service connection in GetProductPropertyList - using default
[7] [2024-03-13 13:16:16.389] [] The value of the variable "$sprache$" is now:
[7] [2024-03-13 13:16:16.403] [] (string 0)ESOffice2019
[6] [2024-03-13 13:16:16.417] [] The value of the variable "$sprache1$" is now: "ESOffice2019"
[6] [2024-03-13 13:16:16.428] [] The value of the variable "$sprache2$" is now: "ESOffice2021"
[6] [2024-03-13 13:16:16.442] [] The value of the variable "$sprache3$" is now: "NLOffice2019"
[6] [2024-03-13 13:16:16.455] [] The value of the variable "$sprache4$" is now: "NLOffice2021"
[6] [2024-03-13 13:16:16.469] []
[6] [2024-03-13 13:16:16.483] [] ~~~~~~ Looping through: 'ESOffice2019'
[6] [2024-03-13 13:16:16.496] []
[6] [2024-03-13 13:16:16.510] [] ~~~~~~~ Start Sub ~~~~~~~ sub_sprache
[6] [2024-03-13 13:16:16.524] [] If
[7] [2024-03-13 13:16:16.538] [] '$sprache$' = '$sprache1$' <<< result false
[6] [2024-03-13 13:16:16.550] [] ('$sprache$' = '$sprache1$') <<< result false
[6] [2024-03-13 13:16:16.563] [] Then
[6] [2024-03-13 13:16:16.579] [] Else
[6] [2024-03-13 13:16:16.594] [] If
[7] [2024-03-13 13:16:16.610] [] '$sprache$' = '$sprache2$' <<< result false
[6] [2024-03-13 13:16:16.624] [] ('$sprache$' = '$sprache2$') <<< result false
[6] [2024-03-13 13:16:16.637] [] Then
[6] [2024-03-13 13:16:16.652] [] Else
[6] [2024-03-13 13:16:16.664] [] If
[7] [2024-03-13 13:16:16.680] [] '$sprache$' = '$sprache3$' <<< result false
[6] [2024-03-13 13:16:16.694] [] ('$sprache$' = '$sprache3$') <<< result false
[6] [2024-03-13 13:16:16.708] [] Then
[6] [2024-03-13 13:16:16.723] [] Else
[6] [2024-03-13 13:16:16.738] [] If
[7] [2024-03-13 13:16:16.752] [] '$sprache$' = '$sprache4$' <<< result false
[6] [2024-03-13 13:16:16.765] [] ('$sprache$' = '$sprache4$') <<< result false
[6] [2024-03-13 13:16:16.780] [] Then
[6] [2024-03-13 13:16:16.814] [] EndIf
[6] [2024-03-13 13:16:16.830] [] EndIf
[6] [2024-03-13 13:16:16.844] [] EndIf
[6] [2024-03-13 13:16:16.858] [] EndIf
Führe ich das Script so aus:
Code: Alles auswählen
DefStringList $sprache$
set $sprache$ = createStringList("ESOffice2019")
set $sprache$ = GetProductPropertyList("sprachen",$sprache$)
;set $sprache1$ = "ESOffice2019"
;set $sprache2$ = "ESOffice2021"
;set $sprache3$ = "NLOffice2019"
;set $sprache4$ = "NLOffice2021"
for %s% in $sprache$ do sub_sprache
[sub_sprache]
if ('$sprache$' = "ESOffice2019")
winbatch_office_ES2019
else
if ('$sprache$' = "ESOffice2021")
winbatch_office_ES2021
else
if ('$sprache$' = "NLOffice2019")
winbatch_office_NL2019
else
if ('$sprache$' = "NLOffice2021")
winbatch_office_NL2021
endif
endif
endif
endif
Code: Alles auswählen
defined global string list $sprache$
[7] [2024-03-13 13:18:49.148] [] The value of the variable "$sprache$" is now:
[7] [2024-03-13 13:18:49.160] [] (string 0)ESOffice2019
[7] [2024-03-13 13:18:49.175] [] No service connection in GetProductPropertyList - using default
[7] [2024-03-13 13:18:49.189] [] The value of the variable "$sprache$" is now:
[7] [2024-03-13 13:18:49.205] [] (string 0)ESOffice2019
[6] [2024-03-13 13:18:49.216] []
[6] [2024-03-13 13:18:49.231] [] ~~~~~~ Looping through: 'ESOffice2019'
[6] [2024-03-13 13:18:49.245] []
[6] [2024-03-13 13:18:49.257] [] ~~~~~~~ Start Sub ~~~~~~~ sub_sprache
[6] [2024-03-13 13:18:49.274] [] If
[7] [2024-03-13 13:18:49.289] [] '$sprache$' = "ESOffice2019" <<< result false
[6] [2024-03-13 13:18:49.303] [] ('$sprache$' = "ESOffice2019") <<< result false
[6] [2024-03-13 13:18:49.329] [] Then
[6] [2024-03-13 13:18:49.343] [] Else
[6] [2024-03-13 13:18:49.359] [] If
[7] [2024-03-13 13:18:49.375] [] '$sprache$' = "ESOffice2021" <<< result false
[6] [2024-03-13 13:18:49.389] [] ('$sprache$' = "ESOffice2021") <<< result false
[6] [2024-03-13 13:18:49.404] [] Then
[6] [2024-03-13 13:18:49.416] [] Else
[6] [2024-03-13 13:18:49.429] [] If
[7] [2024-03-13 13:18:49.445] [] '$sprache$' = "NLOffice2019" <<< result false
[6] [2024-03-13 13:18:49.458] [] ('$sprache$' = "NLOffice2019") <<< result false
[6] [2024-03-13 13:18:49.473] [] Then
[6] [2024-03-13 13:18:49.488] [] Else
[6] [2024-03-13 13:18:49.500] [] If
[7] [2024-03-13 13:18:49.514] [] '$sprache$' = "NLOffice2021" <<< result false
[6] [2024-03-13 13:18:49.527] [] ('$sprache$' = "NLOffice2021") <<< result false
[6] [2024-03-13 13:18:49.560] [] Then
[6] [2024-03-13 13:18:49.568] [] EndIf
[6] [2024-03-13 13:18:49.582] [] EndIf
[6] [2024-03-13 13:18:49.595] [] EndIf
[6] [2024-03-13 13:18:49.608] [] EndIf
Code: Alles auswählen
if ($ConstTest$ = $CompValue$)
comment "passed"
else
Code: Alles auswählen
DefStringList $sprache$
set $sprache$ = createStringList("ESOffice2019")
set $sprache$ = GetProductPropertyList("sprachen",$sprache$)
set $sprache1$ = "ESOffice2019"
set $sprache2$ = "ESOffice2021"
set $sprache3$ = "NLOffice2019"
set $sprache4$ = "NLOffice2021"
for %s% in $sprache$ do sub_sprache
[sub_sprache]
if ($sprache$ = $sprache1$)
winbatch_office_ES2019
else
if ($sprache$ = $sprache2$)
winbatch_office_ES2021
else
if ($sprache$ = $sprache3$)
winbatch_office_NL2019
else
if ($sprache$ = $sprache4$)
winbatch_office_NL2021
endif
endif
endif
endif
Code: Alles auswählen
No service connection in GetProductPropertyList - using default
[7] [2024-03-13 13:23:21.768] [] The value of the variable "$sprache$" is now:
[7] [2024-03-13 13:23:21.782] [] (string 0)ESOffice2019
[6] [2024-03-13 13:23:21.796] [] The value of the variable "$sprache1$" is now: "ESOffice2019"
[6] [2024-03-13 13:23:21.809] [] The value of the variable "$sprache2$" is now: "ESOffice2021"
[6] [2024-03-13 13:23:21.821] [] The value of the variable "$sprache3$" is now: "NLOffice2019"
[6] [2024-03-13 13:23:21.836] [] The value of the variable "$sprache4$" is now: "NLOffice2021"
[6] [2024-03-13 13:23:21.849] []
[6] [2024-03-13 13:23:21.864] [] ~~~~~~ Looping through: 'ESOffice2019'
[6] [2024-03-13 13:23:21.879] []
[6] [2024-03-13 13:23:21.893] [] ~~~~~~~ Start Sub ~~~~~~~ sub_sprache
[6] [2024-03-13 13:23:21.905] [] If
[7] [2024-03-13 13:23:21.919] [] <<< syntax error, no result!! - set to false
[6] [2024-03-13 13:23:21.935] [] ( <<< syntax error, no result!! - set to false
[2] [2024-03-13 13:23:21.950] [] Syntax Error in Section: sub_sprache (Command in line 73 in section: sub_sprache; file: setup.opsiscript; section start at line: 72; origin: setup.opsiscript; line: 73): ($sprache$ = $sprache1$) -> "$sprache$ = $sprache1$)" is an illegal String Expressionstr
[2] [2024-03-13 13:23:21.962] [] Syntax Error found in line: >if ($sprache$ = $sprache1$)<
[2] [2024-03-13 13:23:21.976] [] Syntax Error in Section: sub_sprache (Command in line 73 in section: sub_sprache; file: setup.opsiscript; section start at line: 72; origin: setup.opsiscript; line: 73): $sprache$ = $sprache1$) -> erroneous characters
[2] [2024-03-13 13:23:21.989] [] Syntax Error found in line: >if ($sprache$ = $sprache1$)<
[6] [2024-03-13 13:23:22.002] [] Then
[2] [2024-03-13 13:23:22.017] [] Syntax Error in Section: sub_sprache (Command in line 74 in section: sub_sprache; file: setup.opsiscript; section start at line: 72; origin: setup.opsiscript; line: 74): EndIf -> expected
[2] [2024-03-13 13:23:22.033] [] Syntax Error found in line: >winbatch_office_ES2019<
[6] [2024-03-13 13:23:22.069] []
[6] [2024-03-13 13:23:22.080] [] ~~~~~~~ End Sub ~~~~~~~ sub_sprache
[6] [2024-03-13 13:23:22.105] []
[6] [2024-03-13 13:23:22.118] []
[6] [2024-03-13 13:23:22.132] [] ~~~~~~ End Loop
Wo mache ich einen Fehler?