Die uninstall.exe und die install.exe läuft ohne Probleme durch.
Einziges Problem ist der Reboot zwischen uninstall und Install.
Idealer weise sollte das Setup nach dem Reboot weiter laufen.
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.
[Initial]
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
DefVar $ProductId$
DefVar $InstallDir$
DefVar $NewExe$
DefVar $PRODUCTPATH$
DefStringList $profiles$
DefVar $TEMP$
DefVar $OS$
DefVar $ANTIVIRVER$
DefVar $ExitCode$
set $OS$ = GetNTVersion
set $InstallDir$ = "c:\s_tools\Avira\AntiVir Desktop"
set $NewExe$ = $InstallDir$ + "\avcenter.exe"
set $ANTIVIRVER$ = "av12"
if not(HasMinimumSpace ("%SYSTEMDRIVE%", "100 MB"))
LogError "Nicht gengend Platz auf C: . 100 MB auf C: fuer Firefox erforderlich."
isFatalError
comment "Bearbeitung beenden und Produktschalter auf failed setzen"
else
comment "show product picture"
ShowBitmap /3 "%scriptpath%\files\avira_logo.jpg" "Avira Antivir"
comment "Message at install time:"
Message=Installing Avira Antivir...
comment "check for depotshare"
if not (FileExists("%SCRIPTPATH%"))
DosInAnIcon_TryToReconnect
endif
comment "start setup program"
Files_copy_local
comment "check if Avia is installed"
if (FileExists("c:\s_tools\Avira\AntiVir Desktop\avcenter.exe"))
Winbatch_antivir_uninstall
ExitWindows /ImmediateReboot
endif
comment "winbatch_antivir"
Winbatch_antivir
sub_check_exitcode
if not(FileExists($NewExe$))
logError "Fatal: After Installation "+$NewExe$+" not found"
isFatalError
endif
comment "del temporary files"
;Files_del
Endif
[Files_copy_local]
copy -s "%SCRIPTPATH%\files\*.*" c:\tmp\$ANTIVIRVER$_files
;[Files_del]
;delete -f "c:\tmp\$FIREFOXVER$"
;delete -f "c:\tmp\auto_$FIREFOXVER$"
[Winbatch_antivir_uninstall]
"c:\tmp\$ANTIVIRVER$_files\uninstall.exe"
[Winbatch_antivir]
; see http://wiki.mozilla.org/Installer:Command_Line_Arguments
;"c:\tmp\$FIREFOXVER$" $SilentSwitch$
"c:\tmp\$ANTIVIRVER$_files\install.exe"
[DosInAnIcon_TryToReconnect]
net use
set TIMEOUT=
:TRY
if exist "%SCRIPTPATH%\." goto READY
%ScriptDrive%
set TIMEOUT=%TIMEOUT%1
if %TIMEOUT% == 1111111111111111 goto READY
sleep 1
net use
goto TRY
:READY
[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
Code: Alles auswählen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Install Avira Antivir
; 2012-09-17
; current version: 12
;install
if FileExists(@ScriptDir & "\AV12-Silent.exe") Then
RunWait(@ScriptDir & "\AV12-Silent.exe")
; post_install
; registry
;WinWait("","Jetzt prüfen")
;ControlClick("","Später","[CLASS:Button; INSTANCE:3]")
;Sleep(3000)
;finisch_install
;WinWait("","blubb")
;ControlClick("","Ok","[CLASS:Button; INSTANCE:2]")
;Sleep(3000)
; disable Browser security
;WinWait("","Aktivieren")
;ControlClick("","Nein, danke.","[CLASS:Button; INSTANCE:3]")
;MsgBox(4096, "POSTInstall complete","Install complete")
Sleep(3000)
Send("{ENTER}")
RunWait('"C:\s_tools\Avira\AntiVir Desktop\update.exe" /DM="0" /NOMESSAGEBOX /receivetimeout=60')
Else
MsgBox(4096, "File not found",@ScriptDir & "\AV12-Silent.exe not found." & @CRLF & "Installation abort")
EndIf
Code: Alles auswählen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Language=1031
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Uninstall Avira Antivir
; 2012-09-17
; get uninstall info from registry
Local $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Avira AntiVir Desktop", "UninstallString")
;Run("C:\s_tools\Avira\AntiVir Desktop\setup.exe /REMOVE")
Run($var)
WinWait("","Wollen Sie die ausgewählte Anwendung und alle ihre Komponenten vollständig entfernen?")
;ControlClick("Setup von Avira AntiVir Personal - Free Antivirus","&Ja","Button1")
Send("!J")
;ControlClick("Avira AntiVir Personal - Free Antivirus","Fertig stellen","Button3")
WinWait("Systemneustart - Avira Free Antivirus","&Ja",60)
Send("!J")
Fehler selbst gefunden: Reboot war an der falschen stelle