Sign in to follow this  
Followers 0
wjp79

VLC setup Automation

3 posts in this topic

#1 ·  Posted (edited)

I'm trying to install VLC with use of the adlib function

I used the adlib function on a lot of other scripts, but VLC seems to fail.

If I already installed vlc, the first window that comes up is "VLC mediaspeler is reeds geïnstalleerd".

But somehow it does not detect the window or it wont controlclick the button. (or both)

The following code without the adlib function does seem to work, so then the adlib function seems to be the problem!?

If Not WinActive("VLC media player 1.0.0-installatie","VLC mediaspeler is reeds geïnstalleerd") Then WinActivate("VLC media player 1.0.0-installatie","VLC mediaspeler is reeds geïnstalleerd")
ControlClick("VLC media player 1.0.0-installatie", "VLC mediaspeler is reeds geïnstalleerd", "Button2")

WinWait("VLC media player 1.0.0-installatie", "VLC mediaspeler is reeds geïnstalleerd")
ControlClick("VLC media player 1.0.0-installatie", "VLC mediaspeler is reeds geïnstalleerd", "Button2")

Could someone shine some light on this?

AdlibEnable("_geinstalleerd", 500)
AutoItSetOption ( "WinTitleMatchMode", 2)

sleep(1000)
AdlibEnable("_geinstalleerd", 500)
Func _geinstalleerd()
If WinExists("VLC media player 1.0.0-installatie","VLC mediaspeler is reeds geïnstalleerd") Then 
ControlClick("VLC media player 1.0.0-installatie", "", "Button2")
endif
AdlibDisable()
EndFunc

tnx

Wjp79

ps maybe the script is now realy messed up, because of the hundreds of trials and errors.

Edited by wjp79

Share this post


Link to post
Share on other sites



Take a look at http://www.appdeploy.com/packages/detail.asp?id=303

Instead doing it in autoit, just use proper command line.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Well the adlib did not work, so I used the if and if not functions.

Here is my working script

Global $ShellCMD[2]
Global $Executeable = "vlc.exe"
Global $bExecuteableFound = False

$ShellCMD[0] = "\\server1\software\INSTALLEREN-autoit\exe\"
$ShellCMD[1] = "\\10.0.0.1\software\INSTALLEREN-autoit\exe\"

For $i = 0 To UBound($ShellCMD) - 1
    If FileExists($ShellCMD[$i] & $Executeable) Then
        $Executeable = $ShellCMD[$i] & $Executeable
        $bExecuteableFound = True
    EndIf
Next

If $bExecuteableFound = True Then
    Run($Executeable)
EndIf

sleep (3000)

$title = "VLC media player 1.0.0-installatie"
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)

if FileExists ("c:\Program Files\VideoLAN\VLC\vlc.exe") then
    WinWait($title,"VLC mediaspeler is r")
    ControlClick ($title,"VLC mediaspeler is r", "Button2")

    WinWaitActive ($title, "Welkom bij de VLC media player 1.0.0-installatiewizard")
    controlclick ($title, "Welkom bij de VLC media player 1.0.0-installatiewizard", "Button2")

    WinWaitActive ($title, "Licentieovereenkomst")
    controlclick ($title, "&Akkoord", "Button2")

    WinWaitActive ($title, "Onderdelen kiezen")
    send ("{tab}")
send ("{down}")
send ("{space}")
send ("{down 9}")
send ("{space}")
    controlclick ($title, "&Volgende >", "Button2")

        WinWaitActive ($title, "Installatielocatie kiezen")
        controlclick ($title, "Installatielocatie kiezen", "Button2")

                WinWaitActive ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard")
            controlclick ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard", "Button4")
                    controlclick ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard", "Button2")


elseif not FileExists ("c:\Program Files\VideoLAN\VLC\vlc.exe") then

        WinWaitActive ("Installer Language", "Please select a language.")
    ControlClick ("Installer Language", "Please select a language.", "Button1")



    WinWaitActive ($title, "Welkom bij de VLC media player 1.0.0-installatiewizard")
    controlclick ($title, "Welkom bij de VLC media player 1.0.0-installatiewizard", "Button2")

    WinWaitActive ($title, "Licentieovereenkomst")
    controlclick ($title, "&Akkoord", "Button2")

    WinWaitActive ($title, "Onderdelen kiezen")
    send ("{tab}")
send ("{down}")
send ("{space}")
send ("{down 9}")
send ("{space}")
    controlclick ($title, "&Volgende >", "Button2")

        WinWaitActive ($title, "Installatielocatie kiezen")
        controlclick ($title, "Installatielocatie kiezen", "Button2")

                WinWaitActive ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard")
            controlclick ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard", "Button4")
                    controlclick ($title, "Voltooien van de VLC media player 1.0.0-installatiewizard", "Button2")
                    endif

The script checks if the player is already installed by checking the exe file.

Maybe someone can use it.

Comments are welcome...

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  
Followers 0