<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Code</title><link>https://sourceforge.net/p/tws2mm/wiki/Code/</link><description>Recent changes to Code</description><atom:link href="https://sourceforge.net/p/tws2mm/wiki/Code/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 14 Jun 2011 05:07:39 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/tws2mm/wiki/Code/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Code modified by Rhys</title><link>https://sourceforge.net/p/tws2mm/wiki/Code/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -1,7 +1,1 @@
-All the code from Shogun 2 Mod manager.
-
-
-Please download the attched files.
-
-
-Note, download the source code and open that up in Visual Basic 2010, since that'll give you a better idea what this does.
+Will be updated sometime..
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rhys</dc:creator><pubDate>Tue, 14 Jun 2011 05:07:39 -0000</pubDate><guid>https://sourceforge.net1121023c26b619f6395e929d7eab52cf7a40a9e4</guid></item><item><title>WikiPage Code modified by Rhys</title><link>https://sourceforge.net/p/tws2mm/wiki/Code/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,346 +1,7 @@
-Here is all the code used, VB 2010
-
-The main code on the front form
-
-&lt;a href="#"&gt;Imports System.IO
-Imports System.IO.File
-Imports Microsoft.Win32
-Imports System.Collections.Specialized
-
-
-Public Class Form1
-    Dim gamePath As String
-    Dim x As New List(Of String) From {"data.pack", "boot.pack", "language.txt", "local_en.pack", "local_en_patch.pack", "models.pack", "models2.pack", "movies.pack",
-                                               "movies2.pack", "patch.pack", "patch2.pack", "patch3.pack", "patch4.pack", "patch5.pack", "patch6.pack", "patch_movies.pack",
-                                               "patch_movies2.pack", "patch_movies3.pack", "shaders_patch.pack", "shaders_patch2.pack", "sound.pack", "terrain.pack"}
-    Dim steamPath As Object
-    Dim modFolder As Object
-    Dim Files As String()
-    Dim Files1 As String()
-    Dim modPath As String
-    Dim Filename As String
-    Dim Filename2 As String
-    Dim filePath As String
-    Dim openedFile As String
-    Dim pfmPath As String
-    Dim pFM As Object
-    Dim esfPath As String
-    Dim eSF As Object
-    Dim backUP As Object
-    Dim webAddress As String
-    Dim exeLOC As String
-    Dim userScript As String
-    Dim dir As String
-
-
-    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-        steamPath = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath", "Default Value")
-        modFolder = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", "Default Value")
-        gamePath = steamPath &amp; "\steamapps\common\total war shogun 2\data\"
-        modPath = modFolder
-        webAddress = "http://www.twcenter.net/forums/showthread.php?t=456819"
-        exeLOC = steamPath &amp; "\steamapps\common\total war shogun 2\Shogun2.exe"
-        dir = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
-        userScript = dir &amp; "\The Creative Assembly\Shogun2\scripts\user.script.txt"
-
-        Files = Directory.GetFiles(gamePath)
-        For Each Filename As String In Files
-            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
-            If x.Contains(Files2) Then
-            Else
-                ListBox1.Items.Add(Files2)
-            End If
-        Next
-
-        Files1 = Directory.GetFiles(modPath)
-        For Each Filename2 As String In Files1
-            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
-            If x.Contains(Files3) Then
-            Else
-                ListBox2.Items.Add(Files3)
-            End If
-
-        Next
-        Dim fileExists As Boolean
-        fileExists = My.Computer.FileSystem.FileExists(userScript)
-        If fileExists = False Then
-            My.Computer.FileSystem.WriteAllText(userScript, String.Empty, False)
-        End If
-    End Sub
-
-    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-        OpenFileDialog1.Filter = "PACK File (*.pack) |*.pack|Exes (*.exe) |*.exe"
-        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
-            filePath = Path.GetFullPath(OpenFileDialog1.FileName)
-            openedFile = OpenFileDialog1.SafeFileName
-            My.Computer.FileSystem.CopyFile(filePath, modPath &amp; openedFile)
-            Files = Directory.GetFiles(gamePath)
-            For Each Filename As String In Files
-                Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
-                If ListBox1.Items.Contains(Files2) Then
-
-                ElseIf x.Contains(Files2) Then
-
-                Else
-                    ListBox1.Items.Add(Files2)
-                End If
-
-            Next
-            Files1 = Directory.GetFiles(modPath)
-            For Each Filename2 As String In Files1
-                Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
-                If ListBox2.Items.Contains(Files3) Then
-
-                ElseIf x.Contains(Files3) Then
-
-                Else
-                    ListBox2.Items.Add(Files3)
-                End If
-            Next
-        End If
-    End Sub
-
-    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
-        My.Forms.Settings.ShowDialog()
-    End Sub
-
-    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
-        pFM = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", "Default Value")
-        pfmPath = pFM &amp; "PackFileManager.exe"
-        System.Diagnostics.Process.Start(pfmPath)
-    End Sub
-
-    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click     
-        eSF = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", "Default Value")
-        esfPath = eSF &amp; "*.exe"
-        System.Diagnostics.Process.Start(esfPath)
-    End Sub
-    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
-        Files = Directory.GetFiles(gamePath)
-        Files1 = Directory.GetFiles(modPath)
-        My.Computer.FileSystem.DeleteFile(modPath &amp; ListBox2.SelectedItem.ToString, FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)
-        ListBox2.Items.Remove(ListBox2.SelectedItem.ToString)
-   
-    End Sub
-
-    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
-        backUP = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
-        My.Computer.FileSystem.CopyFile(gamePath &amp; ListBox1.SelectedItem.ToString, backUP &amp; ListBox1.SelectedItem.ToString)
-
-    End Sub
-
-    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
-        My.Computer.Registry.CurrentUser.DeleteSubKeyTree("Software\Happy-I-am")
-        Me.Close()
-    End Sub
-
-    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
-        Dim selectedItem As String = ListBox2.SelectedItem
-        My.Computer.FileSystem.MoveFile(modPath &amp; selectedItem, gamePath &amp; selectedItem)
-        Dim toDelete As String = "mod " &amp; selectedItem &amp; ";" + Environment.NewLine
-        My.Computer.FileSystem.WriteAllText(userScript, toDelete, True)
-        Files1 = Directory.GetFiles(modPath)
-        For Each Filename As String In Files1
-            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
-            If ListBox2.Items.Contains(Files2) Then
-
-            ElseIf x.Contains(Files2) Then
-
-            Else
-                ListBox2.Items.Add(Files2)
-            End If
-        Next
-        Files = Directory.GetFiles(gamePath)
-        For Each Filename2 As String In Files
-            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
-            If ListBox1.Items.Contains(Files3) Then
-
-            ElseIf x.Contains(Files3) Then
-
-            Else
-                ListBox1.Items.Add(Files3)
-            End If
-        Next
-        ListBox2.Items.Remove(selectedItem)
-    End Sub
-
-    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
-        Dim selectedItem As String = ListBox1.SelectedItem
-        My.Computer.FileSystem.MoveFile(gamePath &amp; selectedItem, modPath &amp; selectedItem)
-        Files = Directory.GetFiles(gamePath)
-        For Each Filename2 As String In Files
-            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename2)
-            If ListBox1.Items.Contains(Files2) Then
-
-            ElseIf x.Contains(Files2) Then
-
-            Else
-                ListBox1.Items.Add(Files2)
-            End If
-        Next
-
-        Files1 = Directory.GetFiles(modPath)
-        For Each Filename As String In Files1
-            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename)
-            If ListBox2.Items.Contains(Files3) Then
-
-            ElseIf x.Contains(Files3) Then
-
-            Else
-                ListBox2.Items.Add(Files3)
-            End If
-        Next
-        Dim line As String
-        Dim Input As StreamReader
-        Dim PolicyIdCode As String = "mod " &amp; selectedItem &amp; ";"
-        Dim strFile As New ArrayList
-
-
-        Input = File.OpenText(userScript)
-
-        ' Loop through the &lt;strong class="highlight"&gt;file&lt;/strong&gt;
-        While Input.Peek &lt;&gt; -1
-            ' Read the next available line
-            line = Input.ReadLine
-
-            ' Check to see if the line contains what you're looking for.
-            ' If not, add it to an ArrayList
-            If Not line.Contains(PolicyIdCode) Then
-                ' If not, add it to an ArrayList
-                strFile.Add(line)
-            End If
-        End While
-
-        Input.Close()
-
-        ' Because we want to replace the content of the &lt;strong class="highlight"&gt;file&lt;/strong&gt;, we first
-        ' need to delete it.
-        If Exists(userScript) Then
-            File.Delete(userScript)
-        End If
-
-        ' Create &lt;strong class="highlight"&gt;a&lt;/strong&gt; StreamWriter object with the same filename
-        Dim objWriter As New System.IO.StreamWriter(userScript, True)
-        ' Iterate through the ArrayList
-        For Each item As String In strFile
-            ' Write the current item &lt;strong class="highlight"&gt;in&lt;/strong&gt; the ArrayList to the &lt;strong class="highlight"&gt;file&lt;/strong&gt;.
-            objWriter.WriteLine(item)
-        Next
-        objWriter.Flush()
-        objWriter.Close()
-
-
-        ListBox1.Items.Remove(selectedItem)
-
-        
-
-
-    End Sub
-
-    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
-        My.Forms.Dialog1.ShowDialog()
-    End Sub
-
-    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
-        modPath = modFolder
-        Dim folderExists As Boolean
-        folderExists = My.Computer.FileSystem.DirectoryExists(modPath)
-        If folderExists = True Then
-            MsgBox("Folder exists")
-            Files1 = Directory.GetFiles(modPath)
-        Else
-            My.Computer.FileSystem.CreateDirectory(modPath)
-            Files1 = Directory.GetFiles(modPath)
-        End If
-    End Sub
-
-    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
-        backUP = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
-        Dim folderExists As Boolean
-        folderExists = My.Computer.FileSystem.DirectoryExists(backUP)
-        If folderExists = True Then
-            MsgBox("Folder exists")
-        Else
-            My.Computer.FileSystem.CreateDirectory(backUP)
-        End If
-    End Sub
-
-    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
-        Process.Start(webAddress)
-    End Sub
-
-    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
-        Shell(exeLOC)
-        Me.Close()
-    End Sub
-
-    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
-        Dim Files As String() = Directory.GetFiles(gamePath)
-        Dim Filename As String
-        For Each Filename In Files
-            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
-            If x.Contains(Files2) Then
-                My.Computer.FileSystem.CopyFile(gamePath &amp; Files2, backUP &amp; "Data_BACKUP\" &amp; Files2)
-            End If
-        Next
-    End Sub
-
-End Class
-&lt;/a&gt;
-
-Here is the code for the settings form
-
-&lt;a href="#"&gt;Imports System.Windows.Forms
-Imports Microsoft.Win32
-Public Class Settings
-    Dim exists As Boolean = False
-    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
-
-        If exists = True Then
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", TextBox1.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", TextBox2.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", TextBox6.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", TextBox7.Text)
-        Else
-            Dim newKey As RegistryKey
-            newKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\Happy-I-am\Mod Manager")
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", TextBox1.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", TextBox2.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", TextBox6.Text)
-            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", TextBox7.Text)
-        End If
-        Me.DialogResult = System.Windows.Forms.DialogResult.OK
-        Me.Close()
-    End Sub
-
-    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
-        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
-        Me.Close()
-    End Sub
-
-    Private Sub Settings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
-        Try
-            If My.Computer.Registry.CurrentUser.OpenSubKey("Software\Happy-I-am\Mod Manager") IsNot Nothing Then
-                exists = True
-            End If
-        Finally
-            My.Computer.Registry.CurrentUser.Close()
-        End Try
-        Dim keyValue As Object
-        keyValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", "Default Value")
-        Dim keyValue2 As Object
-        keyValue2 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", "Default Value")
-        Dim keyValue3 As Object
-        keyValue3 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
-        Dim keyValue4 As Object
-        keyValue4 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", "Default Value")
-        TextBox1.Text = keyValue
-        TextBox2.Text = keyValue2
-        TextBox6.Text = keyValue3
-        TextBox7.Text = keyValue4
-
-
-    End Sub
-End Class
-&lt;/a&gt;
+All the code from Shogun 2 Mod manager.
+
+
+Please download the attched files.
+
+
+Note, download the source code and open that up in Visual Basic 2010, since that'll give you a better idea what this does.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rhys</dc:creator><pubDate>Tue, 14 Jun 2011 05:05:48 -0000</pubDate><guid>https://sourceforge.net39640d5f7a74f636a83f98ea2c4dad77ac4ca6a5</guid></item><item><title>WikiPage Code modified by Rhys</title><link>https://sourceforge.net/p/tws2mm/wiki/Code/</link><description>Here is all the code used, VB 2010

The main code on the front form

&lt;a href="#"&gt;Imports System.IO
Imports System.IO.File
Imports Microsoft.Win32
Imports System.Collections.Specialized


Public Class Form1
    Dim gamePath As String
    Dim x As New List(Of String) From {"data.pack", "boot.pack", "language.txt", "local_en.pack", "local_en_patch.pack", "models.pack", "models2.pack", "movies.pack",
                                               "movies2.pack", "patch.pack", "patch2.pack", "patch3.pack", "patch4.pack", "patch5.pack", "patch6.pack", "patch_movies.pack",
                                               "patch_movies2.pack", "patch_movies3.pack", "shaders_patch.pack", "shaders_patch2.pack", "sound.pack", "terrain.pack"}
    Dim steamPath As Object
    Dim modFolder As Object
    Dim Files As String()
    Dim Files1 As String()
    Dim modPath As String
    Dim Filename As String
    Dim Filename2 As String
    Dim filePath As String
    Dim openedFile As String
    Dim pfmPath As String
    Dim pFM As Object
    Dim esfPath As String
    Dim eSF As Object
    Dim backUP As Object
    Dim webAddress As String
    Dim exeLOC As String
    Dim userScript As String
    Dim dir As String


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        steamPath = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath", "Default Value")
        modFolder = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", "Default Value")
        gamePath = steamPath &amp; "\steamapps\common\total war shogun 2\data\"
        modPath = modFolder
        webAddress = "http://www.twcenter.net/forums/showthread.php?t=456819"
        exeLOC = steamPath &amp; "\steamapps\common\total war shogun 2\Shogun2.exe"
        dir = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        userScript = dir &amp; "\The Creative Assembly\Shogun2\scripts\user.script.txt"

        Files = Directory.GetFiles(gamePath)
        For Each Filename As String In Files
            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
            If x.Contains(Files2) Then
            Else
                ListBox1.Items.Add(Files2)
            End If
        Next

        Files1 = Directory.GetFiles(modPath)
        For Each Filename2 As String In Files1
            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
            If x.Contains(Files3) Then
            Else
                ListBox2.Items.Add(Files3)
            End If

        Next
        Dim fileExists As Boolean
        fileExists = My.Computer.FileSystem.FileExists(userScript)
        If fileExists = False Then
            My.Computer.FileSystem.WriteAllText(userScript, String.Empty, False)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.Filter = "PACK File (*.pack) |*.pack|Exes (*.exe) |*.exe"
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            filePath = Path.GetFullPath(OpenFileDialog1.FileName)
            openedFile = OpenFileDialog1.SafeFileName
            My.Computer.FileSystem.CopyFile(filePath, modPath &amp; openedFile)
            Files = Directory.GetFiles(gamePath)
            For Each Filename As String In Files
                Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
                If ListBox1.Items.Contains(Files2) Then

                ElseIf x.Contains(Files2) Then

                Else
                    ListBox1.Items.Add(Files2)
                End If

            Next
            Files1 = Directory.GetFiles(modPath)
            For Each Filename2 As String In Files1
                Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
                If ListBox2.Items.Contains(Files3) Then

                ElseIf x.Contains(Files3) Then

                Else
                    ListBox2.Items.Add(Files3)
                End If
            Next
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        My.Forms.Settings.ShowDialog()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        pFM = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", "Default Value")
        pfmPath = pFM &amp; "PackFileManager.exe"
        System.Diagnostics.Process.Start(pfmPath)
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click     
        eSF = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", "Default Value")
        esfPath = eSF &amp; "*.exe"
        System.Diagnostics.Process.Start(esfPath)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Files = Directory.GetFiles(gamePath)
        Files1 = Directory.GetFiles(modPath)
        My.Computer.FileSystem.DeleteFile(modPath &amp; ListBox2.SelectedItem.ToString, FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)
        ListBox2.Items.Remove(ListBox2.SelectedItem.ToString)
   
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        backUP = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
        My.Computer.FileSystem.CopyFile(gamePath &amp; ListBox1.SelectedItem.ToString, backUP &amp; ListBox1.SelectedItem.ToString)

    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        My.Computer.Registry.CurrentUser.DeleteSubKeyTree("Software\Happy-I-am")
        Me.Close()
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim selectedItem As String = ListBox2.SelectedItem
        My.Computer.FileSystem.MoveFile(modPath &amp; selectedItem, gamePath &amp; selectedItem)
        Dim toDelete As String = "mod " &amp; selectedItem &amp; ";" + Environment.NewLine
        My.Computer.FileSystem.WriteAllText(userScript, toDelete, True)
        Files1 = Directory.GetFiles(modPath)
        For Each Filename As String In Files1
            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
            If ListBox2.Items.Contains(Files2) Then

            ElseIf x.Contains(Files2) Then

            Else
                ListBox2.Items.Add(Files2)
            End If
        Next
        Files = Directory.GetFiles(gamePath)
        For Each Filename2 As String In Files
            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename2)
            If ListBox1.Items.Contains(Files3) Then

            ElseIf x.Contains(Files3) Then

            Else
                ListBox1.Items.Add(Files3)
            End If
        Next
        ListBox2.Items.Remove(selectedItem)
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        Dim selectedItem As String = ListBox1.SelectedItem
        My.Computer.FileSystem.MoveFile(gamePath &amp; selectedItem, modPath &amp; selectedItem)
        Files = Directory.GetFiles(gamePath)
        For Each Filename2 As String In Files
            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename2)
            If ListBox1.Items.Contains(Files2) Then

            ElseIf x.Contains(Files2) Then

            Else
                ListBox1.Items.Add(Files2)
            End If
        Next

        Files1 = Directory.GetFiles(modPath)
        For Each Filename As String In Files1
            Dim Files3 As String = My.Computer.FileSystem.GetName(Filename)
            If ListBox2.Items.Contains(Files3) Then

            ElseIf x.Contains(Files3) Then

            Else
                ListBox2.Items.Add(Files3)
            End If
        Next
        Dim line As String
        Dim Input As StreamReader
        Dim PolicyIdCode As String = "mod " &amp; selectedItem &amp; ";"
        Dim strFile As New ArrayList


        Input = File.OpenText(userScript)

        ' Loop through the &lt;strong class="highlight"&gt;file&lt;/strong&gt;
        While Input.Peek &lt;&gt; -1
            ' Read the next available line
            line = Input.ReadLine

            ' Check to see if the line contains what you're looking for.
            ' If not, add it to an ArrayList
            If Not line.Contains(PolicyIdCode) Then
                ' If not, add it to an ArrayList
                strFile.Add(line)
            End If
        End While

        Input.Close()

        ' Because we want to replace the content of the &lt;strong class="highlight"&gt;file&lt;/strong&gt;, we first
        ' need to delete it.
        If Exists(userScript) Then
            File.Delete(userScript)
        End If

        ' Create &lt;strong class="highlight"&gt;a&lt;/strong&gt; StreamWriter object with the same filename
        Dim objWriter As New System.IO.StreamWriter(userScript, True)
        ' Iterate through the ArrayList
        For Each item As String In strFile
            ' Write the current item &lt;strong class="highlight"&gt;in&lt;/strong&gt; the ArrayList to the &lt;strong class="highlight"&gt;file&lt;/strong&gt;.
            objWriter.WriteLine(item)
        Next
        objWriter.Flush()
        objWriter.Close()


        ListBox1.Items.Remove(selectedItem)

        


    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        My.Forms.Dialog1.ShowDialog()
    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        modPath = modFolder
        Dim folderExists As Boolean
        folderExists = My.Computer.FileSystem.DirectoryExists(modPath)
        If folderExists = True Then
            MsgBox("Folder exists")
            Files1 = Directory.GetFiles(modPath)
        Else
            My.Computer.FileSystem.CreateDirectory(modPath)
            Files1 = Directory.GetFiles(modPath)
        End If
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        backUP = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
        Dim folderExists As Boolean
        folderExists = My.Computer.FileSystem.DirectoryExists(backUP)
        If folderExists = True Then
            MsgBox("Folder exists")
        Else
            My.Computer.FileSystem.CreateDirectory(backUP)
        End If
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        Process.Start(webAddress)
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        Shell(exeLOC)
        Me.Close()
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        Dim Files As String() = Directory.GetFiles(gamePath)
        Dim Filename As String
        For Each Filename In Files
            Dim Files2 As String = My.Computer.FileSystem.GetName(Filename)
            If x.Contains(Files2) Then
                My.Computer.FileSystem.CopyFile(gamePath &amp; Files2, backUP &amp; "Data_BACKUP\" &amp; Files2)
            End If
        Next
    End Sub

End Class
&lt;/a&gt;

Here is the code for the settings form

&lt;a href="#"&gt;Imports System.Windows.Forms
Imports Microsoft.Win32
Public Class Settings
    Dim exists As Boolean = False
    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click

        If exists = True Then
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", TextBox1.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", TextBox2.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", TextBox6.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", TextBox7.Text)
        Else
            Dim newKey As RegistryKey
            newKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\Happy-I-am\Mod Manager")
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", TextBox1.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", TextBox2.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", TextBox6.Text)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", TextBox7.Text)
        End If
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub Settings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Try
            If My.Computer.Registry.CurrentUser.OpenSubKey("Software\Happy-I-am\Mod Manager") IsNot Nothing Then
                exists = True
            End If
        Finally
            My.Computer.Registry.CurrentUser.Close()
        End Try
        Dim keyValue As Object
        keyValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "PFM", "Default Value")
        Dim keyValue2 As Object
        keyValue2 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "ESF", "Default Value")
        Dim keyValue3 As Object
        keyValue3 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Backup", "Default Value")
        Dim keyValue4 As Object
        keyValue4 = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Happy-I-am\Mod Manager", "Mod-Folder", "Default Value")
        TextBox1.Text = keyValue
        TextBox2.Text = keyValue2
        TextBox6.Text = keyValue3
        TextBox7.Text = keyValue4


    End Sub
End Class
&lt;/a&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rhys</dc:creator><pubDate>Tue, 14 Jun 2011 00:57:34 -0000</pubDate><guid>https://sourceforge.net8e2a4d1e7b0e03b7613b85130206e80e46a6c1b3</guid></item></channel></rss>