Sign in to follow this  
Followers 0
MatheusGM

[HELP] !

3 posts in this topic

Hello Guy's I need some help, With Select a "Hard Disk" on FileOpenDialog and on the Go Button to if the $var1 = "MS LETTER" should show a msgbox, and if its false goto another if like "if $browse1 = 1 then..." see it help me plz

;Author: MatheusGM
; Função do Script:
; One-click Installer MHU + GEN B

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin
#NoTrayIcon

#Region ### START Koda GUI section ###
$Form1_1 = GUICreate("One-click Installer MHU + GEN-B", 516, 348, 192, 124)
$Fundo = GUICtrlCreatePic("C:\Users\MatheusGM\Desktop\PSP.jpg", 0, 0, 513, 345, 0)
$Browse = GUICtrlCreateButton("Browse", 360, 152, 105, 25, 0)
$Go = GUICtrlCreateButton("Go", 128, 248, 137, 33)
$Help = GUICtrlCreateButton("Help", 272, 248, 137, 33)
$var1 = "MS Letter"
$Input = GUICtrlCreateInput($var1, 272, 152, 81, 21)
$Exit = GUICtrlCreateButton("Exit", 208, 280, 121, 33)
$Browse1 = 0
GUICtrlCreateLabel("Progress:", 8, 320, 54, 17)
$Progress1 = GUICtrlCreateProgress(72, 315, 161, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

    While 1
        $msg = GUIGetMsg()


        Select
            Case $msg = $Browse
                $file = FileOpenDialog("Choose file...", @MyDocumentsDir, "All (*.*)")
                If @error <> 1  Then MsgBox(0, "Error!", "You didn't Select Your PSP MS!")
                    GuiCtrlSetData(-1, 30)
                    $Browse1 = 1
    
Case $msg = $Go
    if $var = "MS Letter" then $msg = $Browse
        if $Browse1 = 1 Then
                $resposta = MsgBox(4, "One-click Installer MHU + GEN-B", "Do you wanna Install?")
                    
                    If $resposta = 6 Then
                        Run( "notepad")
                        GuiCtrlSetData(-1, 100)
                        Sleep(3000)
                        MsgBox(0, "One-click Installer MHU + GEN-B", "All Done! See Ya!")
                    EndIf
                    
                    If $resposta = 7 Then
                        MsgBox(0, "One-click Installer MHU + GEN-B", "Ok! See Ya!")
                    EndIf
        
            ElseIf 
                MsgBox(0, "One-click Installer MHU + GEN-B", "You didn't Select Your MS!")
            EndIf
                
                Case $msg = $Help
                #Region ### START Koda GUI section ### Form=d:\listas\programas\autoit3\koda_1.7.2.0\templates\about box.kxf
$dlgAbout = GUICreate("Help", 325, 238, 302, 218)
$GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
$Label4 = GUICtrlCreateLabel("Help:", 16, 24, 49, 28, $WS_GROUP)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Just Click on Browse, Select your MS,", 16, 72, 269, 24, $WS_GROUP)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Then click on Go!", 16, 96, 126, 24, $WS_GROUP)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Exit1 = GUICtrlCreateButton("Exit", 120, 208, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Sleep(3000)
GUIDelete()
                
                Case $msg = $Exit
                ExitLoop
                
                
        EndSelect
    WEnd

    GUIDelete()

    Exit

Share this post


Link to post
Share on other sites



I've make a small changed in your code. It works as you want it (i think :evil: ).. Maybe this will help you ;)

;Author: MatheusGM
; Função do Script:
; One-click Installer MHU + GEN B

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin
#NoTrayIcon

#Region ### START Koda GUI section ###
$Form1_1 = GUICreate("One-click Installer MHU + GEN-B", 516, 348, 192, 124)
$Fundo = GUICtrlCreatePic("C:\Users\MatheusGM\Desktop\PSP.jpg", 0, 0, 513, 345, 0)
$Browse = GUICtrlCreateButton("Browse", 360, 152, 105, 25, 0)
$Go = GUICtrlCreateButton("Go", 128, 248, 137, 33)
$Help = GUICtrlCreateButton("Help", 272, 248, 137, 33)
$var1 = "MS Letter"
$Input = GUICtrlCreateInput($var1, 272, 152, 81, 21)
$Exit = GUICtrlCreateButton("Exit", 208, 280, 121, 33)
$Browse1 = 0
GUICtrlCreateLabel("Progress:", 8, 320, 54, 17)
$Progress1 = GUICtrlCreateProgress(72, 315, 161, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $Browse
            $file = FileSelectFolder("Choose file...", "") ; FileSelectFolder instead of FileOpenDIalog
            If @error <> 1 Then
                GUICtrlSetData($Input, $file)
                GUICtrlSetData($Progress1,30)
                $Browse1 = 1
            Else
                MsgBox(0, "Error!", "You didn't Select Your PSP MS!")
            EndIf

        Case $msg = $Go
            If GUICtrlRead($Input) <> "MS Letter" Then ; changed $var to $var1, = to <>
;~              $msg = $Browse ; no need this
                If $Browse1 = 1 Then
                    $resposta = MsgBox(4, "One-click Installer MHU + GEN-B", "Do you wanna Install?")

                    If $resposta = 6 Then
                        Run("notepad")
                        GUICtrlSetData(-1, 100)
                        Sleep(3000)
                        MsgBox(0, "One-click Installer MHU + GEN-B", "All Done! See Ya!")
                    EndIf

                    If $resposta = 7 Then
                        MsgBox(0, "One-click Installer MHU + GEN-B", "Ok! See Ya!")
                    EndIf
                EndIf
            Else ; changed
                MsgBox(0, "One-click Installer MHU + GEN-B", "You didn't Select Your MS!")
            EndIf

        Case $msg = $Help
            #Region ### START Koda GUI section ### Form=d:\listas\programas\autoit3\koda_1.7.2.0\templates\about box.kxf
            $dlgAbout = GUICreate("Help", 325, 238, 302, 218)
            $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
            $Label4 = GUICtrlCreateLabel("Help:", 16, 24, 49, 28, $WS_GROUP)
            GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
            $Label1 = GUICtrlCreateLabel("Just Click on Browse, Select your MS,", 16, 72, 269, 24, $WS_GROUP)
            GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
            $Label2 = GUICtrlCreateLabel("Then click on Go!", 16, 96, 126, 24, $WS_GROUP)
            GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
            GUICtrlCreateGroup("", -99, -99, 1, 1)
            $Exit1 = GUICtrlCreateButton("Exit", 120, 208, 75, 25)
            GUISetState(@SW_SHOW)
            #EndRegion ### END Koda GUI section ###
            Sleep(3000)
            GUIDelete()

        Case $msg = $Exit
            ExitLoop

        Case $msg = -3
            ExitLoop

    EndSelect
WEnd

GUIDelete()

Exit

[size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size]

Share this post


Link to post
Share on other sites

Thank You ichigo! ^^

Helped Too much ;)

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