Antivir Avira Skript Fehler
Verfasst: 30 Mai 2014, 14:29
Hallo liebe Forum Mitglieder,
ich habe jetzt Skripts von Interaktives Setup mit automatisierten Antworten für Antivirus Avira geschrieben. Die Installation funktioniert super. Aber die Uninstallation nicht. Nach der Installation von Avira.exe wurde 2 Verzeichnisse (My Avira, AntiVir Desktop) erzeugt. Daher müssen die beiden deinstalliert werden.
Ich habe folgende Probleme:
1. Wie man kann das Feedback mit Webbrowser nach der Installation verhindern?
2. Das letzte Fenster mit Neustarten nach der Uninstallation von AntiVir Desktop wurde nie erkannt.
Opsi-Client OS: Windows 7 64 Bit
Opsi-Server OS: Ubuntu 12.04
setup.ins
uninstall.ins
delsub.ins
Avira.au3
avirauninstall.au3
avirafreeuninstall.au3
Ich bin für jede Hilfe dankbar
Gruß
Haining
ich habe jetzt Skripts von Interaktives Setup mit automatisierten Antworten für Antivirus Avira geschrieben. Die Installation funktioniert super. Aber die Uninstallation nicht. Nach der Installation von Avira.exe wurde 2 Verzeichnisse (My Avira, AntiVir Desktop) erzeugt. Daher müssen die beiden deinstalliert werden.
Ich habe folgende Probleme:
1. Wie man kann das Feedback mit Webbrowser nach der Installation verhindern?
2. Das letzte Fenster mit Neustarten nach der Uninstallation von AntiVir Desktop wurde nie erkannt.
Opsi-Client OS: Windows 7 64 Bit
Opsi-Server OS: Ubuntu 12.04
setup.ins
Code: Alles auswählen
[Initial]
;Standard Text, der während der Installation angezeigt wird
Message = Bitte warten, das Produkt wird installiert
;Loglevel einstellen
setLogLevel = 6
;Bei Fehlern abbrechen
ExitOnError=false
;Syntax Fehler werden in einem separaten Fenster angezeigt
ScriptErrorMessages=on
;Single-Step Mode nicht verwenden
TraceMode=off
;Im Batchmode das Winst-Fenster nicht im Vordergrund anzeigen
StayOnTop=false
[Actions]
;Variable für die Ermittlung des Betriebssystems
DefVar $OS$
set $OS$ = GetOS
;Variable für die Ermittlung der Betriebssystem Unterversion
DefVar $NTVersion$
set $NTVersion$ = GetNTVersion
;Name des Produkts (max. 12 Zeichen)
DefVar $ProductName$
Set $ProductName$ = "Avira"
;Dateiname des Produktbildes mit Erweiterung
DefVar $ProductPicture$
Set $ProductPicture$ = "Avira.png"
;Die Variable zur Auswertung des ExitCodes
DefVar $ExitCode$
;Vollständiger Produktname incl. Versionsnummer
DefVar $ProductNameFull1$
set $ProductNameFull1$ = "Antivir Avira 5.1.7"
;Dateinamen der zu installierenden MSI-Pakete
DefVar $Executable1$
Set $Executable1$ = "Avira.msi"
;Anzeigen der Installationsbenachrichtigung incl. des vollen Produktnamens
Message "Installiere "+$ProductNameFull1$
;Prüfen der Winst Version
requiredWinstVersion >= "4.11"
;$ProductPicture$ und $ProductName$ anzeigen
ShowBitmap /3 "%scriptpath%\" + $ProductPicture$ $ProductName$
;Freien Speicherplatz ermitteln
if not (HasMinimumSpace ("%SYSTEMDRIVE%", "500 MB"))
LogError "Nicht genügend Platz auf %SYSTEMDRIVE%"
isFatalError
endif
;OS-Version ermitteln
if ( $NTVersion$ = "Win2K" OR $NTVersion$ = "WinXP" OR $NTVersion$ = "Win NT 5.2" OR $NTVersion$ = "Windows Vista" )
Message "Deinstallation alter Produktversionen"
sub "%ScriptPath%\delsub.ins"
Message "Installiere "+$ProductNameFull1$
Winbatch_Install
Sub_check_exitcode
LinkFolder_Custom
else
LogError "Kein kompatibles Betriebssystem installiert"
isFatalError
endif
[Winbatch_Install]
%scriptpath%\AutoIt3.exe %scriptpath%\Avira.au3
[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
[LinkFolder_Custom]
;Startmenü anpassen
set_basefolder common_programs
set_subfolder ""
delete_subfolder "Antivir Avira"
set_subfolder ""
set_link
name: Antivir Avira
target: "%ProgramFiles32Dir%\Avira\Avira.exe"
parameters:
working_dir: "%ProgramFiles32Dir%\Avira"
icon_file:
icon_index:
end_link
Code: Alles auswählen
[Initial]
;Standard Text, der während der Deinstallation angezeigt wird
Message = Bitte warten, das Produkt wird deinstalliert
;Loglevel einstellen
SetLogLevel = 6
;Bei Fehlern abbrechen
ExitOnError = false
;Syntax Fehler werden in einem separaten Fenster angezeigt
ScriptErrorMessages = on
;Single-Step Mode nicht verwenden
TraceMode = off
;Im Batchmode das Winst-Fenster nicht im Vordergrund anzeigen
StayOnTop = false
[Actions]
;Name des Produkts (max. 12 Zeichen)
DefVar $ProductName$
Set $ProductName$ = "Avira"
;Dateiname des Produktbildes mit Erweiterung
DefVar $ProductPicture$
Set $ProductPicture$ = "Avira.png"
;Die Variable zur Auswertung des ExitCodes
DefVar $ExitCode$
;$ProductPicture$ und $ProductName$ anzeigen
ShowBitmap /3 "%scriptpath%\" + $ProductPicture$ $ProductName$
sub "%ScriptPath%\delsub.ins"
Code: Alles auswählen
Message "Uninstalling " + " ..."
if FileExists("%ProgramFiles32Dir%\Avira\My Avira\Avira.OE.Systray.exe")
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
Winbatch_uninstall_Programs
Winbatch_Free_Uninstall
sub_check_exitcode
endif
[Winbatch_Uninstall]
MsiExec.exe /x {D0DB3714-CFA1-4FA7-ABA3-B1DCB5998895} /qb-!
[Winbatch_uninstall_Programs]
%scriptpath%\AutoIt3.exe %scriptpath%\avirauninstall.au3
[Winbatch_Free_Uninstall]
%scriptpath%\AutoIt3.exe %scriptpath%\avirafreeuninstall.au3
[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
[Linkfolder_Custom]
;Startmenü Verknüpfung löschen
Set_basefolder common_programs
Set_subfolder ""
delete_element "Antivir Avira"
Code: Alles auswählen
;Starte Avira Installation
Run ("Avira.exe")
WinWaitActive("Avira Setup","")
Sleep(5000)
;Klicke Button Next
Send("{SPACE}")
Sleep(10000)
;Warten bis Installation fertig ist
Sleep(50000)
Exit
Code: Alles auswählen
;Starte Avira Deinstallation
Run ("Avira.exe")
WinWaitActive("Avira Setup","")
Sleep(1000)
;Klicke Button Next
Send("{TAB}{SPACE}")
;Warten bis Deinstallation fertig ist
Sleep(20000)
Send("{SPACE}")
Sleep(1000)
Exit
Code: Alles auswählen
;Starte Avira Free Antivirus Deinstallation
Run ("C:\Program Files (x86)\Avira\AntiVir Desktop\setup.exe")
WinWaitActive("Avira Free Antivirus","")
Sleep(1000)
;Klicke Button Next
Send("{DOWN}{TAB}{SPACE}")
Sleep(1000)
WinWaitActive("Setup von Avira Free Antivirus","")
Sleep(1000)
Send("{SPACE}")
Sleep(20000)
WinWaitActive("Systemneustart – Avira Free Antivirus","")
Send("!J")
Sleep(10000)
Exit
Gruß
Haining