Seite 1 von 1

Winbatch wird unaufgefordert ausgeführt

Verfasst: 03 Apr 2017, 17:17
von Avira
Hallo,
hab mich eigentlich solangsam in Opsi eingearbeitet, allerdings finde ich gerade die Nadel im Heuhaufen nicht.
Ich hab ein Skript, das 4 Installationen ausführen kann. Dabei welche mit Parameter und für die Manuelle Installation.

Wird das Installationbefehel für die X64 mit Parameter ausgeführt und erfolgreich Installiert, führt er plötzlich das nächste aus, was er eigentlich nicht tun soll.


Sprich es gibt Variante 1 und 2. 1 wird übersprungen zwei ausgeführt und nach erfolgreicher Installation von 2 wird Plötzlich Variante 1 ausgeführt.
Wo liegt hier also der Fehler im Skript

Hier die IF Abfrage

Code: Alles auswählen

	if (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only") and ($INST_modify$ = "true")
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		ChangeDirectory "%SCRIPTPATH%"
		Winbatch_install_mod 
	endif
	
	
;Moded

	if (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only") and ($INST_modify$ = "false")
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		ChangeDirectory "%SCRIPTPATH%"
		Winbatch_install_64
		
	endif
Die Ausführung...

Code: Alles auswählen

[Winbatch_install_64]
"%ScriptPath%\x64\setup.exe" 
[Winbatch_install_mod]
"%ScriptPath%\x64\setup.exe" /adminfile office1664_std.MSP
Log

Code: Alles auswählen

[5] [Apr 03 16:48:37:633]     message Installing Microsoft Office 2016 64 Bit...
[5] [Apr 03 16:48:37:642]     comment: Start setup program
[6] [Apr 03 16:48:37:654]     Changed current directory to C:\Users\admin\Desktop\CLIENT_DATA
[5] [Apr 03 16:48:37:656]     
[5] [Apr 03 16:48:37:657]     Execution of Winbatch_install_64_mod
[6] [Apr 03 16:48:37:658]       Call ""C:\Users\admin\Desktop\CLIENT_DATA\x64\setup.exe" /adminfile office1664_std.MSP"
[6] [Apr 03 16:48:37:659]          Waiting until the called process is finished
[6] [Apr 03 16:48:37:661]       Start process as invoker: admin
[6] [Apr 03 16:51:45:590]       ExitCode 0    Executed process ""C:\Users\admin\Desktop\CLIENT_DATA\x64\setup.exe" /adminfile office1664_std.MSP"
[6] [Apr 03 16:51:59:933]   EndIf
[6] [Apr 03 16:51:59:935]   If
[5] [Apr 03 16:51:59:936]     $INST_SystemType$ = "x86 System"   <<< result false
[5] [Apr 03 16:51:59:937]     $INST_architecture$ = "system specific"   <<< result true
[5] [Apr 03 16:51:59:937]     ($INST_architecture$ = "system specific")   <<< result true
[5] [Apr 03 16:51:59:938]     ($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")   <<< result false
[5] [Apr 03 16:51:59:939]     $INST_architecture$ = "32 only"   <<< result false
[5] [Apr 03 16:51:59:940]     $INST_modify$ = "false"   <<< result false
[5] [Apr 03 16:51:59:941]     ($INST_modify$ = "false")   <<< result false
[5] [Apr 03 16:51:59:941]     ($INST_architecture$ = "32 only") and ($INST_modify$ = "false")   <<< result false
[5] [Apr 03 16:51:59:942]     (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "32 only") and ($INST_modify$ = "false")   <<< result false
[6] [Apr 03 16:51:59:943]   Then
[6] [Apr 03 16:51:59:944]   EndIf
[6] [Apr 03 16:51:59:945]   If
[5] [Apr 03 16:51:59:945]     $INST_SystemType$ = "64 Bit System"   <<< result true
[5] [Apr 03 16:51:59:946]     $INST_architecture$ = "system specific"   <<< result true
[5] [Apr 03 16:51:59:947]     ($INST_architecture$ = "system specific")   <<< result true
[5] [Apr 03 16:51:59:948]     ($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")   <<< result true
[5] [Apr 03 16:51:59:948]     $INST_architecture$ = "64 only"   <<< result false
[5] [Apr 03 16:51:59:949]     $INST_modify$ = "false"   <<< result false
[5] [Apr 03 16:51:59:950]     ($INST_modify$ = "false")   <<< result false
[5] [Apr 03 16:51:59:951]     ($INST_architecture$ = "64 only") and ($INST_modify$ = "false")   <<< result false
[5] [Apr 03 16:51:59:952]     (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only") and ($INST_modify$ = "false")   <<< result true
[6] [Apr 03 16:51:59:953]   Then
[5] [Apr 03 16:51:59:954]     message Installing Microsoft Office 2016 64 Bit...
[5] [Apr 03 16:51:59:955]     comment: Start setup program
[6] [Apr 03 16:51:59:956]     Changed current directory to C:\Users\admin\Desktop\CLIENT_DATA
[5] [Apr 03 16:51:59:957]     
[5] [Apr 03 16:51:59:957]     Execution of Winbatch_install_64
[6] [Apr 03 16:51:59:958]       Call ""C:\Users\admin\Desktop\CLIENT_DATA\x64\setup.exe""
[6] [Apr 03 16:51:59:959]          Waiting until the called process is finished
[6] [Apr 03 16:51:59:960]       Start process as invoker: admin
[6] [Apr 03 17:02:49:483]       ExitCode 1602    Executed process ""C:\Users\admin\Desktop\CLIENT_DATA\x64\setup.exe""
[6] [Apr 03 17:02:49:485]   EndIf
[6] [Apr 03 17:02:49:486] EndIf
Ich bin mir irgendwie sicher, dass die Klammern bei der IF Abfrage falsch sind, steht aber gerade auf dem Schlauch

Re: Winbatch wird unaufgefordert ausgeführt

Verfasst: 03 Apr 2017, 23:30
von ngbr
Hi Avira,

Log

Code: Alles auswählen


[5] [Apr 03 16:51:59:952]     (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only") and ($INST_modify$ = "false")   <<< result true

Ich bin mir irgendwie sicher, dass die Klammern bei der IF Abfrage falsch sind, steht aber gerade auf dem Schlauch[/quote]

Ich tippe mal, eine Klammer um die ersten 3 Ausdrücke sollte helfen ? Ergebnis interessiert mich aber auch ! ;)

Re: Winbatch wird unaufgefordert ausgeführt

Verfasst: 04 Apr 2017, 11:55
von Avira
Das letzte Produkt, was ich teste und ich check nichts mehr. Hab in der nacht alle Varianten der Klammer versucht. Heute Mittag, IF Abfrage gelöscht, aus der Originalen Template kopiert, eingefügt, Klammer gesetzt, Mein Attribut hinzugefügt. Voila es geht.

WO WAR JETZT DER FEHLER VE~~~~~~~~~~~~~

Nun wird auch nicht mehr die zweite Winbatch ausgeführt. Aber dank deinem Hinweis, dass da im Log dick und fett "<<< result true" stand. Hab ich dann öfters prüfen können.

Code: Alles auswählen

	if ((($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only")) and ($INST_modify$ ="false")
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		ChangeDirectory "%SCRIPTPATH%"
		Winbatch_install_64
	endif
	
	if ((($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "64 only")) and ($INST_modify$ ="true")
		Message "Installing " + $ProductId$ + " 64 Bit..."
		comment "Start setup program"
		ChangeDirectory "%SCRIPTPATH%"
		Winbatch_install_64_mod
	endif
Aber nun mal so am rande, beim Template ist doch auch ein Fehler mit der Klammer oder?

Original von Uib:

Code: Alles auswählen

	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
		Message "Installing " + $ProductId$ + " 32 Bit..."

	endif

	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
		Message "Installing " + $ProductId$ + " 64 Bit..."

	endif

Re: Winbatch wird unaufgefordert ausgeführt

Verfasst: 05 Apr 2017, 11:02
von wolfbardo
Avira hat geschrieben: Aber nun mal so am rande, beim Template ist doch auch ein Fehler mit der Klammer oder?

Original von Uib:

Code: Alles auswählen

	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
		Message "Installing " + $ProductId$ + " 32 Bit..."

	endif

	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
		Message "Installing " + $ProductId$ + " 64 Bit..."

	endif
Ja, die Klammerung ist nicht einheitlich,
Ja, man koennte das einheitlich machen.
Aber falsch ist die Logik im template nicht.

Gruss
Bardo Wolf