Thread: Updater/unziper

Results 1 to 7 of 7
  1. #1
    apocalipse's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    155
    Reputation
    10
    Thanks
    71
    My Mood
    Aggressive

    Updater/unziper

    Hey, I made A updater/unziper For my Minecraft world, becuse me and a friend switch back and forward, and my problem is that the download stops at 15%

    The zip File size is : 54,6 MB

    Code
    Code:
    Imports System.Net
    Imports ComponentAce.Compression.Archiver
    Imports ComponentAce.Compression.ZipForge
    Imports ComponentAce.Compression.ZipForgeRealTime
    
    Public Class Form1
        Private WithEvents httpclient As WebClient
    
        Private Sub AutoUpdate()
            'this gets the directory where the main program is in no mather where it is on the computer
            'whether it is in the root of C:\ or on the userīs desktop. This will also prepare itself
            'by assigning the progressbar certain values and it will also tell the user where the setup
            'file is going.
            httpclient = New WebClient
            Label1.Text = "Preparing To Download Installation Files..."
            Dim directory As String = Application.StartupPath & "\Release.zip"
            Label3.Text = "https://fake.com/Minecraft%20Server%201.8.1/Release.zip"
            Label4.Text = directory
            ProgressBar1.Value = 0
            ProgressBar1.Maximum = 100
            Try
                'Since the code below isnīt very compatible with variables, you now see why the code above
                'has been put there for a reason. this code is where it downloads the setup files (.zip) and
                'stored it into the main root of the software so it is ready for installation.
                Label1.Text = "updater Status: Downloading Setup Files..."
                httpclient.DownloadFileAsync(New Uri(Label3.Text), Label4.Text)
            Catch ex As Exception
                'of course there would be internert problems whitch is why there is a try/catch code been put
                'into place. This little line below will tell the user that something has happened during the download.
                Label1.Text = "Updater Status: Download Failed! Either your connection died or the setup files are no longer available"
            End Try
        End Sub
        
       
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Button3.Enabled = False
            Label1.Text = "Updater Status: Update Ready"
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            AutoUpdate()
            Button1.Enabled = False
            Button2.Enabled = False
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Button3.Enabled = False
    
            Try
                Label1.Text = "Updater Status: Now Installing..."
                Dim archiver As New ZipForge()
                ' The name of the ZIP file to unzip
                archiver.FileName = Application.StartupPath & "\Release.zip"
                ' Open an existing archive
                archiver.OpenArchive(System.IO.FileMode.Open)
                ' Default path for all operations
                archiver.BaseDir = Application.StartupPath
                ' Extract all files from the archive to C:\Temp folder
                archiver.ExtractFiles("*.*")
                ' Close archive
                archiver.CloseArchive()
                Label1.Text = "Updater Status: Installation Completed! MinecraftServer is now updated"
                Button2.Enabled = True
            Catch ex As Exception
                Label1.Text = "Updater Status: Installation Failed! There Maybe a Problem with the setup files"
                Button1.Enabled = True
                Button2.Enabled = True
            End Try
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Try
                Process.Start("Propriedades.txt")
                Me.Close()
            Catch ex As Exception
                If MsgBox("The Propriedades.txt file seems to be missing, This my require a full re-install Of the McServer. Would you like the updater to (re)download the setup files?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
                    'When clicked, this will tell the hand made private sub to start it's work but also all buttons
                    'will be disabled disabled during the operation.
                    AutoUpdate()
                    Button1.Enabled = False
                    Button2.Enabled = False
                Else
                    MsgBox("If Thats The case, You will be required to do a full re-install of the software. The updater will now close", MsgBoxStyle.Information)
                    Me.Close()
                End If
            End Try
        End Sub
    
    
        Private Sub httpclient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles httpclient.DownloadProgressChanged
            ProgressBar1.Maximum = e.TotalBytesToReceive
            ProgressBar1.Value = e.BytesReceived
    
            Label2.Text = e.ProgressPercentage & "%"
    
            Dim MB As Single
            Dim MB2 As Single
            Dim KB As Single
            Dim Kb2 As Single
    
            MB = ((e.BytesReceived / 1024) / 1024)
            MB2 = ((e.TotalBytesToReceive / 1024) / 1024)
    
            KB = (e.BytesReceived / 1024)
            Kb2 = (e.TotalBytesToReceive / 1024)
    
            If KB And Kb2 <= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & KB.ToString("N2") & "KB out of " & Kb2.ToString("N2") & "KB"
            ElseIf KB <= 1024 And Kb2 >= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & KB.ToString("N2") & "KB out of " & MB2.ToString("N2") & "MB"
            ElseIf KB And Kb2 >= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & MB.ToString("N2") & "MB out of " & MB2.ToString("N2") & "MB"
            End If
    
            If Label2.Text = "100%" Then
                Button3.Enabled = True
                Label1.Text = "Updater Status: Download Completed! Ready For Installation..."
            End If
        End Sub
    End Class
    If some one can help I would appreciate.


    Fuck fpsbanana
    mpgh ftw

  2. #2
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by apocalipse View Post
    Hey, I made A updater/unziper For my Minecraft world, becuse me and a friend switch back and forward, and my problem is that the download stops at 15%

    The zip File size is : 54,6 MB

    Code
    Code:
    Imports System.Net
    Imports ComponentAce.Compression.Archiver
    Imports ComponentAce.Compression.ZipForge
    Imports ComponentAce.Compression.ZipForgeRealTime
    
    Public Class Form1
        Private WithEvents httpclient As WebClient
    
        Private Sub AutoUpdate()
            'this gets the directory where the main program is in no mather where it is on the computer
            'whether it is in the root of C:\ or on the userīs desktop. This will also prepare itself
            'by assigning the progressbar certain values and it will also tell the user where the setup
            'file is going.
            httpclient = New WebClient
            Label1.Text = "Preparing To Download Installation Files..."
            Dim directory As String = Application.StartupPath & "\Release.zip"
            Label3.Text = "https://fake.com/Minecraft%20Server%201.8.1/Release.zip"
            Label4.Text = directory
            ProgressBar1.Value = 0
            ProgressBar1.Maximum = 100
            Try
                'Since the code below isnīt very compatible with variables, you now see why the code above
                'has been put there for a reason. this code is where it downloads the setup files (.zip) and
                'stored it into the main root of the software so it is ready for installation.
                Label1.Text = "updater Status: Downloading Setup Files..."
                httpclient.DownloadFileAsync(New Uri(Label3.Text), Label4.Text)
            Catch ex As Exception
                'of course there would be internert problems whitch is why there is a try/catch code been put
                'into place. This little line below will tell the user that something has happened during the download.
                Label1.Text = "Updater Status: Download Failed! Either your connection died or the setup files are no longer available"
            End Try
        End Sub
        
       
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Button3.Enabled = False
            Label1.Text = "Updater Status: Update Ready"
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            AutoUpdate()
            Button1.Enabled = False
            Button2.Enabled = False
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Button3.Enabled = False
    
            Try
                Label1.Text = "Updater Status: Now Installing..."
                Dim archiver As New ZipForge()
                ' The name of the ZIP file to unzip
                archiver.FileName = Application.StartupPath & "\Release.zip"
                ' Open an existing archive
                archiver.OpenArchive(System.IO.FileMode.Open)
                ' Default path for all operations
                archiver.BaseDir = Application.StartupPath
                ' Extract all files from the archive to C:\Temp folder
                archiver.ExtractFiles("*.*")
                ' Close archive
                archiver.CloseArchive()
                Label1.Text = "Updater Status: Installation Completed! MinecraftServer is now updated"
                Button2.Enabled = True
            Catch ex As Exception
                Label1.Text = "Updater Status: Installation Failed! There Maybe a Problem with the setup files"
                Button1.Enabled = True
                Button2.Enabled = True
            End Try
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Try
                Process.Start("Propriedades.txt")
                Me.Close()
            Catch ex As Exception
                If MsgBox("The Propriedades.txt file seems to be missing, This my require a full re-install Of the McServer. Would you like the updater to (re)download the setup files?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
                    'When clicked, this will tell the hand made private sub to start it's work but also all buttons
                    'will be disabled disabled during the operation.
                    AutoUpdate()
                    Button1.Enabled = False
                    Button2.Enabled = False
                Else
                    MsgBox("If Thats The case, You will be required to do a full re-install of the software. The updater will now close", MsgBoxStyle.Information)
                    Me.Close()
                End If
            End Try
        End Sub
    
    
        Private Sub httpclient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles httpclient.DownloadProgressChanged
            ProgressBar1.Maximum = e.TotalBytesToReceive
            ProgressBar1.Value = e.BytesReceived
    
            Label2.Text = e.ProgressPercentage & "%"
    
            Dim MB As Single
            Dim MB2 As Single
            Dim KB As Single
            Dim Kb2 As Single
    
            MB = ((e.BytesReceived / 1024) / 1024)
            MB2 = ((e.TotalBytesToReceive / 1024) / 1024)
    
            KB = (e.BytesReceived / 1024)
            Kb2 = (e.TotalBytesToReceive / 1024)
    
            If KB And Kb2 <= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & KB.ToString("N2") & "KB out of " & Kb2.ToString("N2") & "KB"
            ElseIf KB <= 1024 And Kb2 >= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & KB.ToString("N2") & "KB out of " & MB2.ToString("N2") & "MB"
            ElseIf KB And Kb2 >= 1024 Then
                Label5.Text = "Download @ " & e.ProgressPercentage & "% / " & MB.ToString("N2") & "MB out of " & MB2.ToString("N2") & "MB"
            End If
    
            If Label2.Text = "100%" Then
                Button3.Enabled = True
                Label1.Text = "Updater Status: Download Completed! Ready For Installation..."
            End If
        End Sub
    End Class
    If some one can help I would appreciate.
    Hmm.. I don't know... maybe becuase it's from fake.com

    Did you try it on any other computer?

  3. #3
    apocalipse's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    155
    Reputation
    10
    Thanks
    71
    My Mood
    Aggressive
    Quote Originally Posted by PepsiXHacker View Post


    Hmm.. I don't know... maybe becuase it's from fake.com

    Did you try it on any other computer?
    the fake.com "symbolize my website, that i don't wish to share, and yes i tried


    Fuck fpsbanana
    mpgh ftw

  4. #4
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by apocalipse View Post
    the fake.com "symbolize my website, that i don't wish to share, and yes i tried
    lol, I was jking
    Also, try downloading it with IE/Google/FireFox/etc(W/E you have) and see if it fully downloads. Just checking off a few simple things.

  5. The Following User Says Thank You to Cryptonic For This Useful Post:

    apocalipse (09-26-2011)

  6. #5
    apocalipse's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    155
    Reputation
    10
    Thanks
    71
    My Mood
    Aggressive
    Quote Originally Posted by PepsiXHacker View Post


    lol, I was jking
    Also, try downloading it with IE/Google/FireFox/etc(W/E you have) and see if it fully downloads. Just checking off a few simple things.
    mhmmm. weird it does stops, i have tried a different server and same there.... hey, do you know a better ftp that can take 60 MB zip file? So i can retry?
    If yeah send me a pm, Thank you.


    Fuck fpsbanana
    mpgh ftw

  7. #6
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by apocalipse View Post
    mhmmm. weird it does stops, i have tried a different server and same there.... hey, do you know a better ftp that can take 60 MB zip file? So i can retry?
    If yeah send me a pm, Thank you.
    Maybe it's the file. I use 000webhost..

  8. #7
    Leaf's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    the Netherlands.
    Posts
    2,059
    Reputation
    456
    Thanks
    417
    My Mood
    Cheerful
    me 2, free ftp at high quality.
    Ex-



    Previous Names: Leaf, Acinonyx, Fawkes.


Similar Threads

  1. Updated addresses for some hacks.
    By sp0tie in forum Gunz Hacks
    Replies: 3
    Last Post: 02-22-2006, 08:18 AM
  2. New forum moderators/Server Updates
    By Dave84311 in forum News & Announcements
    Replies: 3
    Last Post: 02-20-2006, 11:05 PM
  3. Replies: 3
    Last Post: 02-09-2006, 03:51 PM
  4. Warrock Updates!
    By Dave84311 in forum General Game Hacking
    Replies: 2
    Last Post: 01-14-2006, 01:34 PM