-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (40 loc) · 1.92 KB
/
Copy pathProgram.cs
File metadata and controls
43 lines (40 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Diagnostics;
namespace MyApp
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Unreal Pak.exe Path");
string UnrealPakEXE_path = Console.ReadLine();
Console.WriteLine("unpack (0) or pack? (1)");
if (int.TryParse(Console.ReadLine(), out int result))
{
if (result == 0)
{
Console.WriteLine("*.pak path");
string UnrealGamePak = Console.ReadLine();
Process.Start("cmd.exe", $@"/c ""{UnrealPakEXE_path}"" {UnrealGamePak} -Extract {Path.GetDirectoryName(UnrealGamePak) + @"\All_of_the_Game"}");
}
if (result == 1)
{
Console.WriteLine("decompiled pak folder");
string DecompiledPakFolder = Console.ReadLine();
string filePath = "DataToPack.txt";
string[] dd = Directory.GetDirectories(DecompiledPakFolder);
string GameNamePath = dd.FirstOrDefault(item => !item.Contains("Engine"));
string GameName = Path.GetFileName(GameNamePath);
using (var writer = new StreamWriter(filePath, append: true))
{
writer.WriteLine(@$"""{DecompiledPakFolder}\Engine\*"" ""../../../Engine/""");
writer.WriteLine(@$"""{DecompiledPakFolder}\{GameName}\*"" ""../../../{GameName}/""");
}
string basePath = Environment.CurrentDirectory;
string DataToPackPath = Path.GetFullPath(filePath, basePath);
Process.Start("cmd.exe", $@"/c ""{UnrealPakEXE_path}"" {Path.GetDirectoryName(DecompiledPakFolder) + @$"\{GameName}-WindowsNoeditor-Repackaged.pak"} -Create={DataToPackPath}");
}
}
}
}
}