Old New Thing , , .
, , "NoStartPage" \. , Windows , , .
Microsoft :
, Windows 7 - UAC . app.manifest.
(, ):
public static void Main(string[] args)
{
var root = Registry.ClassesRoot;
var applicationsSubKey = root.OpenSubKey("Applications", true);
if (applicationsSubKey != null)
{
bool updateNoStartPageKey = false;
var appNameSubKey = applicationsSubKey.OpenSubKey("MyAppName.exe", true);
if (appNameSubKey != null)
{
if (!appNameSubKey.GetValueNames().Contains("NoStartPage"))
{
updateNoStartPageKey = true;
}
}
else
{
appNameSubKey = applicationsSubKey.CreateSubKey("MyAppName.exe", RegistryKeyPermissionCheck.Default);
if (appNameSubKey != null)
{
updateNoStartPageKey = true;
}
}
if (updateNoStartPageKey)
{
appNameSubKey.SetValue("NoStartPage", string.Empty, RegistryValueKind.String);
}
}
}