Skip to content

Commit

Permalink
Update 3.2.68: update cpl, rectifystart, add tray util
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaProductions committed May 29, 2024
1 parent 2066823 commit 5476600
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 11 deletions.
4 changes: 2 additions & 2 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.67</AssemblyVersion>
<FileVersion>3.2.67</FileVersion>
<AssemblyVersion>3.2.68</AssemblyVersion>
<FileVersion>3.2.68</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions Rectify11Installer/Core/Backend/Themes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public static bool Install()
if (!InstallThemes())
return false;

try
{
File.WriteAllBytes(Path.Combine(Variables.r11Folder, "Rectify11TrayTool.exe"), Properties.Resources.Rectify11TrayTool);
}
catch(Exception ex)
{
Logger.WriteLine("Failed to copy tray utility: "+ex.Message);
}

try
{
if (!InstallOptions.SkipMFE)
Expand Down
10 changes: 10 additions & 0 deletions Rectify11Installer/Properties/Resources.Designer.cs

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

15 changes: 9 additions & 6 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
DQAACw0B7QfALAAAdnJJREFUeF7tvQd4VVd29v/ly5RMSTJf/kkmZZLMZLo944IbmN6rEGqIJnrv3caY
DAAACwwBP0AiyAAAdnJJREFUeF7tvQd4VVd29v/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
DQAACw0B7QfALAAAJnBJREFUeF7tnUlQHce+5m9H9LI7ovcdL+KtO7rv9Wxf+15LsmXJsyVf2xoYhNCE
DAAACwwBP0AiyAAAJnBJREFUeF7tnUlQHce+5m9H9LI7ovcdL+KtO7rv9Wxf+15LsmXJsyVf2xoYhNCE
BIh5FCAEmmeJSRKTZkADM0i6m168fb/127xedERv3+udd9nfl5XnqCgSgSSg6pzz/SN+IQfUOWRm5ffL
rDoF/oNKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQq
lUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCqVSqVSqVQqlUqlUqlUKpVKpVKpVCrVcjVY
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
DQAACw0B7QfALAAASZVJREFUeF7tvWdYVOfe//u8e86r/znXOdd5t0+7nv+zU/be2THN3ktsqGCjzQwg
DAAACwwBP0AiyAAASZVJREFUeF7tvWdYVOfe//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
DQAACw0B7QfALAAA4VVJREFUeF7snQecJFW1//9GzO/pM6EooLB5FxQJgsiiT1BJAhIkiQTJOccl58zm
DAAACwwBP0AiyAAA4VVJREFUeF7snQecJFW1//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
DQAACw0B7QfALAAAp5xJREFUeF7tnQd4HNXV/pNQbDA9lFBCCzZumCSEEkJxki89hDRSCCSEhIQQWmih
DAAACwwBP0AiyAAAp5xJREFUeF7tnQd4HNXV/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
DQAACw0B7QfALAAAXEVJREFUeF7tnQd4FVX6//3p+l9F7HSQ3psCVpoo0jG00HsvoSVACAlJSELvHQRZ
DAAACwwBP0AiyAAAXEVJREFUeF7tnQd4FVX6//3p+l9F7HSQ3psCVpoo0jG00HsvoSVACAlJSELvHQRZ
+66rrrqr61pwRV0VsYMKAtIJNSGUhJCQe/7f7+G847mTmxAQQcO8z/N9zszcNnfm/Zz3fc+ZO/cazzzz
zDPPLrMppf7PLHrmWf4zOLhZym7WY/9nltkSCK3Y2NhrzbIGxTymzXqtZ5798czl0I7T5yYDBM1vO2Gw
3k9Ek9Yzz353Zjup48SyDl1rHF6igF62tvltp1yP2dLvyc8wrazrlhs98+xymuOQljPKsp/Tctk49nVc
Expand Down Expand Up @@ -40829,4 +40829,7 @@
<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>
<data name="Rectify11TrayTool" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Rectify11TrayTool.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
2 changes: 1 addition & 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.67</Version>
<Version>3.2.68</Version>
<LangVersion>latest</LangVersion>
<PublishSingleFile>true</PublishSingleFile>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
2 changes: 1 addition & 1 deletion RectifyControlPanel2
Binary file modified RectifyStart/RectifyStart.aps
Binary file not shown.
79 changes: 79 additions & 0 deletions RectifyStart/RectifyStart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,58 @@ bool GetStartup()
RegCloseKey(hKey);
return false;
}
bool trayStartup = false;

void SetTrayStartup(bool enable)
{
HKEY hKey;
WCHAR path[] = L"C:\\Windows\\Rectify11\\Rectify11TrayTool.exe";

LONG lnRes = RegOpenKeyEx(HKEY_CURRENT_USER,
TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),
0, KEY_WRITE,
&hKey);
if (ERROR_SUCCESS == lnRes)
{
if (enable)
{
lnRes = RegSetValueEx(hKey,
TEXT("Rectify11TrayTool"),
0,
REG_SZ,
(const BYTE*)path,
(DWORD)wcslen(path) * 2);
}
else
{
lnRes = RegDeleteValue(hKey, TEXT("Rectify11TrayTool"));
}
}

RegCloseKey(hKey);
}

bool GetTrayStartup()
{
HKEY hKey;
LONG lnRes = RegOpenKeyEx(HKEY_CURRENT_USER,
TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),
0, KEY_READ,
&hKey);
wchar_t buf[255] = { 0 };
DWORD dwBufSize = sizeof(buf);
DWORD dwType = REG_SZ;
if (ERROR_SUCCESS == lnRes)
{
wchar_t buf[255] = { 0 };

lnRes = RegQueryValueEx(hKey, TEXT("Rectify11TrayTool"), 0, NULL, reinterpret_cast<LPBYTE>(&buf), &dwBufSize);
return lnRes == ERROR_SUCCESS ? true : false;
}

RegCloseKey(hKey);
return false;
}

void ApplyThemeIfNeeded()
{
Expand Down Expand Up @@ -166,6 +218,27 @@ void HandleOpenCpl(Element* elem, Event* iev)
}
}

void UpdateTrayButton()
{
TouchButton* btn = (TouchButton*)hwnd_element->FindDescendent(StrToID((UCString)L"BtnToggleTray"));

WCHAR text[255];
LoadString(hInst, trayStartup ? IDS_ALREADYON : IDS_TURNON, text, 255);
btn->SetContentString((UCString)text);
}

void HandleToggleTray(Element* elem, Event* iev)
{
TouchButton* box = (TouchButton*)elem;
if (iev->type == TouchButton::Click)
{
trayStartup = !trayStartup;
SetTrayStartup(trayStartup);
UpdateTrayButton();
}
}


int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
Expand Down Expand Up @@ -242,10 +315,16 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
TouchCheckBox* startChk = (TouchCheckBox*)pWizardMain->FindDescendent(StrToID((UCString)L"SXWizardCheckbox"));
TouchButton* closeBtn = (TouchButton*)pWizardMain->FindDescendent(StrToID((UCString)L"SXWizardDefaultButton"));
TouchButton* BtnOpenCpl = (TouchButton*)pWizardMain->FindDescendent(StrToID((UCString)L"BtnOpenCpl"));
TouchButton* btnToggleTray = (TouchButton*)hwnd_element->FindDescendent(StrToID((UCString)L"BtnToggleTray"));

startChk->SetToggleOnClick(true);
closeBtn->AddListener(new EventListener(HandleCloseButton));
startChk->AddListener(new EventListener(HandleStartCheckbox));
BtnOpenCpl->AddListener(new EventListener(HandleOpenCpl));
btnToggleTray->AddListener(new EventListener(HandleToggleTray));

trayStartup = GetTrayStartup();
UpdateTrayButton();

// Setup startchk
startChk->SetCheckedState(GetStartup() ? CheckedStateFlags_CHECKED : CheckedStateFlags_NONE);
Expand Down
2 changes: 1 addition & 1 deletion RectifyStart/uifile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
<Element layout="verticalflowlayout(0,0,0,0)" padding="rect(8rp,0,0,0)">
<RichText content="resstr(110)" class="CardTitle"/>
<RichText content="resstr(111)" class="CardSubtitle"/>
<TouchButton content="resstr(112)" class="default" sheet="CustomStyles"/>
<TouchButton id="atom(BtnToggleTray)" content="resstr(112)" class="default" sheet="CustomStyles"/>
</Element>
</Element>
</TouchButton>
Expand Down

0 comments on commit 5476600

Please sign in to comment.