Sign in to follow this  
Followers 0
Yagel

Browse question..

6 posts in this topic

Umm, i made a GUI with a button so when you click on it it supposed to start an .EXE file.. ( a game. )

but in every computer its on diffrent Local Dick \ directory and stuff like that.

So my question is.. how can i make the button.. so when you click on it, it opens a Browser.. and ask where's the .EXE file THEN launch it? .

Sorry for my bad english, and thanks from advanced.

Share this post


Link to post
Share on other sites



Check out FileOpenDialog()

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Uhhm, i managed to work it out with an InputBox so it just run's what he wrote.. [ the full patch with the .exe name.. ]

$GameDir = InputBox( "Game Client Patch", "Enter the full path of your Game client ( With the .exe filename)", "", " M", Default, Default, Default, Default)
Switch @error
Case 0
    Switch $GameDir
    Case "a", "b", "c", "d", "e"
        $msg = "Please enter the full path of your Game client."
    Case "QP"
        $msg = "Please enter the full path of your Game client."
    Case "asdf" to "1234"
        $msg = "Please enter the full path of your Game client."
    Case Else
        Run($GameDir)
        EndSwitch
EndSwitch

Thanks :)

Edited by Yagel

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

How do i make the InputBox remember what they wrote last time? ( Like saving it on INI file ? ]

So they wont need to write the full path everytime clickling on the button...

Edited by Yagel

Share this post


Link to post
Share on other sites

$VALUE = IniReadSection(@ScriptDir & "\MyGameConfig.ini","GAME")
If @error Then
    $GAME = FileOpenDialog("SELECT",@ScriptDir,"Exe (*.exe)",1) 
    If Not @error Then Run('"' & $GAME & '"')
    IniWrite(@ScriptDir & "\MyGameConfig.ini","GAME","PATH",$GAME)
Else 
    Run('"' & $VALUE[1][1] & '"')
EndIf


When the words fail... music speaks

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