public Installer(string filename)
{
try {
MsiFilename = filename;
Task.Factory.StartNew(() => {
// was coapp just installed by the bootstrapper?
if (((AppDomain.CurrentDomain.GetData("COAPP_INSTALLED") as string) ?? "false").IsTrue()) {
// we'd better make sure that the most recent version of the service is running.
EngineServiceManager.InstallAndStartService();
}
InstallTask = LoadPackageDetails();
});
bool wasCreated;
var ewhSec = new EventWaitHandleSecurity();
ewhSec.AddAccessRule(new EventWaitHandleAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), EventWaitHandleRights.FullControl, AccessControlType.Allow));
_ping = new EventWaitHandle(false, EventResetMode.ManualReset, "BootstrapperPing", out wasCreated, ewhSec);
// if we got this far, CoApp must be running.
try {
Application.ResourceAssembly = Assembly.GetExecutingAssembly();
} catch {
}
_window = new InstallerMainWindow(this);
_window.ShowDialog();
if (Application.Current != null) {
Application.Current.Shutdown(0);
}
ExitQuick();
} catch (Exception e) {
DoError(InstallerFailureState.FailedToGetPackageDetails, e);
}
}