Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- namespace ParticleInstaller
- {
- class Program
- {
- private const string PARTICLE_PATH = "particles/sprowl_particles.pcf";
- private const string PARTICLE_MANIFEST_PATH = "particles_manifest.txt";
- static void Main(string[] args)
- {
- if (IsPortal2Running())
- {
- Console.Write("Portal 2 is running, you will need to restart portal 2 after this installation.\n Press any key to contine...");
- Console.ReadKey(true);
- }
- if (!File.Exists(PARTICLE_MANIFEST_PATH))
- {
- Console.Write("Cannot locate '" + PARTICLE_MANIFEST_PATH + "' ensure that it is in the same folder as\nthis executable before running.\nPress Any key to close...");
- Console.ReadKey(true);
- return;
- }
- string filecontents = File.ReadAllText(PARTICLE_MANIFEST_PATH);
- if (filecontents.Contains(PARTICLE_PATH))
- {
- Console.Write("There is already a refrence to these particles in the manifest, if you are\nexperienceing issues with the particles, verify your game cache, and re-run this\nexecutable.\n Press any key to close...");
- Console.ReadKey(true);
- return;
- }
- File.WriteAllText(PARTICLE_MANIFEST_PATH, filecontents.Insert(filecontents.IndexOf('}'), "\t\"file\"\t\"" + PARTICLE_PATH + "\"" + Environment.NewLine));
- Console.Write("The refrenece to the " + PARTICLE_PATH + "' has been added, you may now run\nPortal 2.\n Press any key to close...");
- Console.ReadKey(true);
- }
- public static bool IsPortal2Running()
- {
- return System.Diagnostics.Process.GetProcessesByName("portal2").Length != 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment