Jump to content
Sign in to follow this  
seb1281

Installationscript

Recommended Posts

seb1281

Hello everybody,

i´m a newbie in autoit and tried to write an installationscript for an internet explorer plugin setup. the normal installtion works correctly, but i tried to implement an if instruction fpr the case that this plug in has already been installed. right there is the problem. most parts of the script are generated by the AutoitMacroGenerator. The problem has to be in the if instrocution. i sat over it fpr several hours and tried a lot, but nothing worked. So i would be happy about every help you could give me :)

#region --- AutoIt Macro Generator V 0.21 beta ---
BlockInput(1) ; Eingabe blockieren, (1)=aktiv, (0)=nicht aktiv
Opt("WinTitleMatchMode", 4)
Run("\\dc01-erg\QV\QvPluginSetup.exe")
WinWait("Program Manager", "FolderView")

; Warten bis das Sprachauswahlfenster erscheint
; und Auswahl der Sprache
$CLVItem = ControlListView("Program Manager", "FolderView", "SysListView321", "FindItem", "QvPluginSetup.exe")
ControlListView("Program Manager", "FolderView", "SysListView321", "SelectClear")
ControlListView("Program Manager", "FolderView", "SysListView321", "Select", $CLVItem)
$CLVItem = ControlListView("Program Manager", "FolderView", "SysListView321", "FindItem", "QvPluginSetup.exe")
ControlListView("Program Manager", "FolderView", "SysListView321", "SelectClear")
ControlListView("Program Manager", "FolderView", "SysListView321", "Select", $CLVItem)
WinWait("QlikView Plugin", "Please select a language from ")
ControlCommand("QlikView Plugin", "Please select a language from ", "ListBox1", "SelectString", "German")
ControlClick("QlikView Plugin", "Please select a language from ", "Button1")

WinWait("QlikView Plugin Setup","",25)
Opt("WinTextMatchMode", 1)      ;1=complete, 2=quick

; neuer Ansatz: über den WindowText unterscheiden, welches Fenster geöffnet ist
$text = WinGetText("QlikView Plugin Setup","")
; $text = ControlGetText("QlikView Plugin Setup","",64)

; Abfangen bei bereits installiertem PlugIn
 MsgBox(1,"Debug",$text)
If  $text = "&Ändern" Then ; funktioniert noch nicht so ganz (nur deinstallation)
    WinWait("QlikView Plugin Setup","Wählen Sie den auszuführenden Verwaltungsvorgang.")
    ControlClick("QlikView Plugin Setup","Wählen Sie den auszuführenden Verwaltungsvorgang.","Button7")
    ControlClick("QlikView Plugin Setup","Installation unvollständig.","Button2")
    WinWait("QlikView Plugin Setup abgebrochen","QlikView Plugin wurde unterbrochen,")
    ControlClick("QlikView Plugin Setup abgebrochen","QlikView Plugin wurde unterbrochen,","Button1")
    BlockInput(0)
    Exit
EndIf

; Landesauswahl
WinWait("QlikView Plugin Setup", "Willkommen beim Installation W")
ControlClick("QlikView Plugin Setup", "Willkommen beim Installation W", "Button1")
WinWait("QlikView Plugin Setup", "< &Zurück")
ControlCommand("QlikView Plugin Setup", "< &Zurück", "ListBox1", "SelectString", "Germany")
ControlClick("QlikView Plugin Setup", "< &Zurück", "Button1")

; Lizenvertrag akzeptieren
WinWait("QlikView Plugin Setup", "Ich &akzeptiere den Lizenzvert")
ControlClick("QlikView Plugin Setup", "Ich &akzeptiere den Lizenzvert", "Button3")
ControlClick("QlikView Plugin Setup", "Ich &akzeptiere den Lizenzvert", "Button4")
WinWait("QlikView Plugin Setup", "&Organisation:")
ControlClick("QlikView Plugin Setup", "&Organisation:", "Button4")
WinWait("QlikView Plugin Setup", "Klicken Sie auf 'Weiter', um d")
ControlClick("QlikView Plugin Setup", "Klicken Sie auf 'Weiter', um d", "Button1")

; warten bis Dateien kopiert wurden
WinWait("QlikView Plugin Setup", "QlikView Plugin wurde erfolgre")
ControlClick("QlikView Plugin Setup", "QlikView Plugin wurde erfolgre", "Button1")

BlockInput(0)

Share this post


Link to post
Share on other sites
MHz

Try your If line like this assuming $text is more then just "&Ändern".

If StringInStr($text, "&Ändern") Then ; funktioniert noch nicht so ganz (nur deinstallation)

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×