public string AppGuid; // NOTE: this may NOT represent the correct Guid. public ProgramInfo(InstallOptions objOptions) { DisplayName = objOptions.GetOptionValueOrDefault(InstallOption.DisplayName); InstallLocation = objOptions.GetOptionValueOrDefault(InstallOption.InstallLocation); Publisher = objOptions.GetOptionValueOrDefault(InstallOption.Publisher); DisplayIcon = objOptions.GetOptionValueOrDefault(InstallOption.DisplayIcon); ApplicationVersion = objOptions.GetOptionValueOrDefault(InstallOption.ApplicationVersion); DisplayVersion = objOptions.GetOptionValueOrDefault(InstallOption.DisplayVersion); URLInfoAbout = objOptions.GetOptionValueOrDefault(InstallOption.URLInfoAbout); Contact = objOptions.GetOptionValueOrDefault(InstallOption.Contact); AppGuid = objOptions.GetOptionValueOrDefault(InstallOption.AppGuid); }
private void ExecuteUninstall() { InstallerFileTable objTable = null; InstallerBinary objBinary = null; InstallOptions objOptions = null; InstallState = Installer.InstallState.Uninstalling; //TODO: uninstaller has to store options AND uninstall table. try { objBinary = new InstallerBinary(); objBinary.OpenStream(); objOptions = new InstallOptions(); objOptions.Deserialize(objBinary); objTable = new InstallerFileTable(this); objTable.Deserialize(objBinary); objBinary.CloseStream(); ProgramInfo objInfo = new ProgramInfo(objOptions); string strInstallRoot = objOptions.GetOptionValueOrDefault(InstallOption.UninstallFolderRoot_Uninstaller_Only); if (!System.IO.Directory.Exists(strInstallRoot)) { Globals.Logger.LogError("Fatal Error: The original install directory '" + strInstallRoot + "' does not exist, or was not packed in the uninstaller binary.", true, true); } RollbackOrUninstall(objTable, strInstallRoot, 0.0); RemoveRegistryKeys(objInfo); InstallState = Installer.InstallState.Successful; } catch (Exception ex) { InstallState = Installer.InstallState.Canceled; InstallErrors.Add("Error: " + ex.ToString()); Globals.Logger.LogError(ex.ToString(), false, true); } finally { EndUninstall(); } }