31 lines
819 B
C#
31 lines
819 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
|
|
internal static class FirefoxLauncher
|
|
{
|
|
private static int Main()
|
|
{
|
|
string baseDir = AppDomain.CurrentDomain.BaseDirectory;
|
|
string scriptPath = Path.Combine(baseDir, "FirefoxSessionVault.ps1");
|
|
|
|
if (!File.Exists(scriptPath))
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
var startInfo = new ProcessStartInfo
|
|
{
|
|
FileName = "powershell.exe",
|
|
Arguments = "-NoProfile -Sta -ExecutionPolicy Bypass -WindowStyle Hidden -File \"" + scriptPath + "\" -Mode Toggle",
|
|
WorkingDirectory = baseDir,
|
|
UseShellExecute = false,
|
|
CreateNoWindow = true,
|
|
WindowStyle = ProcessWindowStyle.Hidden
|
|
};
|
|
|
|
Process.Start(startInfo);
|
|
return 0;
|
|
}
|
|
}
|