How to add the auto-updating function to the visual basic mu-online launcher

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    How to add the auto-updating function to the visual basic mu-online launcher

    Well, I think you've seen the other tutorial of how to make a simple launcher.
    But, you will need much more than that for a launcher that will be efficient to handle a server.
    So, on with the tutorial.
    This tutorial is compatible with Visual Basic 2005-2011 [Not that sure of 2005].
    1)Open Visual Basic

    2)Make a New Project

    3)Edit the form's interface with your own creational needs,
    The form must include :
    2 Buttons :
    1 Button [Startup button]
    1 Update Button [OPTIONAL - MAY USE THE LOADING FORM FUNCTION]
    1 Webclient [NOT NEEDED IN THE TOOLBOX! BUT IN THIS TUT IT'LL BE IN THE TOOLBOX]

    4) Edit the buttons code, and add :
    Code:
    Process.Start("main.exe")
    Of course change the main.exe to what's your executable's name.

    5)Add to your website a folder called [Update] and 3 Files in it, [UP1.txt],[DN1.txt] (MAKE THEM BOTH 1 [Inside text]),
    and a file called Extract.Zip in it, all what you want to update.



    6)Double click on the form itself [OPTIONAL : YOU CAN MAKE A BUTTON DO THIS!!]
    And add :
    Code:
    dim dn1 as integer
    dim up1 as integer
    WebClient1.DownloadFile("YOURWEBSITE.COM/Update/dn1.txt","DN1.TXT")
    WebClient1.DownloadFile("YOURWEBSITE.COM/Update/up1.txt","UP1.TXT")
    dn1 = My.Computer.FileSystem.ReadAllText("dn1.txt")
    up1 = My.Computer.FileSystem.ReadAllText("up1.txt")
    if dn1 > up1 then
    WebClient1.DownloadFile("YOURWBSITE.COM/EXTRACT.ZIP","extract.zip") 
    ZipFiles("extract.zip")
    My.Computer.FileSystem.WriteAllText("DN1.TXT",dn1,false)
    end if
    7) Put this under that current sub :
    Code:
    Function ZipFiles (Byval strFileName as String)
    If My.Computer.FileSystem.FileExists(strFileName) Then
    Dim p As New Process
    With p
    .StartInfo.Arguments = "-min -e " & strFileName & "\"
    End With
    If My.Computer.FileSystem.FileExists("D:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "D:\Program Files\WinZip\winzip32.exe"
    ElseIf My.Computer.FileSystem.FileExists("C:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "C:\Program Files\WinZip\winzip32.exe"
    ElseIf My.Computer.FileSystem.FileExists("E:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "E:\Program Files\WinZip\winzip32.exe"
    ElseIf My.Computer.FileSystem.FileExists("F:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "F:\Program Files\WinZip\winzip32.exe"
    ElseIf My.Computer.FileSystem.FileExists("G:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "G:\Program Files\WinZip\winzip32.exe"
    ElseIf My.Computer.FileSystem.FileExists("H:\Program Files\WinZip\winzip32.exe") Then
    p.StartInfo.FileName = "H:\Program Files\WinZip\winzip32.exe"
    Else
    Msgbox("Or WinZip isn't installed, please install it, Or You have infinite hard disk drives...")
    Application.Exit()
    End If
    p.Start()
    Else
    MessageBox.Show(strFileName & " Not found ", "File Note found", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
    Return 0
    End Function



    EDIT :
    Got a couple of requests asking me how to use it, so the answer is :
    Put your files inside the Extract.zip in your website,
    And when you want to update, just put Up1.txt Bigger than Dn1.txt.

    You got Your own auto-updating launcher.
    I didn't really test this code, so any errors report it to me and i'll fix it :)
    Last edited by NoamRodrik; 21-06-12 at 04:57 PM. Reason: A Couple Of Problems / Pictures Added / Added Return 0


  2. #2
    Account Upgraded | Title Enabled! Krims is offline
    MemberRank
    Apr 2007 Join Date
    225Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    How to do this with VB 2010 Express?
    Well, WebClient1 = WebBrowser1, right? Then next error on "DownloadFile", not recognized. Same with ZipFile and Zip, check screen-shot below.
    define.jpg

  3. #3
    Valued Member razeblackz is offline
    MemberRank
    Apr 2012 Join Date
    PhilippinesLocation
    126Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    for better explanation please insert images or video.

    Thanks..

  4. #4
    Account Upgraded | Title Enabled! Krims is offline
    MemberRank
    Apr 2007 Join Date
    225Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    That is for me? There is an image! :)

  5. #5
    Valued Member razeblackz is offline
    MemberRank
    Apr 2012 Join Date
    PhilippinesLocation
    126Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by Krims View Post
    That is for me? There is an image! :)
    no no not you sir.... uhmmmm... the author.

  6. #6
    Kingdom of Shadows [RCZ]ShadowKing is offline
    MemberRank
    Jul 2007 Join Date
    1,644Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by Krims View Post
    How to do this with VB 2010 Express?
    Well, WebClient1 = WebBrowser1, right? Then next error on "DownloadFile", not recognized. Same with ZipFile and Zip, check screen-shot below.
    define.jpg
    Visual Basic Code Snippet - Download File from URL

  7. #7
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by Krims View Post
    How to do this with VB 2010 Express?
    Well, WebClient1 = WebBrowser1, right? Then next error on "DownloadFile", not recognized. Same with ZipFile and Zip, check screen-shot below.
    define.jpg
    The one with the webclient - add it on the toolbox.
    And the zip : I'm editting the code - found an error :)

  8. #8
    Account Upgraded | Title Enabled! Krims is offline
    MemberRank
    Apr 2007 Join Date
    225Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    .StartInfo.FileName = "D:\Program Files\WinZip\winzip32.exe "

    And if someone have different location or different archiver?

  9. #9
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by Krims View Post
    .StartInfo.FileName = "D:\Program Files\WinZip\winzip32.exe "

    And if someone have different location or different archiver?
    Good question, ill add that in a moment.
    And about the archiver, rar and zip are compatible with one-another, that includes tar.

    Done as requested my friend :)
    Last edited by NoamRodrik; 19-06-12 at 09:50 PM.

  10. #10
    Account Upgraded | Title Enabled! royaljourney is offline
    MemberRank
    Oct 2011 Join Date
    In Your Dream!!Location
    741Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    can you add with progress bar?

  11. #11
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by royaljourney View Post
    can you add with progress bar?
    Not recommended, but if you do, you'll hardly see it stop moving from time to time, cause the commands are really fast.
    But if you want to :

    Add between codes this :
    ProgressBar1.Value = ProgressBar1.Value + 10

    Only 10 TIMES! or +5 For 20, +1 for 100 and so on...

  12. #12
    Account Upgraded | Title Enabled! royaljourney is offline
    MemberRank
    Oct 2011 Join Date
    In Your Dream!!Location
    741Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by NoamRodrik View Post
    Not recommended, but if you do, you'll hardly see it stop moving from time to time, cause the commands are really fast.
    But if you want to :

    Add between codes this :
    ProgressBar1.Value = ProgressBar1.Value + 10

    Only 10 TIMES! or +5 For 20, +1 for 100 and so on...
    Sorry if I have request, I want launcher with Progress bar for some add design of the launcher

  13. #13
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Quote Originally Posted by royaljourney View Post
    Sorry if I have request, I want launcher with Progress bar for some add design of the launcher
    No problem, has your request been achieved as you wanted it to be?

  14. #14
    Account Upgraded | Title Enabled! royaljourney is offline
    MemberRank
    Oct 2011 Join Date
    In Your Dream!!Location
    741Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Sir Noam I have noob question, What version of visual basic that you use for this code?

  15. #15
    UnitedMU :) NoamRodrik is offline
    MemberRank
    Jun 2010 Join Date
    387Posts

    Re: How to add the auto-updating function to the visual basic mu-online launcher

    Visual Basic .net Till Visual Basic 2011



Page 1 of 2 12 LastLast

Advertisement