Jump to content
Sign in to follow this  
RiZon

problem with file version

Recommended Posts

#include <GUIConstants.au3>

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=Starcraft Downloader.exe
#AutoIt3Wrapper_Compression=2
#AutoIt3Wrapper_UseAnsi=y
#AutoIt3Wrapper_Res_Description=Starcraft Downloader
#AutoIt3Wrapper_Res_Fileversion=1.15.1.2
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright= RiZon
#AutoIt3Wrapper_Res_Language=3081
#AutoIt3Wrapper_Run_Tidy=y
#NoTrayIcon
$Downloader = GUICreate("Starcraft Downloader", 395, 110)
;$Downloader = GUICreate("Starcraft Downloader", 395, 130)

;$ConfirmID = GUICtrlCreateRadio("Confirm", 20, 110, 90)
;$DoNotOverWriteID = GUICtrlCreateRadio("Don't overwrite", 116, 110, 130)
;$OverWrite = GUICtrlCreateRadio("Overwrite", 260, 110, 100)


$Label = GUICtrlCreateLabel("Made by RiZon", 10, 85)
$StartID = GUICtrlCreateButton("Start", 130, 80, 70, 23)
GUICtrlSetTip($StartID,"Start download","",1,1)
$StopID = GUICtrlCreateButton("Stop", 221, 80, 70, 23)
GUICtrlSetTip($StopID,"Stop download","",1,1)
$CloseID = GUICtrlCreateButton("Close", 310, 80, 70, 23)
GUICtrlSetTip($CloseID,"Close Starcraft Downloader","",1,1)

;$Label = GUICtrlCreateLabel("Made by RiZon", 10, 115)
;$StartID = GUICtrlCreateButton("Start", 10, 80, 70, 23)
;$PauseID = GUICtrlCreateButton("Pause", 110, 80, 70, 23)
;$StopID = GUICtrlCreateButton("Stop", 210, 80, 70, 23)
;$CloseID = GUICtrlCreateButton("Close", 310, 80, 70, 23)

$ProgressID = GUICtrlCreateProgress("10", 45, 370, 20)
$ChooseDirectory = GUICtrlCreateInput("C:\[Yumeno_Sekai] Starcraft_Installer.exe", 10, 10, 290, 20)
$FileBrowse = GUICtrlCreateButton("Browse...", 310, 10, 70, 20)
;GUICtrlSetTip($FileBrowse,"","",1,1)
;$File = "ftp://rizon.homeftp.net/[Yumeno_Sekai] Starcraft_Installer.exe"
$File = "ftp://rizon.homeftp.net/[Yumeno_Sekai] Starcraft_Installer.exe"

;GUISetOnEvent($CloseID,"_StopDownloading")
;GUICtrlSetState($PauseID,$GUI_DISABLE)
GUICtrlSetState($StopID,$GUI_DISABLE)
;GUICtrlSetState($ConfirmID, $GUI_CHECKED)
$check = 0
GUISetState()  ; display the GUI

$MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

While 1
    $case = GUIGetMsg()

    Select
        Case $case = $FileBrowse
            $Input_to_tmp = FileSaveDialog("Save As", $MyDocsFolder, "All files (*.*)", 16, "[Yumeno_Sekai] Starcraft_Installer.exe")
            ; option 2 = dialog remains until valid path/file selected
            If @error Then ContinueLoop
            GUICtrlSetData($ChooseDirectory, $Input_to_tmp) ;put path into input field
            $Path_to = GUICtrlRead($ChooseDirectory)

        Case $case = $StartID
            $Path_to = GUICtrlRead($ChooseDirectory)
            ;If BitAND(GUICtrlRead($ConfirmID), $GUI_CHECKED) = $GUI_CHECKED Then
                If $Path_to = "" Then
                MsgBox(16, "Please specify a local path", "No local path specified!")
                ContinueLoop
            EndIf
                _DownloadOneFile($File, 1)
            
        Case $case = $StopID
                Opt("GUIOnEventMode", 1)
                GUICtrlSetOnEvent($StopID, "_StopDownloading")

                GUICtrlSetState($StartID,$GUI_ENABLE)
                GUICtrlSetState($StopID,$GUI_DISABLE)
                Opt("GUIOnEventMode", 0)
            
            Case $case = $CloseID
        ExitLoop ;exit program
        
        Case $case = $GUI_EVENT_CLOSE
            ExitLoop ;exit program
    EndSelect
WEnd
Exit

Func _StopDownloading()
    InetGet("abort")
        WinSetTitle($Downloader, "", "Starcraft Downloader")
        ;GUICtrlSetState($PauseID,$GUI_DISABLE)
        GUICtrlSetState($StartID,$GUI_ENABLE)
        GUICtrlSetState($StopID,$GUI_DISABLE)
        GUICtrlSetData($ProgressID, 0)
        TrayTip("","",0)
    MsgBox(64,"Download Canceled!","User canceled the Download")
    $check = 1
EndFunc   ;==>_StopDownloading

Func _DownloadOneFile($FileUrl, $Mode) ; Mode: 1-Confirm 2-Don't OverWrite 3-OverWrite
    If $Mode = 1 Then 
        ; ...
    EndIf

    GUICtrlSetData($ProgressID, 0)
        $size = InetGetSize($FileUrl)
    InetGet($FileUrl, $Path_to, 0, 1)

    While @InetGetActive
        ;GUICtrlSetState($PauseID,$GUI_ENABLE)
        GUICtrlSetState($StopID,$GUI_ENABLE)
        GUICtrlSetState($StartID,$GUI_DISABLE)
        $Percent = Int((@InetGetBytesRead * 100) / $size)
        $Remain = $size - @InetGetBytesRead
        GUICtrlSetData($ProgressID, $Percent)
        WinSetTitle($Downloader, "", "Starcraft Downloader - " & $Percent &"% downloaded")
        TrayTip("Downloading",$Percent & "% downloaded" & @CRLF & $Remain & " bytes remaining", 100, 1)
        Sleep(100)
                Opt("GUIOnEventMode", 1)
                GUICtrlSetOnEvent($StopID, "_StopDownloading")
                Opt("GUIOnEventMode", 0)
                Sleep(100)
    WEnd    

    
    if $check = 0 then
        Opt("GUIOnEventMode", 0)
        WinSetTitle($Downloader, "", "Starcraft Downloader")
        ;GUICtrlSetState($PauseID,$GUI_DISABLE)
        GUICtrlSetState($StartID,$GUI_ENABLE)
        GUICtrlSetState($StopID,$GUI_DISABLE)
        GUICtrlSetData($ProgressID, 0)
        TrayTip("","",0)
        MsgBox(64, "Download complete", $Path_to)
        endif
    EndFunc

Posted Image

(before)

i don't want this picture

Posted Image

(after)

i want this picture

plz, help me

Share this post


Link to post
Share on other sites

are you running the full version of SciTE4AutoIt3 ?

can you show the SciTE OutputPane information after you did F7?

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  

×
×
  • Create New...