Skip to content

Commit

Permalink
rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
rounk-ctrl committed Aug 2, 2023
1 parent d51c1c5 commit 8cb9cf2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
12 changes: 9 additions & 3 deletions Rectify11.Phase2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ private static void Main(string[] args)
string finalPath = FixString(patches.Items[j].HardlinkTarget, false);
Console.WriteLine("Backup: " + backupPath);
Console.WriteLine("Final: " + finalPath);
File.Move(finalPath, Path.Combine(Path.GetTempPath(), Path.GetFileName(finalPath)));
string filename = Path.Combine(Path.GetTempPath(), Path.GetFileName(finalPath));
File.Move(finalPath, filename);
File.Move(backupPath, finalPath);
MoveFileEx(filename, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
lastfile = uninstallFiles[k];
}
}
Expand All @@ -229,8 +231,10 @@ private static void Main(string[] args)
string finalPath = FixString(patches.Items[j].HardlinkTarget, true);
Console.WriteLine("Backup: " + backupPath);
Console.WriteLine("Final: " + finalPath);
File.Move(finalPath, Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(patches.Items[j].Mui) + "86" + Path.GetExtension(patches.Items[j].Mui)));
string filename = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(patches.Items[j].Mui) + "86" + Path.GetExtension(patches.Items[j].Mui));
File.Move(finalPath, filename);
File.Move(backupPath, finalPath);
MoveFileEx(filename, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
}
}
}
Expand All @@ -242,8 +246,10 @@ private static void Main(string[] args)
string finalPath = FixString(patches.Items[j].HardlinkTarget, false);
Console.WriteLine("Backup: " + backupDiagDir[i]);
Console.WriteLine("Final: " + finalPath + "\n");
File.Move(finalPath, Path.Combine(Path.GetTempPath(), Path.GetFileName(backupDiagDir[i])));
string filename = Path.Combine(Path.GetTempPath(), Path.GetFileName(backupDiagDir[i]));
File.Move(finalPath, filename);
File.Move(backupDiagDir[i], finalPath);
MoveFileEx(filename, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions Rectify11Installer/Core/Uninstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ await Task.Run(() => Interaction.Shell(Path.Combine(Variables.r11Folder, "aRun.e
}
}
catch { }
var oldFiles = Directory.GetFiles(Path.Combine(Variables.Windir, "Temp"), "*", SearchOption.TopDirectoryOnly);
for (int i = 0; i < oldFiles.Length; i++)
{
MoveFileEx(oldFiles[i], null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
}
File.Delete(Path.Combine(Variables.r11Folder, "Rectify11.Phase2.exe"));
File.Delete(Path.Combine(Variables.r11Folder, "aRun.exe"));
}
Expand Down Expand Up @@ -259,7 +254,10 @@ await Task.Run(() => Interaction.Shell(Path.Combine(Variables.r11Folder, "aRun.e
}
}
// cleanup
Directory.Delete(Path.Combine(Variables.r11Folder, "Tmp"));
if (Directory.Exists(Path.Combine(Variables.r11Folder, "Tmp")))
{
Directory.Delete(Path.Combine(Variables.r11Folder, "Tmp"));
}
frm.InstallerProgress = "Done, you can close this window";
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Rectify11Installer/Pages/Experimental.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Rectify11Installer/Pages/InstallOptnsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static void UpdateListView(PatchesPatch[] patch, TreeNode basicNode, Tre
if (patch[i].HardlinkTarget.Contains("%diag%"))
{
var name = patch[i].Mui.Replace("Troubleshooter: ", "DiagPackage") + ".dll";
if (!File.Exists(Path.Combine(Variables.r11Folder, "backup", "Diag", name)))
if (!File.Exists(Path.Combine(path, "Diag", name)))
{
var newpath = patch[i].HardlinkTarget.Replace(@"%diag%", Variables.diag);
if (File.Exists(newpath))
Expand Down
23 changes: 17 additions & 6 deletions Rectify11Installer/Pages/ProgressPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public void StartReset()
{
timer1.Stop();
progressText.Text = "Restarting your PC";
progressInfo.Text = "Rectify11 has finished installing. Your device needs to restart in order to complete the installation, it will automatically restart in " + duration.ToString() + " seconds";
if (Variables.IsUninstall)
{
progressInfo.Text = "Rectify11 has finished uninstalling. Your device needs to restart in order to complete the uninstallation, it will automatically restart in " + duration.ToString() + " seconds";
}
else
{
progressInfo.Text = "Rectify11 has finished installing. Your device needs to restart in order to complete the installation, it will automatically restart in " + duration.ToString() + " seconds";
}
frmwiz.InstallerProgress = "Restarting in " + duration.ToString() + " seconds";
frmwiz.UpdateSideImage = Properties.Resources.done;
timer2.Start();
Expand All @@ -87,10 +94,13 @@ private async void NavigationHelper_OnNavigate(object sender, EventArgs e)
frmwiz.pictureBox1.Visible = true;
frmwiz.progressLabel.Visible = true;
RectifyPages.ProgressPage.Start();
NativeMethods.SetCloseButton(frmwiz, false);
Uninstaller uninstaller = new();
await uninstaller.Uninstall(frmwiz);
NativeMethods.SetCloseButton(frmwiz, false);
RectifyPages.ProgressPage.StartReset();
}
else
else
{
frmwiz.versionLabel.Visible = false;
ExtrasOptions.FinalizeIRectify11();
Expand Down Expand Up @@ -201,11 +211,12 @@ private async void ApplyScheme()
private void NextText()
{
if (Variables.IsUninstall)
{
progressText.Text = "very J";
progressInfo.Text = "r11 gone";
{
progressText.Text = ":(";
progressInfo.Text = "Rectify11 gone";

}
else
else
{
CurrentTextIndex++;
if (CurrentTextIndex >= Rectify11InstallerTexts.Length)
Expand Down

0 comments on commit 8cb9cf2

Please sign in to comment.