Skip to content

Commit

Permalink
fix phase 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaProductions committed May 29, 2024
1 parent 7601cf0 commit 74b1f7a
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 41 deletions.
27 changes: 8 additions & 19 deletions Rectify11.Phase2/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ public static bool SafeFileDeletion(string path)
}
return true;
}
catch
catch (Exception ex)
{
Console.WriteLine("Failure deleting file: " + path + Environment.NewLine + ex.ToString());
return false;
}
}
public static bool SafeFileCopy(string file)
public static bool InstallSys32Dll(string file)
{
// whatever, its only for a few cases
try
Expand All @@ -70,12 +71,13 @@ public static bool SafeFileCopy(string src, string dest)
return false;
}
}
public static bool SafeFileCopyWOW64(string file)
public static bool InstallWow64Dlll(string file)
{
// whatever, its only for a few cases
try
{
if (!SafeFileDeletion(Path.Combine(Variables.sysWOWFolder, file))) return false;

File.Copy(Path.Combine(Variables.r11Files, file), Path.Combine(Variables.sysWOWFolder, file), true);
return true;
}
Expand All @@ -84,33 +86,20 @@ public static bool SafeFileCopyWOW64(string file)
return false;
}
}
public static bool SafeFileCopyWOW64(string src, string dest)
public static bool SafeFileMove(string src, string dest)
{
try
{
if (!SafeFileDeletion(dest)) return false;
File.Copy(src, dest, true);
File.Move(src, dest);
return true;
}
catch
{
return false;
}
}
public static bool SafeFileMove(string src, string dest)
{
try
{
if (!SafeFileDeletion(dest)) return false;
File.Move(src, dest);
return true;
}
catch
{
return false;
}
}
public static void ImportReg(string path)
public static void ImportReg(string path)
{
try
{
Expand Down
17 changes: 9 additions & 8 deletions Rectify11.Phase2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Rectify11 Legacy Resource Installation Utility. Do not call this directly, instead use Rectify11Installer.");
Environment.Exit(1);
}
if (args[0] == "/install")
Expand All @@ -44,15 +45,15 @@ private static void Main(string[] args)
}

// copy necessary files
SafeFileCopy("iconres.dll");
InstallSys32Dll("iconres.dll");
ImportReg(Path.Combine(Variables.r11Files, "icons.reg"));
SafeFileCopy("duires.dll");
SafeFileCopy("ImmersiveFontHandler.dll");
SafeFileCopy("twinuifonts.dll");
SafeFileCopyWOW64("iconres.dll");
SafeFileCopyWOW64("duires.dll");
SafeFileCopyWOW64("ImmersiveFontHandler.dll");
SafeFileCopyWOW64("twinuifonts.dll");
InstallSys32Dll("duires.dll");
InstallSys32Dll("ImmersiveFontHandler.dll");
InstallSys32Dll("twinuifonts.dll");
InstallWow64Dlll("iconres.dll");
InstallWow64Dlll("duires.dll");
InstallWow64Dlll("ImmersiveFontHandler.dll");
InstallWow64Dlll("twinuifonts.dll");
InstallFonts();

r11Reg?.Close();
Expand Down
6 changes: 3 additions & 3 deletions Rectify11.Phase2/Rectify11.Phase2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<Company>Rectify11</Company>
<Product>Rectify11Installer.</Product>
<Copyright>Copyright © 2024 The Rectify11 Team</Copyright>
<AssemblyVersion>3.2.63.4</AssemblyVersion>
<FileVersion>3.2.63.4</FileVersion>
<AssemblyVersion>3.2.67</AssemblyVersion>
<FileVersion>3.2.67</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -52,7 +52,7 @@

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<PropertyGroup>
<PostBuildCommands>copy /Y "$(TargetDir)Rectify11.Phase2.dll" "$(SolutionDir)Rectify11Installer/Resources/Rectify11.Phase2.dll" &amp;&amp; copy /Y "$(TargetDir)Rectify11.Phase2.exe" "$(SolutionDir)Rectify11Installer/Resources/Rectify11.Phase2.exe"</PostBuildCommands>
<PostBuildCommands>copy /Y "$(TargetDir)Rectify11.Phase2.dll" "$(SolutionDir)Rectify11Installer/Resources/Rectify11.Phase2.dll" &amp;&amp; copy /Y "$(TargetDir)Rectify11.Phase2.exe" "$(SolutionDir)Rectify11Installer/Resources/Rectify11.Phase2.exe" &amp;&amp; copy /Y "$(TargetDir)Rectify11.Phase2.runtimeconfig.json" "$(SolutionDir)Rectify11Installer/Resources/Rectify11.Phase2.runtimeconfig.json"</PostBuildCommands>
</PropertyGroup>
<Exec Command="$(PostBuildCommands)" />
</Target>
Expand Down
8 changes: 7 additions & 1 deletion Rectify11Installer/Core/Backend/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ public static bool WriteFiles(bool icons, bool themes)
{
if (!Helper.SafeFileOperation(Path.Combine(Variables.r11Folder, "NSudoL.exe"), Properties.Resources.NSudoL, Helper.OperationType.Write))
return false;
if (!Helper.SafeFileOperation(Path.Combine(Variables.r11Folder, "Rectify11.Phase2.exe"), Properties.Resources.Rectify11Phase2, Helper.OperationType.Write))
if (!Helper.SafeFileOperation(Path.Combine(Variables.r11Folder, "Rectify11.Phase2.exe"), Properties.Resources.Rectify11Phase2Exe, Helper.OperationType.Write))
return false;

if (!Helper.SafeFileOperation(Path.Combine(Variables.r11Folder, "Rectify11.Phase2.dll"), Properties.Resources.Rectify11_Phase2Dll, Helper.OperationType.Write))
return false;

if (!Helper.SafeFileOperation(Path.Combine(Variables.r11Folder, "Rectify11.Phase2.runtimeconfig.json"), Properties.Resources.Rectify11_Phase2_runtimeconfig, Helper.OperationType.Write))
return false;
}
if (themes)
Expand Down
24 changes: 22 additions & 2 deletions Rectify11Installer/Properties/Resources.Designer.cs

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

20 changes: 13 additions & 7 deletions Rectify11Installer/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<data name="eula" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAANQAAADBCAYAAAC3xZ4wAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAdnJJREFUeF7tvQd4VVd29v/ly5RMSTJf/kkmZZLMZLo944IbmN6rEGqIJnrv3caY
DQAACw0B7QfALAAAdnJJREFUeF7tvQd4VVd29v/ly5RMSTJf/kkmZZLMZLo944IbmN6rEGqIJnrv3caY
3nvvvWM66gUQmGabYmM6iCIkIQEqIIoAAfv/vrucu+/RlY3HGBBz9/O8rHOrCuend+211z73/zztsejU
uL9fnDGz1MJL0xotTp06eMGFKXOgLQvOT9027/yUT+eem6yUMmX73LOTtsw9M3nO3LMTB885PaHRvLNT
Sum38Q//+OsdhGjJpZmNFl2aNmdx6vTtU86N2D3yVL/k9453SupxpGV8u8OhMS0PBEY3+7ROZJP9tSOb
Expand Down Expand Up @@ -632,7 +632,7 @@
<data name="installoptns" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAJnBJREFUeF7tnUlQHce+5m9H9LI7ovcdL+KtO7rv9Wxf+15LsmXJsyVf2xoYhNCE
DQAACw0B7QfALAAAJnBJREFUeF7tnUlQHce+5m9H9LI7ovcdL+KtO7rv9Wxf+15LsmXJsyVf2xoYhNCE
BIh5FCAEmmeJSRKTZkADM0i6m168fb/127xedERv3+udd9nfl5XnqCgSgSSg6pzz/SN+IQfUOWRm5ffL
rDoF/oNKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQq
lUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCrVcjVY
Expand Down Expand Up @@ -1639,7 +1639,7 @@
<data name="ResourceHacker" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ResourceHacker.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Rectify11Phase2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="Rectify11Phase2Exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Rectify11.Phase2.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="rectify11xml" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down Expand Up @@ -2072,7 +2072,7 @@
<data name="perf" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAJwAAADCCAYAAAC8PKvKAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAASZVJREFUeF7tvWdYVOfe//u8e86r/znXOdd5t0+7nv+zU/be2THN3ktsqGCjzQwg
DQAACw0B7QfALAAASZVJREFUeF7tvWdYVOfe//u8e86r/znXOdd5t0+7nv+zU/be2THN3ktsqGCjzQwg
2Av2AoIoioJ0ZigmJrHEXqPR2LuI3ZhEw040MZqqJroVZtaQ+3y/91oLF8MaGGEo6tzX9b1msWbNMMz6
8Gt3+49Ae7GaKD/5X9phoAVa0zd3eWmMKC/9H9qPgRZoTduqykvjlfLSPtqPgRZoTddE+bH/s+qLY2Or
rp+ayGPtdKAFWtM0uNK/uK/si3KfWhMM1zpMOx1ogdY0zVV+to371PrhruLRbQNWLtCavLnLTwe5j3wQ
Expand Down Expand Up @@ -3194,7 +3194,7 @@
<data name="incomplete" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAOEAAADqCAYAAABUdCK5AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAA4VVJREFUeF7snQecJFW1//9GzO/pM6EooLB5FxQJgsiiT1BJAhIkiQTJOccl58zm
DQAACw0B7QfALAAA4VVJREFUeF7snQecJFW1//9GzO/pM6EooLB5FxQJgsiiT1BJAhIkiQTJOccl58zm
nHOcvJNzzjn35O7pntiTu7vq/M85996qWz2zwPL0PdCpz+f3ObdqZmeHYb77O+fcUP9v+pq+PumXx+P5
anNz8/fa29sXdHZ2/u5Q6ujo+CV9Dn7+T+Qfnb6mr+nro14EGsFDMLW1td2K8WmEagNCtaerqyvW7XbH
er3euL6+vhipWG3M6u3tjcHPie3u7o7FPxeHf34JxtdQ10g4vyr/uulr+pq+CDgE42IE7gGCjUBDeBiy
Expand Down Expand Up @@ -4161,7 +4161,7 @@
<data name="install" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAANUAAADfCAYAAABh25blAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAp5xJREFUeF7tnQd4HNXV/pNQbDA9lFBCCzZumCSEEkJxki89hDRSCCSEhIQQWmih
DQAACw0B7QfALAAAp5xJREFUeF7tnQd4HNXV/pNQbDA9lFBCCzZumCSEEkJxki89hDRSCCSEhIQQWmih
m9477uAGBmyMC1Z1L3LvXS6SZUuWJUuW5G5LuzPzP+8pd+6sZJvvC/9gsOZ53ufcmV0vstif33POvXPn
c81H87GvH5WVla1Wr159QllZWafy8vLv7U7r1q37Jt5D7z9T/2jz0XzsvwfAAQyAo7S09EaKDxMkAwiS
oevXr8+rqKjIq6qqyq+trc1V5XljVk1NTS69J2/Dhg159Ofy6c93o/gc6RqFrZX+55qP5uOzdwAg+qL/
Expand Down Expand Up @@ -40408,7 +40408,7 @@
<data name="asdf" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAMUAAADNCAYAAAAIa7SdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAXEVJREFUeF7tnQd4FVX6//3p+l9F7HSQ3psCVpoo0jG00HsvoSVACAlJSELvHQRZ
DQAACw0B7QfALAAAXEVJREFUeF7tnQd4FVX6//3p+l9F7HSQ3psCVpoo0jG00HsvoSVACAlJSELvHQRZ
+66rrrqr61pwRV0VsYMKAtIJNSGUhJCQe/7f7+G847mTmxAQQcO8z/N9zszcNnfm/Zz3fc+ZO/cazzzz
zDPPLrMppf7PLHrmWf4zOLhZym7WY/9nltkSCK3Y2NhrzbIGxTymzXqtZ5798czl0I7T5yYDBM1vO2Gw
3k9Ek9Yzz353Zjup48SyDl1rHF6igF62tvltp1yP2dLvyc8wrazrlhs98+xymuOQljPKsp/Tctk49nVc
Expand Down Expand Up @@ -40823,4 +40823,10 @@
<data name="ThemeDLL" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ThemeDLL.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Rectify11.Phase2.runtimeconfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Rectify11.Phase2.runtimeconfig.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Rectify11.Phase2Dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Rectify11.Phase2.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
15 changes: 14 additions & 1 deletion Rectify11Installer/Rectify11Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<MapFileExtensions>true</MapFileExtensions>
<Version>3.2.65</Version>
<Version>3.2.67</Version>
<LangVersion>latest</LangVersion>
<PublishSingleFile>true</PublishSingleFile>
<UseWindowsForms>true</UseWindowsForms>
Expand Down Expand Up @@ -44,6 +44,19 @@
</PackageReference>
<PackageReference Include="System.Management" Version="9.0.0-preview.4.24266.19" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<PropertyGroup>
<PreBuildEvent>call $(SolutionDir)Resources\Tools\rebuild_archives.bat "$(SolutionDir)" "$(MSBuildProjectDirectory)"</PreBuildEvent>
Expand Down
13 changes: 13 additions & 0 deletions Rectify11Installer/Resources/Rectify11.Phase2.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

0 comments on commit 74b1f7a

Please sign in to comment.