Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
rounk-ctrl committed Oct 14, 2023
1 parent 24b147f commit cbfb4e3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Restore NuGet Packages
run: |
nuget restore Rectify11Installer.sln
nuget restore Rectify11ControlCenter\Rectify11ControlCenter.sln
nuget restore Rectify11ControlCenter\Rectify11ControlCenter.sln
- name: Build R11 Control Centre
run: msbuild Rectify11ControlCenter\Rectify11ControlCenter.sln /p:Configuration=Release
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Rectify11ControlCenter"]
path = Rectify11ControlCenter
url = https://github.com/ojask/Rectify11ControlCenter.git
[submodule "rectify11controlcenter"]
path = rectify11controlcenter
url = https://github.com/ojask/rectify11controlcenter.git
54 changes: 21 additions & 33 deletions Rectify11Installer/Core/Backend/Themes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,15 @@ private static bool InstallThemes()
public static void InstallR11Cpl()
{
UninstallR11Cpl();
string cplPath = Path.Combine(Variables.r11Folder, "Rectify11CPL", "Rectify11CPL.dll");

//create files
Directory.CreateDirectory(Path.Combine(Variables.r11Folder, "Rectify11CPL"));

File.WriteAllBytes(cplPath, Properties.Resources.Rectify11CPL);
Helper.SafeDirectoryDeletion(Path.Combine(Variables.r11Folder, "Rectify11ControlCenter"), false);
Directory.CreateDirectory(Path.Combine(Variables.r11Folder, "Rectify11ControlCenter"));
File.WriteAllBytes(Path.Combine(Variables.r11Folder, "Rectify11ControlCenter", "Rectify11ControlCenter.exe"), Properties.Resources.Rectify11CPL);

// create shortcut
using ShellLink shortcut = new();
shortcut.Target = Path.Combine(Variables.sys32Folder, "control.exe");
shortcut.Arguments = "/name Rectify11.SettingsCPL";
shortcut.WorkingDirectory = @"%windir%\system32";
shortcut.IconPath = Path.Combine(Variables.r11Folder, "Rectify11CPL", "Rectify11CPL.dll");
shortcut.Target = Path.Combine(Variables.r11Folder, "Rectify11ControlCenter", "Rectify11ControlCenter.exe");
shortcut.WorkingDirectory = @"%windir%\Rectify11\Rectify11ControlCenter";
shortcut.IconPath = Path.Combine(Variables.r11Folder, "Rectify11ControlCenter", "Rectify11ControlCenter.exe");
shortcut.IconIndex = 0;
shortcut.DisplayMode = ShellLink.LinkDisplayMode.edmNormal;

Expand All @@ -231,18 +227,7 @@ public static void InstallR11Cpl()
Logger.Warn("Error while saving shortcut: " + ex);
}
shortcut.Save(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Rectify11 Control Center.lnk"));

// register CPL
var proc = new Process();
proc.StartInfo.FileName = "regsvr32.exe";
proc.StartInfo.Arguments = "/s \"" + cplPath + "\"";
proc.Start();
proc.WaitForExit();

if (proc.ExitCode != 0)
{
Logger.WriteLine("Error while registering CPL: " + proc.ExitCode);
}

}
/// <summary>
/// uninstalls control center
Expand All @@ -257,19 +242,22 @@ private static void UninstallR11Cpl()
Helper.SafeFileDeletion(startmenuShortcut);
Helper.SafeFileDeletion(desktopShortcut);

if (!File.Exists(cplPath)) return;

// unregister CPL
var proc = new Process();
proc.StartInfo.FileName = "regsvr32.exe";
proc.StartInfo.Arguments = "/s /u \"" + cplPath + "\"";
proc.Start();
proc.WaitForExit();

if (proc.ExitCode != 0)
if (File.Exists(cplPath))
{
Logger.Warn("Error while unregistering CPL: " + proc.ExitCode);
// unregister CPL
var proc = new Process();
proc.StartInfo.FileName = "regsvr32.exe";
proc.StartInfo.Arguments = "/s /u \"" + cplPath + "\"";
proc.Start();
proc.WaitForExit();

if (proc.ExitCode != 0)
{
Logger.Warn("Error while unregistering CPL: " + proc.ExitCode);
}
}
// nuke r11cp
Helper.SafeDirectoryDeletion(Path.Combine(Variables.r11Folder, "Rectify11ControlCenter"), false);

//delete folder
Helper.SafeDirectoryDeletion(Path.Combine(Variables.r11Folder, "Rectify11CPL"), false);
Expand Down
1 change: 1 addition & 0 deletions rectify11controlcenter
Submodule rectify11controlcenter added at 1105a7

0 comments on commit cbfb4e3

Please sign in to comment.