Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.net]Application patcher using dropbox

I've been asked to make an application patcher so unstead of keeping it to myself i am releasing it to the public! If you have any questions feel free to ask.

i.imgur com/WL0cc41 .png
Code
Imports System.Net
Imports System.IO
Imports System.IO.Compression

Public Class Form1

    'Dims
    Dim masterpath As String = "where is the installed program"
    Dim versioncheck As String = "yoursite .com/version.txt"
    Dim link As String = "direct link for zip file"
    Dim zipPath As String = masterpath & "downloads\update.zip"
    Dim extractPath As String = masterpath & "files"
    Dim checkerplace As String = masterpath & "downloads\checker.dat"
    '#########################################
    '#                                       #
    '#          Application Patcher          #
    '#          Made by titanbullet          #
    '#            Version 1.0.0.0            #
    '#         Don't forget to update        #
    '#           the app.manifest            #
    '#                                       #
    '#########################################

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'Gets if its the first time running the patcher. If it is,it opens "Installer" form.
        If IO.File.Exists(checkerplace) Then My.Settings.Installed = True
        If My.Settings.Installed = True Then
            'Gets and sets the current application number
            Dim currentversion As String
            currentversion = Application.ProductVersion
            oldversion.Text = currentversion
            'Gets version.txt from server and sets it on label
            Dim request = DirectCast(WebRequest.Create(versioncheck), HttpWebRequest)
            Dim response = DirectCast(request.GetResponse(), HttpWebResponse)
            Using sr As New StreamReader(response.GetResponseStream())
                Dim versionnew As String
                versionnew = sr.ReadLine
                NewVersion.Text = versionnew
            End Using
            'Compares the versions and informs the user if needed
            If oldversion.Text = NewVersion.Text Then
                'Insert your form connection here (mainform.Show-Me.close)
            ElseIf oldversion.Text < NewVersion.Text Then
                MsgBox("New update found!", MsgBoxStyle.Critical, "Update found!")
                'Deletes old files
                IO.Directory.Delete(extractPath, True)
                'Creates the directory again
                IO.Directory.CreateDirectory(extractPath)
                'Downloads the update package
                My.Computer.Network.DownloadFile(link, masterpath & "downloads\update.zip")
                'Extracts
                ZipFile.ExtractToDirectory(zipPath, extractPath)
                'Deletes the update zip
                IO.File.Delete(masterpath & "downloads\update.zip")
            End If
        ElseIf My.Settings.Installed = False Then
            'installer.show
        End If
    End Sub
End Class
[/quote]
Why don't you just use wyDay's WyBuild?
Althrough it's a good snippet
I don't think it's even worth asking credits for....
Alot of people (behave newbies) know this kind of stuff already.
It's the same asking credits for making a messagebox with yes/no... {in my opinion}

Behave must have been except, sorry for the mistake.
(Jan 30, 2015 10:26 PM)hellomen Wrote:  Althrough it's a good snippet
I don't think it's even worth asking credits for....
Alot of people (behave newbies) know this kind of stuff already.
It's the same asking credits for making a messagebox with yes/no... {in my opinion}

I didn't ask for credits tho. And I am pretty sure this isn't begginer stuff,but even if it is I posted it to help others ;)


(Jan 30, 2015 08:19 PM)rtsuniversal Wrote:  Why don't you just use wyDay's WyBuild?

I am not familiar with what that is,sadly.
(Jan 31, 2015 06:19 AM)titanbullet Wrote:  I didn't ask for credits tho. And I am pretty sure this isn't begginer stuff,but even if it is I posted it to help others ;)



I am not familiar with what that is,sadly.

I was talking about that made by block...
I said most already knows it, except* beginners
(Jan 31, 2015 07:06 AM)hellomen Wrote:  I was talking about that made by block...
I said most already knows it, except* beginners

Oh,that was just to inform everyone to change the permissions on app.manifet,and that would make it prettier.
Sorry about the begginers part,my misunderstanding.
(Jan 31, 2015 09:52 AM)titanbullet Wrote:  Oh,that was just to inform everyone to change the permissions on app.manifet,and that would make it prettier.
Sorry about the begginers part,my misunderstanding.

No it wasn't your fault, I miswrote it...
Behave had to be except xD

Well thanks for saying nice contribution tho. Maybe using images will help, against the c+p kiddies ;)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by sh@rpJul 5, 2020 07:05 AM 212 22,345 Jul 5, 2020 07:05 AM
Last Post: sh@rp
[Java] by TennoFeb 3, 2019 04:49 AM 4 307 Feb 3, 2019 04:49 AM
Last Post: Tenno
[.NET] by TerminallyIllDec 24, 2018 09:17 AM 5 192 Dec 24, 2018 09:17 AM
Last Post: CreatedAutomated