Advertisement
Guest User

Untitled

a guest
Jul 6th, 2011
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 31.02 KB | None | 0 0
  1. 'Open Source PokeNet Launcher Coded by -DefaulT
  2. 'Copyright (C) 2011  -DefaulT - PokeNet
  3.  
  4. 'Distributed Through RaGEZONE & http://pocket-monsuta.co.cc/
  5.  
  6. 'This program is free software; you can redistribute it and/or
  7. 'modify it under the terms of the GNU General Public License
  8. 'as published by the Free Software Foundation; either version 2
  9. 'of the License, or (at your option) any later version.
  10.  
  11. 'This program is distributed in the hope that it will be useful,
  12. 'but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. 'GNU General Public License for more details.
  15.  
  16. 'You should have received a copy of the GNU General Public License
  17. 'along with this program; if not, write to the Free Software
  18. 'Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  19.  
  20. Imports Nini.Config
  21. Imports System.IO
  22.     Public Class Form1
  23.  
  24.     ' Dragging form w/o borders :D
  25. #Region " ClientAreaMove Handling "
  26.     Const WM_NCHITTEST As Integer = &H84
  27.     Const HTCLIENT As Integer = &H1
  28.     Const HTCAPTION As Integer = &H2
  29.     Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
  30.         Select Case m.Msg
  31.             Case WM_NCHITTEST
  32.                 MyBase.WndProc(m)
  33.                 If m.Result = HTCLIENT Then m.Result = HTCAPTION
  34.             Case Else
  35.                 MyBase.WndProc(m)
  36.         End Select
  37.     End Sub
  38. #End Region
  39.  
  40.     'Loading all the INI files etc.
  41.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  42.         'Getting config info
  43.         Dim poke As New IniConfigSource("pokenet.ini")
  44.  
  45.         'Loading Images
  46.         Dim play1 As String = poke.Configs("IMAGES").Get("Play")
  47.         Dim play2 As String = poke.Configs("IMAGES").Get("Play2")
  48.         Dim website1 As String = poke.Configs("IMAGES").Get("Website")
  49.         Dim website2 As String = poke.Configs("IMAGES").Get("Website2")
  50.         Dim forums As String = poke.Configs("IMAGES").Get("Forums")
  51.         Dim forums2 As String = poke.Configs("IMAGES").Get("Forums2")
  52.         Dim background As String = poke.Configs("IMAGES").Get("Background")
  53.         Dim close1 As String = poke.Configs("IMAGES").Get("Close")
  54.         Dim close2 As String = poke.Configs("IMAGES").Get("Close2")
  55.  
  56.         'Loading Possitions
  57.         Dim playx As String = poke.Configs("POSITIONS").Get("PlayX")
  58.         Dim playy As String = poke.Configs("POSITIONS").Get("PlayY")
  59.         Dim websitex As String = poke.Configs("POSITIONS").Get("WebsiteX")
  60.         Dim websitey As String = poke.Configs("POSITIONS").Get("WebsiteY")
  61.         Dim forumsx As String = poke.Configs("POSITIONS").Get("ForumsX")
  62.         Dim forumsy As String = poke.Configs("POSITIONS").Get("ForumsY")
  63.         Dim closex As String = poke.Configs("POSITIONS").Get("CloseX")
  64.         Dim closey As String = poke.Configs("POSITIONS").Get("CloseY")
  65.         Dim webbrowserx As String = poke.Configs("POSITIONS").Get("WebbrowserX")
  66.         Dim webbrowsery As String = poke.Configs("POSITIONS").Get("WebbrowserY")
  67.         Dim progressbar1x As String = poke.Configs("POSITIONS").Get("Progressbar1X")
  68.         Dim progressbar1y As String = poke.Configs("POSITIONS").Get("Progressbar1Y")
  69.         Dim progressbar2x As String = poke.Configs("POSITIONS").Get("Progressbar2X")
  70.         Dim progressbar2y As String = poke.Configs("POSITIONS").Get("Progressbar2Y")
  71.         Dim label1x As String = poke.Configs("POSITIONS").Get("Label1X")
  72.         Dim label1y As String = poke.Configs("POSITIONS").Get("Label1Y")
  73.         Dim label2x As String = poke.Configs("POSITIONS").Get("Label2X")
  74.         Dim label2y As String = poke.Configs("POSITIONS").Get("Label2Y")
  75.  
  76.         'Loading Sizes
  77.         Dim webwidth As String = poke.Configs("SIZES").Get("WebsiteWidth")
  78.         Dim webheight As String = poke.Configs("SIZES").Get("WebsiteHeight")
  79.         Dim forumwidth As String = poke.Configs("SIZES").Get("ForumsWidth")
  80.         Dim forumsheight As String = poke.Configs("SIZES").Get("ForumsHeight")
  81.         Dim playwidth As String = poke.Configs("SIZES").Get("PlayWidth")
  82.         Dim playheight As String = poke.Configs("SIZES").Get("PlayHeight")
  83.         Dim browserwidth As String = poke.Configs("SIZES").Get("WebbrowserWidth")
  84.         Dim browserheight As String = poke.Configs("SIZES").Get("WebbrowserHeight")
  85.         Dim basewidth As String = poke.Configs("SIZES").Get("BaseWidth")
  86.         Dim baseheight As String = poke.Configs("SIZES").Get("BaseHeight")
  87.         Dim closewidth As String = poke.Configs("SIZES").Get("CloseWidth")
  88.         Dim closeheight As String = poke.Configs("SIZES").Get("CloseHeight")
  89.         Dim pb1width As String = poke.Configs("SIZES").Get("Progressbar1Width")
  90.         Dim pb1height As String = poke.Configs("SIZES").Get("Progressbar1Height")
  91.         Dim pb2width As String = poke.Configs("SIZES").Get("Progressbar2Width")
  92.         Dim pb2height As String = poke.Configs("SIZES").Get("Progressbar2Height")
  93.  
  94.         'Loading Links
  95.         Dim weblink As String = poke.Configs("LINKS").Get("Website")
  96.         Dim forumlink As String = poke.Configs("LINKS").Get("Forums")
  97.         Dim newslink As String = poke.Configs("LINKS").Get("News")
  98.  
  99.         'Loading Shell Information
  100.         Dim jshell As String = poke.Configs("MISC").Get("Shell")
  101.  
  102.         'Set up the update info
  103.  
  104.         Dim Update As New IniConfigSource("update.ini")
  105.  
  106.         Dim u As String = Update.Configs("UPDATE").Get("UpdateINI")
  107.         Dim p As String = My.Computer.FileSystem.CurrentDirectory + "\"
  108.         Dim u2 As String = Update.Configs("UPDATE").Get("UpdateINI2")
  109.         Dim u3 As String = Update.Configs("UPDATE").Get("PostUpdateINI")
  110.         Dim rev1 As String = Update.Configs("REV").Get("New")
  111.         Dim rev2 As String = Update.Configs("REV").Get("Old")
  112.  
  113.         'Getting update info
  114.  
  115.         'Show on UI
  116.         Label1.Text = "Starting Up..."
  117.         If rev1 > rev2 Then
  118.             If System.IO.File.Exists(p + "pokenet.ini") = True Then
  119.                 System.IO.File.Delete(p + "pokenet.ini")
  120.             End If
  121.  
  122.             My.Computer.Network.DownloadFile _
  123.                 (u, _
  124.              p + "pokenet.ini")
  125.         End If
  126.         If rev1 = rev2 Then
  127.             If System.IO.File.Exists(p + "update.ini") = True Then
  128.                 System.IO.File.Delete(p + "update.ini")
  129.             End If
  130.  
  131.  
  132.             My.Computer.Network.DownloadFile _
  133.             (u3, _
  134.             p + "update.ini")
  135.  
  136.             'Change progressbars and update the label
  137.             ProgressBar1.Value = 100
  138.             ProgressBar2.Value = 10
  139.  
  140.             Label2.Text = "10%"
  141.         ElseIf rev1 > rev2 Then
  142.             If System.IO.File.Exists(p + "update.ini") = True Then
  143.                 System.IO.File.Delete(p + "update.ini")
  144.             End If
  145.  
  146.  
  147.             My.Computer.Network.DownloadFile _
  148.             (u2, _
  149.             p + "update.ini")
  150.  
  151.             'Change progressbars and update the label
  152.             ProgressBar1.Value = 100
  153.             ProgressBar2.Value = 10
  154.  
  155.             Label2.Text = "10%"
  156.         End If
  157.         'Download patches if there is any
  158.         Dim patch1 As String = Update.Configs("UPDATE").Get("PatchFiles1")
  159.         Dim patch2 As String = Update.Configs("UPDATE").Get("PatchFiles2")
  160.         Dim patch3 As String = Update.Configs("UPDATE").Get("PatchFiles3")
  161.         Dim patch4 As String = Update.Configs("UPDATE").Get("PatchFiles4")
  162.         Dim patch5 As String = Update.Configs("UPDATE").Get("PatchFiles5")
  163.         Dim patch6 As String = Update.Configs("UPDATE").Get("PatchFiles6")
  164.         Dim patch7 As String = Update.Configs("UPDATE").Get("PatchFiles7")
  165.         Dim patch8 As String = Update.Configs("UPDATE").Get("PatchFiles8")
  166.         Dim patch9 As String = Update.Configs("UPDATE").Get("PatchFiles9")
  167.         Dim patch10 As String = Update.Configs("UPDATE").Get("PatchFiles10")
  168.         Dim pstatus1 As String = Update.Configs("UPDATE").Get("Patch1")
  169.         Dim pstatus2 As String = Update.Configs("UPDATE").Get("Patch2")
  170.         Dim pstatus3 As String = Update.Configs("UPDATE").Get("Patch3")
  171.         Dim pstatus4 As String = Update.Configs("UPDATE").Get("Patch4")
  172.         Dim pstatus5 As String = Update.Configs("UPDATE").Get("Patch5")
  173.         Dim pstatus6 As String = Update.Configs("UPDATE").Get("Patch6")
  174.         Dim pstatus7 As String = Update.Configs("UPDATE").Get("Patch7")
  175.         Dim pstatus8 As String = Update.Configs("UPDATE").Get("Patch8")
  176.         Dim pstatus9 As String = Update.Configs("UPDATE").Get("Patch9")
  177.         Dim pstatus10 As String = Update.Configs("UPDATE").Get("Patch10")
  178.         Dim extention1 As String = Update.Configs("UPDATE").Get("Patch1Extention")
  179.         Dim extention2 As String = Update.Configs("UPDATE").Get("Patch2Extention")
  180.         Dim extention3 As String = Update.Configs("UPDATE").Get("Patch3Extention")
  181.         Dim extention4 As String = Update.Configs("UPDATE").Get("Patch4Extention")
  182.         Dim extention5 As String = Update.Configs("UPDATE").Get("Patch5Extention")
  183.         Dim extention6 As String = Update.Configs("UPDATE").Get("Patch6Extention")
  184.         Dim extention7 As String = Update.Configs("UPDATE").Get("Patch7Extention")
  185.         Dim extention8 As String = Update.Configs("UPDATE").Get("Patch8Extention")
  186.         Dim extention9 As String = Update.Configs("UPDATE").Get("Patch9Extention")
  187.         Dim extention10 As String = Update.Configs("UPDATE").Get("Patch10Extention")
  188.  
  189.         If pstatus1 = "Enabled" Then
  190.             Label1.Text = "Downloading Patch..."
  191.             ProgressBar1.Value = 0
  192.             If System.IO.File.Exists(p + extention1) = True Then
  193.                 System.IO.File.Delete(p + extention1)
  194.             End If
  195.  
  196.             My.Computer.Network.DownloadFile _
  197.                 (patch1, _
  198.              p + extention1)
  199.             If rev1 > rev2 Then
  200.                 If System.IO.File.Exists(p + "update.ini") = True Then
  201.                     System.IO.File.Delete(p + "update.ini")
  202.                 End If
  203.  
  204.  
  205.  
  206.                 My.Computer.Network.DownloadFile _
  207.                 (u3, _
  208.                 p + "update.ini")
  209.  
  210.                 'Update the progress
  211.                 ProgressBar1.Value = 100
  212.                 ProgressBar2.Value = 20
  213.                 Label2.Text = "20%"
  214.  
  215.                 Label1.Text = "Patching Complete"
  216.  
  217.                 'Update rev.
  218.                 Update.Configs("REV").Set("Old", rev1)
  219.  
  220.                 ' Save the INI file
  221.                 Update.Save()
  222.  
  223.                 'Double Check
  224.                 If rev1 > rev2 Then
  225.                     MsgBox("Error updating revisions")
  226.                 End If
  227.             End If
  228.  
  229.         ElseIf pstatus2 = "Enabled" Then
  230.             ProgressBar1.Value = 0
  231.             Label1.Text = "Downloading Patch..."
  232.             If System.IO.File.Exists(p + extention2) = True Then
  233.                 System.IO.File.Delete(p + extention2)
  234.             End If
  235.  
  236.             My.Computer.Network.DownloadFile _
  237.                 (patch2, _
  238.              p + extention2)
  239.             If rev1 > rev2 Then
  240.                 If System.IO.File.Exists(p + "update.ini") = True Then
  241.                     System.IO.File.Delete(p + "update.ini")
  242.                 End If
  243.  
  244.  
  245.  
  246.                 My.Computer.Network.DownloadFile _
  247.                 (u3, _
  248.                 p + "update.ini")
  249.  
  250.                 'Update the progress
  251.                 ProgressBar1.Value = 100
  252.                 ProgressBar2.Value = 30
  253.                 Label2.Text = "30%"
  254.  
  255.                 Label1.Text = "Patching Complete"
  256.  
  257.                 'Update rev.
  258.                 Update.Configs("REV").Set("Old", rev1)
  259.  
  260.                 ' Save the INI file
  261.                 Update.Save()
  262.  
  263.                 'Double Check
  264.                 If rev1 > rev2 Then
  265.                     MsgBox("Error updating revisions")
  266.                 End If
  267.             End If
  268.  
  269.         ElseIf pstatus3 = "Enabled" Then
  270.             Label1.Text = "Downloading Patch..."
  271.             ProgressBar1.Value = 0
  272.             If System.IO.File.Exists(p + extention3) = True Then
  273.                 System.IO.File.Delete(p + extention3)
  274.             End If
  275.  
  276.             My.Computer.Network.DownloadFile _
  277.                 (patch3, _
  278.              p + extention3)
  279.             If rev1 > rev2 Then
  280.                 If System.IO.File.Exists(p + "update.ini") = True Then
  281.                     System.IO.File.Delete(p + "update.ini")
  282.                 End If
  283.  
  284.                 My.Computer.Network.DownloadFile _
  285.                 (u3, _
  286.                 p + "update.ini")
  287.  
  288.                 'Update the progress
  289.                 ProgressBar1.Value = 100
  290.                 ProgressBar2.Value = 40
  291.                 Label2.Text = "40%"
  292.  
  293.                 Label1.Text = "Patching Complete"
  294.  
  295.                 'Update rev.
  296.                 Update.Configs("REV").Set("Old", rev1)
  297.  
  298.                 ' Save the INI file
  299.                 Update.Save()
  300.  
  301.                 'Double Check
  302.                 If rev1 > rev2 Then
  303.                     MsgBox("Error updating revisions")
  304.                 End If
  305.             End If
  306.  
  307.         ElseIf pstatus4 = "Enabled" Then
  308.             ProgressBar1.Value = 0
  309.             Label1.Text = "Downloading Patch..."
  310.             If System.IO.File.Exists(p + extention4) = True Then
  311.                 System.IO.File.Delete(p + extention4)
  312.             End If
  313.  
  314.             My.Computer.Network.DownloadFile _
  315.                 (patch4, _
  316.              p + extention4)
  317.             If rev1 > rev2 Then
  318.                 If System.IO.File.Exists(p + "update.ini") = True Then
  319.                     System.IO.File.Delete(p + "update.ini")
  320.                 End If
  321.  
  322.  
  323.  
  324.                 My.Computer.Network.DownloadFile _
  325.                 (u3, _
  326.                 p + "update.ini")
  327.  
  328.                 'Update the progress
  329.                 ProgressBar1.Value = 100
  330.                 ProgressBar2.Value = 50
  331.                 Label2.Text = "50%"
  332.  
  333.                 Label1.Text = "Patching Complete"
  334.  
  335.                 'Update rev.
  336.                 Update.Configs("REV").Set("Old", rev1)
  337.  
  338.                 ' Save the INI file
  339.                 Update.Save()
  340.  
  341.                 'Double Check
  342.                 If rev1 > rev2 Then
  343.                     MsgBox("Error updating revisions")
  344.                 End If
  345.             End If
  346.  
  347.         ElseIf pstatus5 = "Enabled" Then
  348.             ProgressBar1.Value = 0
  349.             Label1.Text = "Downloading Patch..."
  350.  
  351.             If System.IO.File.Exists(p + extention5) = True Then
  352.                 System.IO.File.Delete(p + extention5)
  353.             End If
  354.  
  355.             My.Computer.Network.DownloadFile _
  356.                 (patch5, _
  357.              p + extention5)
  358.             If rev1 > rev2 Then
  359.                 If System.IO.File.Exists(p + "update.ini") = True Then
  360.                     System.IO.File.Delete(p + "update.ini")
  361.                 End If
  362.  
  363.  
  364.  
  365.                 My.Computer.Network.DownloadFile _
  366.                 (u3, _
  367.                 p + "update.ini")
  368.  
  369.                 'Update the progress
  370.                 ProgressBar1.Value = 100
  371.                 ProgressBar2.Value = 60
  372.                 Label2.Text = "60%"
  373.  
  374.                 Label1.Text = "Patching Complete"
  375.  
  376.                 'Update rev.
  377.                 Update.Configs("REV").Set("Old", rev1)
  378.  
  379.                 ' Save the INI file
  380.                 Update.Save()
  381.  
  382.                 'Double Check
  383.                 If rev1 > rev2 Then
  384.                     MsgBox("Error updating revisions")
  385.                 End If
  386.             End If
  387.  
  388.         ElseIf pstatus6 = "Enabled" Then
  389.             ProgressBar1.Value = 0
  390.             Label1.Text = "Downloading Patch..."
  391.             If System.IO.File.Exists(p + extention6) = True Then
  392.                 System.IO.File.Delete(p + extention6)
  393.             End If
  394.  
  395.             My.Computer.Network.DownloadFile _
  396.                 (patch6, _
  397.              p + extention6)
  398.             If rev1 > rev2 Then
  399.                 If System.IO.File.Exists(p + "update.ini") = True Then
  400.                     System.IO.File.Delete(p + "update.ini")
  401.                 End If
  402.  
  403.  
  404.  
  405.                 My.Computer.Network.DownloadFile _
  406.                 (u3, _
  407.                 p + "update.ini")
  408.  
  409.                 'Update the progress
  410.                 ProgressBar1.Value = 100
  411.                 ProgressBar2.Value = 70
  412.                 Label2.Text = "70%"
  413.  
  414.                 Label1.Text = "Patching Complete"
  415.  
  416.                 'Update rev.
  417.                 Update.Configs("REV").Set("Old", rev1)
  418.  
  419.                 ' Save the INI file
  420.                 Update.Save()
  421.  
  422.                 'Double Check
  423.                 If rev1 > rev2 Then
  424.                     MsgBox("Error updating revisions")
  425.                 End If
  426.             End If
  427.  
  428.         ElseIf pstatus7 = "Enabled" Then
  429.             ProgressBar1.Value = 0
  430.             Label1.Text = "Downloading Patch..."
  431.  
  432.             If System.IO.File.Exists(p + extention7) = True Then
  433.                 System.IO.File.Delete(p + extention7)
  434.             End If
  435.  
  436.             My.Computer.Network.DownloadFile _
  437.                 (patch7, _
  438.              p + extention7)
  439.             If rev1 > rev2 Then
  440.                 If System.IO.File.Exists(p + "update.ini") = True Then
  441.                     System.IO.File.Delete(p + "update.ini")
  442.                 End If
  443.  
  444.  
  445.  
  446.                 My.Computer.Network.DownloadFile _
  447.                 (u3, _
  448.                 p + "update.ini")
  449.  
  450.                 'Update the progress
  451.                 ProgressBar1.Value = 100
  452.                 ProgressBar2.Value = 80
  453.                 Label2.Text = "80%"
  454.  
  455.                 Label1.Text = "Patching Complete"
  456.  
  457.                 'Update rev.
  458.                 Update.Configs("REV").Set("Old", rev1)
  459.  
  460.                 ' Save the INI file
  461.                 Update.Save()
  462.  
  463.                 'Double Check
  464.                 If rev1 > rev2 Then
  465.                     MsgBox("Error updating revisions")
  466.                 End If
  467.             End If
  468.         ElseIf pstatus8 = "Enabled" Then
  469.             ProgressBar1.Value = 0
  470.             Label1.Text = "Downloading Patch..."
  471.  
  472.             If System.IO.File.Exists(p + extention8) = True Then
  473.                 System.IO.File.Delete(p + extention8)
  474.             End If
  475.  
  476.             My.Computer.Network.DownloadFile _
  477.                 (patch8, _
  478.              p + extention8)
  479.             If rev1 > rev2 Then
  480.                 If System.IO.File.Exists(p + "update.ini") = True Then
  481.                     System.IO.File.Delete(p + "update.ini")
  482.                 End If
  483.  
  484.  
  485.  
  486.                 My.Computer.Network.DownloadFile _
  487.                 (u3, _
  488.                 p + "update.ini")
  489.  
  490.                 'Update the progress
  491.                 ProgressBar1.Value = 100
  492.                 ProgressBar2.Value = 90
  493.                 Label2.Text = "90%"
  494.  
  495.                 Label1.Text = "Patching Complete"
  496.  
  497.                 'Update rev.
  498.                 Update.Configs("REV").Set("Old", rev1)
  499.  
  500.                 ' Save the INI file
  501.                 Update.Save()
  502.  
  503.                 'Double Check
  504.                 If rev1 > rev2 Then
  505.                     MsgBox("Error updating revisions")
  506.                 End If
  507.             End If
  508.  
  509.         ElseIf pstatus9 = "Enabled" Then
  510.             ProgressBar1.Value = 0
  511.             Label1.Text = "Downloading Patch..."
  512.  
  513.             If System.IO.File.Exists(p + extention9) = True Then
  514.                 System.IO.File.Delete(p + extention9)
  515.             End If
  516.  
  517.             My.Computer.Network.DownloadFile _
  518.                 (patch9, _
  519.              p + extention9)
  520.             If rev1 > rev2 Then
  521.                 If System.IO.File.Exists(p + "update.ini") = True Then
  522.                     System.IO.File.Delete(p + "update.ini")
  523.                 End If
  524.  
  525.  
  526.  
  527.                 My.Computer.Network.DownloadFile _
  528.                 (u3, _
  529.                 p + "update.ini")
  530.  
  531.                 'Update the progress
  532.                 ProgressBar1.Value = 100
  533.                 ProgressBar2.Value = 95
  534.                 Label2.Text = "95%"
  535.  
  536.                 Label1.Text = "Patching Complete"
  537.  
  538.                 'Update rev.
  539.                 Update.Configs("REV").Set("Old", rev1)
  540.  
  541.                 ' Save the INI file
  542.                 Update.Save()
  543.  
  544.                 'Double Check
  545.                 If rev1 > rev2 Then
  546.                     MsgBox("Error updating revisions")
  547.                 End If
  548.  
  549.             ElseIf pstatus10 = "Enabled" Then
  550.                 ProgressBar1.Value = 0
  551.                 Label1.Text = "Downloading Patch..."
  552.  
  553.                 If System.IO.File.Exists(p + extention10) = True Then
  554.                     System.IO.File.Delete(p + extention10)
  555.                 End If
  556.  
  557.                 My.Computer.Network.DownloadFile _
  558.                     (patch10, _
  559.                  p + extention10)
  560.                 If rev1 > rev2 Then
  561.                     If System.IO.File.Exists(p + "update.ini") = True Then
  562.                         System.IO.File.Delete(p + "update.ini")
  563.                     End If
  564.  
  565.  
  566.  
  567.                     My.Computer.Network.DownloadFile _
  568.                     (u3, _
  569.                     p + "update.ini")
  570.  
  571.                     'Update the progress
  572.                     ProgressBar1.Value = 100
  573.                     ProgressBar2.Value = 100
  574.                     Label2.Text = "100%"
  575.  
  576.                     Label1.Text = "Patching Complete"
  577.  
  578.                     'Update rev.
  579.                     Update.Configs("REV").Set("Old", rev1)
  580.  
  581.                     ' Save the INI file
  582.                     Update.Save()
  583.  
  584.                     'Double Check
  585.                     If rev1 > rev2 Then
  586.                         MsgBox("Error updating revisions")
  587.                     End If
  588.  
  589.                 Else
  590.  
  591.                     'Update the progress
  592.                     ProgressBar1.Value = 100
  593.                     ProgressBar2.Value = 100
  594.                     Label2.Text = "100%"
  595.  
  596.                     Label1.Text = "Patching Complete"
  597.  
  598.                 End If
  599.             End If
  600.         End If
  601.         'Update the progress
  602.         ProgressBar1.Value = 100
  603.         ProgressBar2.Value = 100
  604.         Label2.Text = "100%"
  605.  
  606.         Label1.Text = "Patching Complete"
  607.  
  608.         Dim newupdate As New IniConfigSource("Update.ini")
  609.         'Update rev.
  610.         newupdate.Configs("REV").Set("Old", rev1)
  611.  
  612.         ' Save the INI file
  613.         newupdate.Save()
  614.  
  615.         'Setting Images
  616.  
  617.         'Background
  618.         Dim client1 As New System.Net.WebClient()
  619.         Dim stream1 As New System.IO.MemoryStream()
  620.         Dim data1 As Byte() = client1.DownloadData(background)
  621.         client1.Dispose()
  622.         stream1.Write(data1, 0, data1.Length)
  623.         Me.BackgroundImage = Image.FromStream(stream1)
  624.  
  625.         'Play Buttons
  626.         Dim client2 As New System.Net.WebClient()
  627.         Dim stream2 As New System.IO.MemoryStream()
  628.         Dim data2 As Byte() = client2.DownloadData(play1)
  629.         client2.Dispose()
  630.         stream2.Write(data2, 0, data2.Length)
  631.         PictureBox4.Image = Image.FromStream(stream2)
  632.  
  633.         'Website Buttons
  634.         Dim client4 As New System.Net.WebClient()
  635.         Dim stream4 As New System.IO.MemoryStream()
  636.         Dim data4 As Byte() = client4.DownloadData(website1)
  637.         client4.Dispose()
  638.         stream4.Write(data4, 0, data4.Length)
  639.         PictureBox2.Image = Image.FromStream(stream4)
  640.  
  641.         'Forum Buttons
  642.         Dim client6 As New System.Net.WebClient()
  643.         Dim stream6 As New System.IO.MemoryStream()
  644.         Dim data6 As Byte() = client6.DownloadData(forums)
  645.         client6.Dispose()
  646.         stream6.Write(data6, 0, data6.Length)
  647.         PictureBox3.Image = Image.FromStream(stream6)
  648.  
  649.         'Close Buttons
  650.         Dim client8 As New System.Net.WebClient()
  651.         Dim stream8 As New System.IO.MemoryStream()
  652.         Dim data8 As Byte() = client8.DownloadData(close1)
  653.         client8.Dispose()
  654.         stream8.Write(data8, 0, data8.Length)
  655.         PictureBox1.Image = Image.FromStream(stream8)
  656.  
  657.         'Setting Positions
  658.  
  659.         'Play Button
  660.         PictureBox4.Location = New Point(playx, playy)
  661.  
  662.         'Website Button
  663.         PictureBox2.Location = New Point(websitex, websitey)
  664.  
  665.         'Forum Button
  666.         PictureBox3.Location = New Point(forumsx, forumsy)
  667.  
  668.         'Close Button
  669.         PictureBox1.Location = New Point(closex, closey)
  670.  
  671.         'Webbrowser
  672.         WebBrowser1.Location = New Point(webbrowserx, webbrowsery)
  673.  
  674.         'Progressbar1
  675.         ProgressBar1.Location = New Point(progressbar1x, progressbar1y)
  676.  
  677.         'Progressbar2
  678.         ProgressBar2.Location = New Point(progressbar2x, progressbar2y)
  679.  
  680.         'Label1
  681.         Label1.Location = New Point(label1x, label1y)
  682.  
  683.         'Label2
  684.         Label2.Location = New Point(label2x, label2y)
  685.  
  686.         'Setting Sizes
  687.  
  688.         'Website Button
  689.         PictureBox2.Size = New Size(webwidth, webheight)
  690.  
  691.         'Forums Button
  692.         PictureBox3.Size = New Size(forumwidth, forumsheight)
  693.  
  694.         'Play Button
  695.         PictureBox4.Size = New Size(playwidth, playheight)
  696.  
  697.         'Webbrowser
  698.         WebBrowser1.Size = New Size(browserwidth, browserheight)
  699.  
  700.         'Form
  701.         Me.Size = New Size(basewidth, baseheight)
  702.  
  703.         'Close Button
  704.         PictureBox1.Size = New Size(closewidth, closeheight)
  705.  
  706.         'Progressbar1
  707.         ProgressBar1.Size = New Size(pb1width, pb1height)
  708.  
  709.         'Progressbar2
  710.         ProgressBar2.Size = New Size(pb2width, pb2height)
  711.  
  712.         'Setting News
  713.         WebBrowser1.Navigate(newslink)
  714.  
  715.     End Sub
  716.  
  717.     'Close Button Click
  718.     Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
  719.         Me.Close()
  720.     End Sub
  721.  
  722.     'Close Button Mouse Hover
  723.     Private Sub PictureBox1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseHover
  724.         'Ini information for the picture
  725.  
  726.         'Getting config info
  727.         Dim poke As New IniConfigSource("pokenet.ini")
  728.  
  729.         Dim close2 As String = poke.Configs("IMAGES").Get("Close2")
  730.  
  731.         Dim client10 As New System.Net.WebClient()
  732.         Dim stream10 As New System.IO.MemoryStream()
  733.         Dim data10 As Byte() = client10.DownloadData(close2)
  734.         client10.Dispose()
  735.         stream10.Write(data10, 0, data10.Length)
  736.         PictureBox1.Image = Image.FromStream(stream10)
  737.     End Sub
  738.  
  739.     'Close Button Mouse Leave
  740.     Private Sub PictureBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave
  741.         'Ini information for the picture
  742.  
  743.         'Getting config info
  744.         Dim poke As New IniConfigSource("pokenet.ini")
  745.  
  746.         Dim close1 As String = poke.Configs("IMAGES").Get("Close")
  747.  
  748.         Dim client11 As New System.Net.WebClient()
  749.         Dim stream11 As New System.IO.MemoryStream()
  750.         Dim data11 As Byte() = client11.DownloadData(close1)
  751.         client11.Dispose()
  752.         stream11.Write(data11, 0, data11.Length)
  753.         PictureBox1.Image = Image.FromStream(stream11)
  754.     End Sub
  755.  
  756.     'Website Button Click
  757.     Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
  758.         'Ini information for the link
  759.  
  760.         'Getting config info
  761.         Dim poke As New IniConfigSource("pokenet.ini")
  762.  
  763.         Dim weblink As String = poke.Configs("LINKS").Get("Website")
  764.  
  765.         'Opens the default webbrowser
  766.         Process.Start(weblink)
  767.     End Sub
  768.  
  769.     'Website Button Mouse Hover
  770.     Private Sub PictureBox2_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox2.MouseHover
  771.         'Ini information for the picture
  772.  
  773.         'Getting config info
  774.         Dim poke As New IniConfigSource("pokenet.ini")
  775.  
  776.         Dim website2 As String = poke.Configs("IMAGES").Get("Website2")
  777.  
  778.         Dim client12 As New System.Net.WebClient()
  779.         Dim stream12 As New System.IO.MemoryStream()
  780.         Dim data12 As Byte() = client12.DownloadData(website2)
  781.         client12.Dispose()
  782.         stream12.Write(data12, 0, data12.Length)
  783.         PictureBox2.Image = Image.FromStream(stream12)
  784.     End Sub
  785.  
  786.     'Website Button Mouse Leave
  787.     Private Sub PictureBox2_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox2.MouseLeave
  788.         'Ini information for the picture
  789.  
  790.         'Getting config info
  791.         Dim poke As New IniConfigSource("pokenet.ini")
  792.  
  793.         Dim website1 As String = poke.Configs("IMAGES").Get("Website")
  794.  
  795.         Dim client13 As New System.Net.WebClient()
  796.         Dim stream13 As New System.IO.MemoryStream()
  797.         Dim data13 As Byte() = client13.DownloadData(website1)
  798.         client13.Dispose()
  799.         stream13.Write(data13, 0, data13.Length)
  800.         PictureBox2.Image = Image.FromStream(stream13)
  801.     End Sub
  802.  
  803.     'Forums Button Click
  804.     Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
  805.         'Ini information for the link
  806.  
  807.         'Getting config info
  808.         Dim poke As New IniConfigSource("pokenet.ini")
  809.  
  810.         Dim forumlink As String = poke.Configs("LINKS").Get("Forums")
  811.  
  812.         'Opens the default webbrowser
  813.         Process.Start(forumlink)
  814.     End Sub
  815.  
  816.     'Forums Button Hover
  817.     Private Sub PictureBox3_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox3.MouseHover
  818.         'Ini information for the picture
  819.  
  820.         'Getting config info
  821.         Dim poke As New IniConfigSource("pokenet.ini")
  822.  
  823.         Dim forums2 As String = poke.Configs("IMAGES").Get("Forums2")
  824.  
  825.         Dim client14 As New System.Net.WebClient()
  826.         Dim stream14 As New System.IO.MemoryStream()
  827.         Dim data14 As Byte() = client14.DownloadData(forums2)
  828.         client14.Dispose()
  829.         stream14.Write(data14, 0, data14.Length)
  830.         PictureBox3.Image = Image.FromStream(stream14)
  831.     End Sub
  832.  
  833.     'Forums Button Leave
  834.     Private Sub PictureBox3_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox3.MouseLeave
  835.         'Ini information for the picture
  836.  
  837.         'Getting config info
  838.         Dim poke As New IniConfigSource("pokenet.ini")
  839.  
  840.         Dim forums1 As String = poke.Configs("IMAGES").Get("Forums")
  841.  
  842.         Dim client15 As New System.Net.WebClient()
  843.         Dim stream15 As New System.IO.MemoryStream()
  844.         Dim data15 As Byte() = client15.DownloadData(forums1)
  845.         client15.Dispose()
  846.         stream15.Write(data15, 0, data15.Length)
  847.         PictureBox3.Image = Image.FromStream(stream15)
  848.     End Sub
  849.  
  850.     'Play Button Click
  851.     Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
  852.         'Ini information for the shell
  853.  
  854.         'Getting config info
  855.         Dim poke As New IniConfigSource("pokenet.ini")
  856.  
  857.         Dim jshell As String = poke.Configs("MISC").Get("Shell")
  858.  
  859.         Shell(jshell)
  860.     End Sub
  861.  
  862.     'Play Button Hover
  863.     Private Sub PictureBox4_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox4.MouseHover
  864.         'Ini information for the picture
  865.  
  866.         'Getting config info
  867.         Dim poke As New IniConfigSource("pokenet.ini")
  868.  
  869.         Dim play2 As String = poke.Configs("IMAGES").Get("Play2")
  870.  
  871.         Dim client16 As New System.Net.WebClient()
  872.         Dim stream16 As New System.IO.MemoryStream()
  873.         Dim data16 As Byte() = client16.DownloadData(play2)
  874.         client16.Dispose()
  875.         stream16.Write(data16, 0, data16.Length)
  876.         PictureBox4.Image = Image.FromStream(stream16)
  877.     End Sub
  878.  
  879.     'Play Button Leave
  880.     Private Sub PictureBox4_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox4.MouseLeave
  881.         'Ini information for the picture
  882.  
  883.         'Getting config info
  884.         Dim poke As New IniConfigSource("pokenet.ini")
  885.  
  886.         Dim play1 As String = poke.Configs("IMAGES").Get("Play")
  887.  
  888.         Dim client17 As New System.Net.WebClient()
  889.         Dim stream17 As New System.IO.MemoryStream()
  890.         Dim data17 As Byte() = client17.DownloadData(play1)
  891.         client17.Dispose()
  892.         stream17.Write(data17, 0, data17.Length)
  893.         PictureBox4.Image = Image.FromStream(stream17)
  894.     End Sub
  895. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement