Reputation: 2261
How is this behavior set? I can't find how to disable the bootstrapper from booting on reboot. I will install the program, turn off the computer and on the next day, when I start the computer, the bootstrapper window appears. Even though it will uninstall the bootstrapper. And when I installed it several times in tests, it happens that later I have several windows. But this pop-up doesn't always happen, and I don't know what it depends on.
Edit
Looking at the logs after the RegisterBegin:
Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{bf97c7e8-2ef4-4439-9504-96a7736c10f4}, options: 0x4, disable resume: No Registering bundle dependency provider: {bf97c7e8-2ef4-4439-9504-96a7736c10f4}, version: 1.0.120.0 Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{bf97c7e8-2ef4-4439-9504-96a7736c10f4}, resume: Active, restart initiated: No, disable resume: No
You see disable resume: No
, I can't find anything about it, but maybe it causes the application to run after reboot.
Edit2
It happen because bootstrapper add register HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce.
But can't find how turn off it.
Upvotes: 0
Views: 296
Reputation: 2261
Ultimately, the reason for this was adding the RunOnce registry for the bootstrapper. It is written on the Internet that, according to the developers, this is a confirmation of the success of the installation. But in my case, it is unnecessary for me, because I do the post-configuration test myself. To prevent this, I hooked up to the OnRegisterComplete event and remove all registers containing the name of my installer.
However, this requires running the bootstrapper with administrative privileges.
private void OnRegisterComplete(object sender, RegisterCompleteEventArgs e)
{
try
{
string registryKey = @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce";
RegistryKey key32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
RegistryKey key = key32.OpenSubKey(registryKey, true);
if (key != null)
{
var names = key.GetValueNames();
for (int i = 0; i < names.Length; i++)
{
var value = key.GetValue(names[i]);
if (value.ToString().Contains("NameInstaller.exe"))
key.DeleteValue(names[i]);
}
key.Close();
}
}
catch (Exception ex)
{
}
}
Upvotes: 0