private void AddInstallInfoToRegistry() { UpdateStatus("Updating component registration..."); File.Copy(System.Windows.Forms.Application.ExecutablePath, installOptions.DestinationDirectory.Remove(installOptions.DestinationDirectory.Length - "\\Map Editor".Length) + "\\Installer.exe", true); RegistryEditor reg = new RegistryEditor(); reg.SetPath(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Map Editor"); reg.Write("DisplayName", "Pokemon Mystery Universe Map Editor"); reg.Write("UninstallString", installOptions.DestinationDirectory.Remove(installOptions.DestinationDirectory.Length - "\\Map Editor".Length) + "\\Installer.exe" + " /Uninstall MapEditor"); reg.Write("HasRepair", "0"); reg.Write("NoModify", "1"); reg.Write("Publisher", "PMU Team"); reg.Write("DisplayIcon", installOptions.DestinationDirectory + "\\Graphics\\pmuicon.ico"); reg.Write("InstallPath", installOptions.DestinationDirectory); reg.Write("Installed", "1"); if (installOptions.InstallAllUsers) { reg.Write("AllUsers", "1"); } else { reg.Write("AllUsers", "0"); } }
public void Uninstall() { RegistryEditor reg = new RegistryEditor(); string regPath = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Map Editor"; reg.SetPath(regPath); if (reg.SubKeyExists()) //if (reg.Read("Installed") == "1") { { UpdateStatus("Found previous installed version, uninstalling..."); string path = reg.Read("InstallPath"); if (System.IO.Directory.Exists(path)) { System.IO.Directory.Delete(path, true); } bool installAllUsers; if (reg.Read("AllUsers") == "1") { installAllUsers = true; } else { installAllUsers = false; } string desktopPath; string startMenuPath; if (installAllUsers) { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonDesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonStartMenu); } else { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup); } if (System.IO.File.Exists(desktopPath + "\\PMU Map Editor.lnk")) { System.IO.File.Delete(desktopPath + "\\PMU Map Editor.lnk"); } if (System.IO.File.Exists(startMenuPath + "\\PMU Map Editor.lnk")) { System.IO.File.Delete(startMenuPath + "\\PMU Map Editor.lnk"); } reg.DeleteSubKey(); } }
public static string GetInstallPath() { RegistryEditor reg = new RegistryEditor(); string regPath = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Client"; reg.SetPath(regPath); if (reg.SubKeyExists()) {//if (reg.Read("Installed") == "1") { string path = reg.Read("InstallPath"); if (System.IO.Directory.Exists(path)) { return path; } else { return null; } } return null; }
public static string GetInstallPath() { RegistryEditor reg = new RegistryEditor(); string regPath = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Map Editor"; reg.SetPath(regPath); if (reg.SubKeyExists()) //if (reg.Read("Installed") == "1") { { string path = reg.Read("InstallPath"); if (System.IO.Directory.Exists(path)) { return(path); } else { return(null); } } return(null); }
private void AddInstallInfoToRegistry() { UpdateStatus("Updating component registration..."); File.Copy(System.Windows.Forms.Application.ExecutablePath, installOptions.DestinationDirectory.Remove(installOptions.DestinationDirectory.Length - "\\Client".Length) + "\\Installer.exe", true); RegistryEditor reg = new RegistryEditor(); reg.SetPath(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Client"); reg.Write("DisplayName", "Pokemon Mystery Universe Client"); reg.Write("UninstallString", installOptions.DestinationDirectory.Remove(installOptions.DestinationDirectory.Length - "\\Client".Length) + "\\Installer.exe" + " /Uninstall Client"); reg.Write("HasRepair", "0"); reg.Write("NoModify", "1"); reg.Write("Publisher", "PMU Team"); reg.Write("DisplayIcon", installOptions.DestinationDirectory + "\\pmuicon.ico"); reg.Write("InstallPath", installOptions.DestinationDirectory); reg.Write("Installed", "1"); if (installOptions.InstallAllUsers) { reg.Write("AllUsers", "1"); } else { reg.Write("AllUsers", "0"); } }
public void Uninstall() { RegistryEditor reg = new RegistryEditor(); string regPath = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe Client"; reg.SetPath(regPath); if (reg.SubKeyExists()) {//if (reg.Read("Installed") == "1") { UpdateStatus("Found previous installed version, uninstalling..."); string path = reg.Read("InstallPath"); if (System.IO.Directory.Exists(path)) { System.IO.Directory.Delete(path, true); } bool installAllUsers; if (reg.Read("AllUsers") == "1") { installAllUsers = true; } else { installAllUsers = false; } string desktopPath; string startMenuPath; if (installAllUsers) { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonDesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonStartMenu); } else { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup); } if (System.IO.File.Exists(desktopPath + "\\Pokemon Mystery Universe.lnk")) { System.IO.File.Delete(desktopPath + "\\Pokemon Mystery Universe.lnk"); } if (System.IO.File.Exists(startMenuPath + "\\Pokemon Mystery Universe.lnk")) { System.IO.File.Delete(startMenuPath + "\\Pokemon Mystery Universe.lnk"); } reg.DeleteSubKey(); } // Uninstall the version installed by the old installer regPath = @"Software\Microsoft\Windows\CurrentVersion\Uninstall\Pokemon Mystery Universe"; reg.SetPath(regPath); if (reg.SubKeyExists()) {//if (reg.Read("Installed") == "1") { UpdateStatus("Found previous installed version, uninstalling..."); string path = reg.Read("InstallPath"); if (System.IO.Directory.Exists(path)) { System.IO.Directory.Delete(path, true); } bool installAllUsers; if (reg.Read("AllUsers") == "1") { installAllUsers = true; } else { installAllUsers = false; } string desktopPath; string startMenuPath; if (installAllUsers) { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonDesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonStartMenu); } else { desktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory); startMenuPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup); } if (System.IO.File.Exists(desktopPath + "\\Pokemon Mystery Universe.lnk")) { System.IO.File.Delete(desktopPath + "\\Pokemon Mystery Universe.lnk"); } if (System.IO.File.Exists(startMenuPath + "\\Pokemon Mystery Universe.lnk")) { System.IO.File.Delete(startMenuPath + "\\Pokemon Mystery Universe.lnk"); } reg.DeleteSubKey(); } }