Seite 1 von 1
AutoIT
Verfasst: 21 Jan 2016, 11:33
von rat
Ich wollte jetzt den AviraFree per opsi installieren. Silentschalter habe ich keine gefunden, somit habe ich mich mich autoit herumgespielt und eine .exe erstellt. Ohne den opsi funktioniert das tadellos, sobald es verpackt ist -> aus. Der opsi meldet keinen Fehler, lt Server ist alles glattgegangen, nur das Produkt ist nicht installiert.
Bei der Installation über den Server: Das erste Fenster wird geschlossen, ab dem zweiten (zeitweise ab dem Dritten) bleibt die Installation "hängen" und ich muß auf weiter klicken. Wie aber bereits gesagt, in den log-Files stehen keine errors, der opsi sagt "installed". Ich habe die "Wartezeiten" in autoit bereits auf zwei Sekunden hochgeschraubt, keine Änderung. Beim ersten Versuch auf einem Rechner sagt dieser installing, danach uninstalling, obwohl eben nichts drauf ist. Woher erkennt er, daß etwas drauf sein sollte?
Mit DivX habe ich ebenfalls ein autoit script gebastelt, welches auch bis vor ca 2 Wochen tadellos funktioniert hat. Dieses geht jetzt ebenfalls nicht mehr und zeigt diesselben Symptome.
Wo könnte ich den Fehler suchen, außer einen halben Meter vor der Tastatur
Gruß
rat
Re: AutoIT
Verfasst: 21 Jan 2016, 14:14
von edvbuo
Hallo,
poste doch mal dein AutoIT Code und dein Setup Code aus dem Opsi Paket. Dann könnte man den Fehler besser finden
Beste Grüße
Niels
Re: AutoIT
Verfasst: 21 Jan 2016, 14:30
von rat
Autoit:
Code: Alles auswählen
#RequireAdmin
Run ("files/setup.exe")
WinWait ("Avira Antivirus")
controlclick("Avira Antivirus", "", "Button2")
controlclick("Avira Antivirus", "", "Button1")
Sleep(300)
Send("{TAB}")
Sleep(300)
Send("{TAB}}")
Sleep(300)
Send("{TAB}")
Sleep(300)
Send("{TAB}}")
Sleep(300)
Send("{TAB}")
Sleep(300)
Send("{TAB}}")
Sleep(300)
Send("{TAB}")
Sleep(300)
Send("{TAB}}")
Sleep(300)
Send("{ENTER}")
Sleep(300)
Send("{ENTER}")
und opsi setup:
Code: Alles auswählen
; Copyright (c) uib gmbh (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.4.6"
ScriptErrorMessages=off
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
Set $LogDir$ = "%opsiLogDir%"
Set $ProductId$ = "avira"
Set $MinimumSpace$ = "500 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\Avira"
; ----------------------------------------------------------------
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%\delsub32.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.opsiscript"
endif
Message "Installing " + $ProductId$ + " ..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install
Sub_check_exitcode
comment "Copy files"
Files_install /32Bit
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
endif
[Winbatch_install]
"%ScriptPath%\avira.exe"
[LinkFolder_install]
set_basefolder common_desktopdirectory
set_subfolder ""
delete_subfolder $ProductId$
[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
Re: AutoIT
Verfasst: 21 Jan 2016, 15:02
von edvbuo
Also bei AutoIT bin ich bisher in Verbindung mit Opsi immer so am besten gefahren:
Code: Alles auswählen
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
EndFunc
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
Run('p:\OPSI_PAKET_NAME\files\setup.exe')
_WinWaitActivate("Setup-Sprache auswählen","")
Send("{ENTER}")
_WinWaitActivate("IBM i Access für Windows 7.1 - InstallShield Wizard", "WARNUNG: Dieses Programm ist durch")
Send("w")
_WinWaitActivate("IBM i Access für Windows 7.1 - InstallShield Wizard","Ich &lehne die Bedingungen")
Send("aw")
etc.
Der Rest sieht eigentlich soweit OK aus. Ich glaube es liegt an deiner ControlClick aktion im AutoIT.
Beste Grüße
Niels
Re: AutoIT
Verfasst: 21 Jan 2016, 15:53
von n.wenselowski
Das gute alte AutoIT hat seine Macken und davor wird bspw. unter
http://download.uib.de/opsi_stable/doc/ ... te-details gewarnt. Ich kann mir ganz gut vorstellen, dass hier genau so ein Fall vorliegt

Re: AutoIT
Verfasst: 21 Jan 2016, 18:04
von rat
Danke Niels, nur mit Deinem Code fange ich gar nix an, I only understand railwaystation
Meine Scriptkenntnisse sind ungefähr: opsi, was man so braucht, ich versuche es zum Verstehen, gelingt oft, aber nicht immer

wobei es auch schon Mißverständnisse gab, die sich einen längeren Zeitraum hielten

und autoit, ja beim DivX gings nicht anders, ich mußte, es funktionierte bis vor ca 2 Wochen
Hast Du eine (anfängertaugliche) Erklärung dazu? Zumindest eine kurze?
Re: AutoIT
Verfasst: 21 Jan 2016, 23:17
von SisterOfMercy
rat hat geschrieben:Mit DivX habe ich ebenfalls ein autoit script gebastelt, welches auch bis vor ca 2 Wochen tadellos funktioniert hat. Dieses geht jetzt ebenfalls nicht mehr und zeigt diesselben Symptome.
Why not use a different product for your video needs? Media Player Classic HC for instance. Or do you have a specific need for a new DivX code or something?
Re: AutoIT
Verfasst: 22 Jan 2016, 07:40
von rat
SisterOfMercy hat geschrieben:Why not use a different product for your video needs?
Dieses Produkt gibt es schon länger in der Firma als mich

Ich denke es handelt sich um ein "Layer8 Problem", ähnlich wie beim Autofahren:
Ich fahre seit 30 Jahren VW und kann einen Saab (der das Zündschloß zwischen den Sitzen in der Mittelkonsole hat) nicht einmal starten

Ob er jetzt, allgemein betrachtet, besser, schlechter oder nur anders ist, interessiert mich nicht, ich denke nicht einmal darüber nach. Das Zündschloß ist dort wo es zu sein hat und gut ist es
Nachdem mit Autoit die Installation tadellos funktioniert hat, war es mir egal. Jetzt, wo es, warum auch immer, nicht mehr funktioniert, muß ich es mir anschauen.
Es sind halt meine einzigen zwei, ok eines plus das nichtfunktionierende, "AutoIT-Installationen", daher war meine Überlegung, ob es ein generelles Problem gibt. Wäre es mein einziges, gäbe es diesen Fred in dieser Form nicht

Re: AutoIT
Verfasst: 22 Jan 2016, 10:14
von edvbuo
Du erstellst ein AutoIT Script wie folgt:
1. Diesen Code fügst du ganz oben ein:
Code: Alles auswählen
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
EndFunc
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
2. Dann folgende Zeile einfügen und dein Opsi Paket Name eintragen. Also z.b. avira_free
Run('p:\OPSI_PAKET_NAME\files\setup.exe')
3. Jetzt nimmst du das "Window Info Tool" von AutoIT und machst die Setup auf deinem PC. Bei "_WinWaitActivate" (siehe unten) trägst du zeile für Zeile deine Titel ein, der aktuellen Fenster. Bei "Send" trägst du entweder Enter ein und w für weiter oder jenachdem was da eben kommt. Dies klappt natürlich nur wenn du das setup Über Tastatur weiter machen kannst.
_WinWaitActivate("Setup-Sprache auswählen","")
Send("{ENTER}")
_WinWaitActivate("IBM i Access für Windows 7.1 - InstallShield Wizard", "WARNUNG: Dieses Programm ist durch")
Send("w")
usw.
Beste Grüße
Niels