88 lines
2.7 KiB
C#
88 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.IO;
|
|
using System.Collections;
|
|
using System.Threading;
|
|
using System.Diagnostics;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace ITFInstaller
|
|
{
|
|
public partial class MapLauncher : Form
|
|
{
|
|
public MapLauncher()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
Settings m_settings = null;
|
|
PlatformSettings m_platformSettings = null;
|
|
|
|
public void parseGetISCFiles(PlatformSettings platformSettings,Settings settings)
|
|
{
|
|
FileSearch searcher = new FileSearch();
|
|
m_settings = settings;
|
|
m_platformSettings = platformSettings;
|
|
|
|
searcher.SearchExtensions.Add(".isc");
|
|
|
|
searcher.ExcludedFolders.Add(settings.DataPath + @"\AutoSave");
|
|
|
|
FileInfo[] filesRequired = searcher.Search(settings.DataPath);
|
|
|
|
|
|
SortedList listNode = new SortedList();
|
|
|
|
|
|
foreach (FileInfo fileInfo in filesRequired)
|
|
{
|
|
TreeNode node = new TreeNode();
|
|
node.Text = fileInfo.Name;
|
|
node.Tag = fileInfo.FullName;
|
|
|
|
if (!listNode.ContainsKey(fileInfo.Name))
|
|
listNode.Add(fileInfo.Name,node);
|
|
}
|
|
|
|
|
|
foreach (DictionaryEntry key in listNode)
|
|
{
|
|
treeViewFiles.Nodes.Add((TreeNode) key.Value);
|
|
|
|
}
|
|
|
|
treeViewFiles.ExpandAll();
|
|
|
|
}
|
|
|
|
|
|
public void Execute(string exeName, string Arguments)
|
|
{
|
|
ProcessStartInfo startInfo = new ProcessStartInfo(exeName);
|
|
startInfo.Arguments = Arguments;
|
|
Process.Start(startInfo);
|
|
|
|
}
|
|
|
|
private void treeViewFiles_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
{
|
|
if (treeViewFiles.SelectedNode != null)
|
|
{
|
|
string fullName = (string)treeViewFiles.SelectedNode.Tag;
|
|
//translate the path for the target
|
|
fullName = fullName.Replace(m_settings.DataPath + @"\", "");
|
|
fullName = fullName.Replace("\\","/");
|
|
string defaultCommandLineMap = "root=RaymanProduction/;" + "map=RaymanProduction" + @"/" + fullName + ";";
|
|
string commandLine = m_platformSettings.DriveKit + m_settings.RootStart + @"\x360_ITF_Techno_r.xex " + defaultCommandLineMap;
|
|
string Command = "/x " + m_settings.ConsoleIP + " " + commandLine;
|
|
Execute(m_platformSettings.RebootCommand, Command);
|
|
}
|
|
}
|
|
}
|
|
}
|