mirror of
https://github.com/FroggMaster/CreamInstaller.git
synced 2026-06-12 19:11:25 -07:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 028dd1586b | |||
| f5d6007404 | |||
| 1c7ffb215d | |||
| 1bd5501869 | |||
| 1db70541f9 | |||
| ae08e990cc | |||
| 12c7c9a9d2 | |||
| 701ca5627d | |||
| c0af3b85bb | |||
| 8577e6df7f | |||
| 961b7153f4 | |||
| e640b8b15d | |||
| bcf3ff84fe | |||
| eb1fee38f3 | |||
| cffc4cce07 | |||
| b7a9505599 | |||
| 094d60b003 | |||
| 09cafa27fb | |||
| e6fa7b4a39 | |||
| 8a24bdad81 | |||
| 21bcfae688 | |||
| 4063e482dd | |||
| bdb1d9ffd2 | |||
| 800cb2b9f6 | |||
| 8b6013e1c0 | |||
| 668f367838 | |||
| 6613b777a7 | |||
| 1036f8a8b4 | |||
| c5a3a98827 | |||
| 4751a3bf76 |
@@ -1,12 +1,10 @@
|
||||
name: Autobuild
|
||||
name: CI Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -30,8 +28,20 @@ jobs:
|
||||
- name: Publish single-file
|
||||
run: dotnet publish CreamInstaller.sln -c Release -r win-x64 -p:PublishSingleFile=true --self-contained true --output ./publish
|
||||
|
||||
- name: Set short commit SHA
|
||||
id: vars
|
||||
run: |
|
||||
$shortSha = $env:GITHUB_SHA.Substring(0,7)
|
||||
Write-Output "shortSha=$shortSha" >> $env:GITHUB_ENV
|
||||
shell: pwsh
|
||||
|
||||
- name: Rename EXE with short commit SHA
|
||||
run: |
|
||||
Rename-Item -Path ./publish/CreamInstaller.exe -NewName "CreamInstaller-CI-$env:shortSha.exe"
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: CreamInstaller-release
|
||||
path: ./publish/CreamInstaller.exe
|
||||
name: CreamInstaller-CI-Release-${{ env.shortSha }}
|
||||
path: ./publish/CreamInstaller-CI-${{ env.shortSha }}.exe
|
||||
@@ -52,12 +52,18 @@ jobs:
|
||||
- name: Publish single-file
|
||||
run: dotnet publish CreamInstaller.sln -c Release -r win-x64 -p:PublishSingleFile=true --self-contained true --output ./publish
|
||||
|
||||
- name: Zip Release
|
||||
run: |
|
||||
Compress-Archive -Path ./publish/* -DestinationPath ./publish/CreamInstaller.zip
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ inputs.version }}
|
||||
name: ${{ inputs.title || format('Release v{0}', inputs.version) }}
|
||||
body: ${{ inputs.notes }}
|
||||
files: ./publish/CreamInstaller.exe
|
||||
files: |
|
||||
./publish/CreamInstaller.exe
|
||||
./publish/CreamInstaller.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -42,6 +42,18 @@ internal class CustomForm : Form
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnHandleCreated(EventArgs e)
|
||||
{
|
||||
base.OnHandleCreated(e);
|
||||
ThemeManager.Apply(this); // apply current theme (initial or toggled)
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
ThemeManager.Apply(this); // ensure late-added controls also themed
|
||||
}
|
||||
|
||||
private void OnHelpButtonClicked(object sender, EventArgs args)
|
||||
{
|
||||
using DialogForm helpDialog = new(this);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<UseWindowsForms>True</UseWindowsForms>
|
||||
<ApplicationIcon>Resources\program.ico</ApplicationIcon>
|
||||
<Version>5.0.1.4</Version>
|
||||
<Copyright>2021, pointfeev (https://github.com/pointfeev)</Copyright>
|
||||
<Version>5.0.1.7</Version>
|
||||
<Copyright>2025, FroggMaster (https://github.com/FroggMaster)</Copyright>
|
||||
<Company>CreamInstaller</Company>
|
||||
<Product>Automatic DLC Unlocker Installer & Configuration Generator</Product>
|
||||
<StartupObject>CreamInstaller.Program</StartupObject>
|
||||
@@ -208,4 +208,4 @@
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace CreamInstaller.Forms
|
||||
//
|
||||
sortCheckBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
sortCheckBox.AutoSize = true;
|
||||
sortCheckBox.Checked = true; // Enable Sort By Name by default
|
||||
sortCheckBox.Location = new System.Drawing.Point(220, 247);
|
||||
sortCheckBox.Margin = new Padding(3, 0, 0, 0);
|
||||
sortCheckBox.Name = "sortCheckBox";
|
||||
|
||||
@@ -14,7 +14,7 @@ internal sealed partial class SelectDialogForm : CustomForm
|
||||
internal SelectDialogForm(IWin32Window owner) : base(owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
selectionTreeView.TreeViewNodeSorter = PlatformIdComparer.NodeName;
|
||||
selectionTreeView.TreeViewNodeSorter = sortCheckBox.Checked ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName;
|
||||
}
|
||||
|
||||
internal DialogResult QueryUser(string groupBoxText,
|
||||
|
||||
+38
-3
@@ -31,6 +31,8 @@ namespace CreamInstaller.Forms
|
||||
useSmokeAPILayoutPanel = new FlowLayoutPanel();
|
||||
useSmokeAPICheckBox = new CheckBox();
|
||||
useSmokeAPIHelpButton = new Button();
|
||||
darkModeFlowPanel = new FlowLayoutPanel();
|
||||
darkModeCheckBox = new CheckBox();
|
||||
allCheckBoxLayoutPanel = new FlowLayoutPanel();
|
||||
allCheckBox = new CheckBox();
|
||||
progressBar = new ProgressBar();
|
||||
@@ -50,6 +52,7 @@ namespace CreamInstaller.Forms
|
||||
proxyFlowPanel.SuspendLayout();
|
||||
blockedGamesFlowPanel.SuspendLayout();
|
||||
useSmokeAPILayoutPanel.SuspendLayout();
|
||||
darkModeFlowPanel.SuspendLayout();
|
||||
allCheckBoxLayoutPanel.SuspendLayout();
|
||||
saveFlowPanel.SuspendLayout();
|
||||
SuspendLayout();
|
||||
@@ -209,6 +212,30 @@ namespace CreamInstaller.Forms
|
||||
useSmokeAPIHelpButton.UseVisualStyleBackColor = true;
|
||||
useSmokeAPIHelpButton.Click += OnUseSmokeAPIHelpButtonClicked;
|
||||
//
|
||||
// darkModeFlowPanel
|
||||
//
|
||||
darkModeFlowPanel.AutoSize = true;
|
||||
darkModeFlowPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
darkModeFlowPanel.Margin = new Padding(12, 0, 0, 0);
|
||||
darkModeFlowPanel.Name = "darkModeFlowPanel";
|
||||
darkModeFlowPanel.Size = new System.Drawing.Size(98, 19);
|
||||
darkModeFlowPanel.TabIndex = 10011;
|
||||
darkModeFlowPanel.WrapContents = false;
|
||||
//
|
||||
// darkModeCheckBox
|
||||
//
|
||||
darkModeCheckBox.AutoSize = true;
|
||||
darkModeCheckBox.Enabled = true;
|
||||
darkModeCheckBox.Location = new System.Drawing.Point(2, 0);
|
||||
darkModeCheckBox.Margin = new Padding(2, 0, 0, 0);
|
||||
darkModeCheckBox.Name = "darkModeCheckBox";
|
||||
darkModeCheckBox.Size = new System.Drawing.Size(96, 19);
|
||||
darkModeCheckBox.TabIndex = 1;
|
||||
darkModeCheckBox.Text = "Enable Dark Mode";
|
||||
darkModeCheckBox.UseVisualStyleBackColor = true;
|
||||
darkModeCheckBox.CheckedChanged += OnDarkModeCheckBoxChanged;
|
||||
darkModeFlowPanel.Controls.Add(darkModeCheckBox);
|
||||
//
|
||||
// allCheckBoxLayoutPanel
|
||||
//
|
||||
allCheckBoxLayoutPanel.AutoSize = true;
|
||||
@@ -319,6 +346,7 @@ namespace CreamInstaller.Forms
|
||||
//
|
||||
sortCheckBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
sortCheckBox.AutoSize = true;
|
||||
sortCheckBox.Checked = true; // Enable Sort By Name by default
|
||||
sortCheckBox.Location = new System.Drawing.Point(84, 380);
|
||||
sortCheckBox.Margin = new Padding(3, 0, 0, 0);
|
||||
sortCheckBox.Name = "sortCheckBox";
|
||||
@@ -391,7 +419,8 @@ namespace CreamInstaller.Forms
|
||||
topOptionsTable.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
topOptionsTable.AutoSize = true;
|
||||
topOptionsTable.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
topOptionsTable.ColumnCount = 5;
|
||||
topOptionsTable.ColumnCount = 6;
|
||||
topOptionsTable.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
|
||||
topOptionsTable.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
|
||||
topOptionsTable.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
|
||||
topOptionsTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); // spacer
|
||||
@@ -404,10 +433,12 @@ namespace CreamInstaller.Forms
|
||||
topOptionsTable.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||
topOptionsTable.Size = new System.Drawing.Size(610, 25);
|
||||
topOptionsTable.TabIndex = 10009;
|
||||
topOptionsTable.Controls.Clear();
|
||||
topOptionsTable.Controls.Add(blockedGamesFlowPanel, 0, 0);
|
||||
topOptionsTable.Controls.Add(useSmokeAPILayoutPanel, 1, 0);
|
||||
topOptionsTable.Controls.Add(proxyFlowPanel, 3, 0);
|
||||
topOptionsTable.Controls.Add(allCheckBoxLayoutPanel, 4, 0);
|
||||
topOptionsTable.Controls.Add(darkModeFlowPanel, 2, 0);
|
||||
topOptionsTable.Controls.Add(proxyFlowPanel, 4, 0);
|
||||
topOptionsTable.Controls.Add(allCheckBoxLayoutPanel, 5, 0);
|
||||
//
|
||||
// SelectForm
|
||||
//
|
||||
@@ -442,6 +473,8 @@ namespace CreamInstaller.Forms
|
||||
blockedGamesFlowPanel.PerformLayout();
|
||||
useSmokeAPILayoutPanel.ResumeLayout(false);
|
||||
useSmokeAPILayoutPanel.PerformLayout();
|
||||
darkModeFlowPanel.ResumeLayout(false);
|
||||
darkModeFlowPanel.PerformLayout();
|
||||
allCheckBoxLayoutPanel.ResumeLayout(false);
|
||||
allCheckBoxLayoutPanel.PerformLayout();
|
||||
saveFlowPanel.ResumeLayout(false);
|
||||
@@ -467,6 +500,7 @@ namespace CreamInstaller.Forms
|
||||
private Button useSmokeAPIHelpButton;
|
||||
private FlowLayoutPanel blockedGamesFlowPanel;
|
||||
private FlowLayoutPanel useSmokeAPILayoutPanel;
|
||||
private FlowLayoutPanel darkModeFlowPanel;
|
||||
private FlowLayoutPanel allCheckBoxLayoutPanel;
|
||||
private Button uninstallButton;
|
||||
private Label progressLabelGames;
|
||||
@@ -479,6 +513,7 @@ namespace CreamInstaller.Forms
|
||||
private Button resetButton;
|
||||
private FlowLayoutPanel saveFlowPanel;
|
||||
private TableLayoutPanel topOptionsTable;
|
||||
private CheckBox darkModeCheckBox;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
private SelectForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
selectionTreeView.TreeViewNodeSorter = PlatformIdComparer.NodeName;
|
||||
selectionTreeView.TreeViewNodeSorter = sortCheckBox.Checked ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName;
|
||||
Text = Program.ApplicationName;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
return;
|
||||
StoreAppData storeAppData = await SteamStore.QueryStoreAPI(appId);
|
||||
_ = Interlocked.Decrement(ref steamGamesToCheck);
|
||||
CmdAppData cmdAppData = await WithTimeout(SteamCMD.GetAppInfo(appId, branch, buildId), 20000);
|
||||
CmdAppData cmdAppData = await WithTimeout(SteamCMD.GetAppInfo(appId, branch, buildId), 16000);
|
||||
if (storeAppData is null && cmdAppData is null)
|
||||
{
|
||||
RemoveFromRemainingGames(name);
|
||||
@@ -251,7 +251,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
}
|
||||
else
|
||||
{
|
||||
CmdAppData dlcCmdAppData = await SteamCMD.GetAppInfo(dlcAppId);
|
||||
CmdAppData dlcCmdAppData = await WithTimeout(SteamCMD.GetAppInfo(dlcAppId), 16000);
|
||||
if (dlcCmdAppData is not null)
|
||||
{
|
||||
dlcName = dlcCmdAppData.Common?.Name;
|
||||
@@ -346,7 +346,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
selection.Icon = IconGrabber.SteamAppImagesPath + @$"\{appId}\{cmdAppData?.Common?.Icon}.jpg";
|
||||
selection.SubIcon = storeAppData?.HeaderImage ?? IconGrabber.SteamAppImagesPath
|
||||
+ @$"\{appId}\{cmdAppData?.Common?.ClientIcon}.ico";
|
||||
selection.Publisher = storeAppData?.Publishers[0] ?? cmdAppData?.Extended?.Publisher;
|
||||
selection.Publisher = storeAppData?.Publishers?.FirstOrDefault() ?? cmdAppData?.Extended?.Publisher;
|
||||
selection.Website = storeAppData?.Website;
|
||||
if (Program.Canceled)
|
||||
return;
|
||||
@@ -1239,4 +1239,24 @@ internal sealed partial class SelectForm : CustomForm
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnDarkModeCheckBoxChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool requestedDark = darkModeCheckBox.Checked;
|
||||
if (Program.DarkModeEnabled != requestedDark)
|
||||
{
|
||||
Program.DarkModeEnabled = requestedDark;
|
||||
ThemeManager.Apply(this);
|
||||
}
|
||||
else
|
||||
ThemeManager.Apply(this);
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
ThemeManager.Apply(this);
|
||||
if (darkModeCheckBox is not null)
|
||||
darkModeCheckBox.Checked = Program.DarkModeEnabled;
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ internal sealed partial class UpdateForm : CustomForm
|
||||
#if DEBUG
|
||||
DebugForm.Current.Attach(form);
|
||||
#endif
|
||||
ThemeManager.Apply(form); // apply current theme when transitioning
|
||||
}
|
||||
|
||||
private async void OnLoad()
|
||||
|
||||
@@ -35,7 +35,7 @@ internal static class Program
|
||||
internal static readonly string CurrentProcessFilePath = CurrentProcess.MainModule?.FileName;
|
||||
internal static readonly int CurrentProcessId = CurrentProcess.Id;
|
||||
|
||||
// this may forever be false, but who knows, maybe acidicoala makes it once again better than CreamAPI some day
|
||||
// Setting is now toggleable. Huzzah!
|
||||
internal static bool UseSmokeAPI = true;
|
||||
|
||||
internal static bool BlockProtectedGames = true;
|
||||
@@ -43,6 +43,9 @@ internal static class Program
|
||||
internal static readonly string[] ProtectedGameDirectories = [@"\EasyAntiCheat", @"\BattlEye"];
|
||||
internal static readonly string[] ProtectedGameDirectoryExceptions = [];
|
||||
|
||||
// Dark mode enabled by default
|
||||
internal static bool DarkModeEnabled = true;
|
||||
|
||||
internal static bool IsGameBlocked(string name, string directory = null)
|
||||
=> BlockProtectedGames && (ProtectedGames.Contains(name) || directory is not null &&
|
||||
!ProtectedGameDirectoryExceptions.Contains(name)
|
||||
@@ -70,6 +73,8 @@ internal static class Program
|
||||
#if DEBUG
|
||||
DebugForm.Current.Attach(form);
|
||||
#endif
|
||||
// Apply initial theme (dark by default)
|
||||
Utility.ThemeManager.Apply(form);
|
||||
Application.Run(form);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -37,6 +37,7 @@ internal static class CreamAPI
|
||||
_ = dlc.Add(extraDlc);
|
||||
|
||||
config.DeleteFile();
|
||||
installForm?.UpdateUser($"Deleted unnecessary configuration: {Path.GetFileName(config)}", LogTextBox.Action, false);
|
||||
config.CreateFile(true, installForm)?.Close();
|
||||
StreamWriter writer = new(config, true, Encoding.Default);
|
||||
WriteConfig(writer, selection.Name, !int.TryParse(selection.Id, out _) ? "0" : selection.Id,
|
||||
@@ -44,9 +45,6 @@ internal static class CreamAPI
|
||||
writer.Flush();
|
||||
writer.Close();
|
||||
return;
|
||||
|
||||
installForm?.UpdateUser($"Deleted unnecessary configuration: {Path.GetFileName(config)}", LogTextBox.Action,
|
||||
false);
|
||||
}
|
||||
|
||||
private static void WriteConfig(StreamWriter writer, string name, string appId,
|
||||
|
||||
@@ -367,7 +367,11 @@ internal static class SmokeAPI
|
||||
"A3873569DECAD08962C46E88352E6DB1", // SmokeAPI v2.0.4
|
||||
"4A1A823E5CF4FB861DD6BA94539D29C4", // SmokeAPI v2.0.5
|
||||
"EC153C0CCE476AFFB2458575930F11E6", // SmokeAPI v3.1.5
|
||||
"E833ACE855245D5939EE36FF25D8B4A4" // SmokeAPI v4.0.0
|
||||
"E833ACE855245D5939EE36FF25D8B4A4", // SmokeAPI v4.0.0
|
||||
"A2728FC65BFF3305F43F87CB6E3AE448", // SmokeAPI v4.1.0
|
||||
"CA6B8DE96022A70C45E11FF6D0B55857", // SmokeAPI v4.1.1
|
||||
"0438477117293DF1EAE1B4D87E8CE084", // SmokeAPI v4.1.2
|
||||
"2B2413E3CCDA93C3821711D089129D34" // SmokeAPI v4.1.3
|
||||
],
|
||||
[ResourceIdentifier.Steamworks64] =
|
||||
[
|
||||
@@ -384,7 +388,11 @@ internal static class SmokeAPI
|
||||
"C0DDB49C9BFD3E05CBC1C61D117E93F9", // SmokeAPI v2.0.4
|
||||
"F7C3064D5E3C892B168F504C21AC4923", // SmokeAPI v2.0.5
|
||||
"5A6712770EC7CE589252706245E62C72", // SmokeAPI v3.1.5
|
||||
"22DD39B16D3C10FDB044FDCB1BAE63B8" // SmokeAPI v4.0.0
|
||||
"22DD39B16D3C10FDB044FDCB1BAE63B8", // SmokeAPI v4.0.0
|
||||
"997656BEB55D1D87918D0BF96BD5312F", // SmokeAPI v4.1.0
|
||||
"CD628177EC5D6303043E35DB6A83AB30", // SmokeAPI v4.1.1
|
||||
"3AC05641AA561C11BE706782B5D3C49D", // SmokeAPI v4.1.2
|
||||
"B87E96F9A52D98A957B252CDAB61CBE8" // SmokeAPI v4.1.3
|
||||
]
|
||||
};
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -21,4 +21,9 @@ internal static partial class NativeImports
|
||||
[LibraryImport("user32.dll", SetLastError = true), DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
internal static partial void SetWindowPos(nint hWnd, nint hWndInsertAfter, int x, int y, int cx, int cy,
|
||||
uint uFlags);
|
||||
|
||||
// Windows theming (scrollbars / dark mode for some controls)
|
||||
[LibraryImport("uxtheme.dll", SetLastError = true)]
|
||||
internal static partial int SetWindowTheme(nint hWnd, [MarshalAs(UnmanagedType.LPWStr)] string pszSubAppName,
|
||||
[MarshalAs(UnmanagedType.LPWStr)] string pszSubIdList);
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CreamInstaller.Utility;
|
||||
|
||||
internal static class ThemeManager
|
||||
{
|
||||
// VS-like dark colors
|
||||
private static readonly Color DarkBack = ColorTranslator.FromHtml("#1E1E1E");
|
||||
private static readonly Color DarkBackAlt = ColorTranslator.FromHtml("#252525");
|
||||
private static readonly Color DarkBorder = ColorTranslator.FromHtml("#3F3F46");
|
||||
private static readonly Color DarkFore = ColorTranslator.FromHtml("#D4D4D4");
|
||||
private static readonly Color DarkForeDim = ColorTranslator.FromHtml("#9CA3AF");
|
||||
private static readonly Color Accent = ColorTranslator.FromHtml("#0E639C");
|
||||
private static readonly Color DarkLink = ColorTranslator.FromHtml("#64B5F6");
|
||||
private static readonly Color LightBack = SystemColors.Control;
|
||||
private static readonly Color LightBackAlt = SystemColors.ControlLightLight;
|
||||
private static readonly Color LightFore = SystemColors.ControlText;
|
||||
private static readonly Color LightBorder = SystemColors.ControlDark;
|
||||
|
||||
internal static void ToggleDarkMode(Form anyForm)
|
||||
{
|
||||
Program.DarkModeEnabled = !Program.DarkModeEnabled;
|
||||
ApplyToAllOpenForms();
|
||||
}
|
||||
|
||||
internal static void Apply(Form form)
|
||||
{
|
||||
if (form is null) return;
|
||||
if (!Program.DarkModeEnabled)
|
||||
{
|
||||
Reset(form);
|
||||
return;
|
||||
}
|
||||
form.SuspendLayout();
|
||||
form.BackColor = DarkBack;
|
||||
form.ForeColor = DarkFore;
|
||||
ApplyTitleBar(form);
|
||||
foreach (Control c in form.Controls)
|
||||
ApplyControlTheme(c, true);
|
||||
form.ResumeLayout(true);
|
||||
}
|
||||
|
||||
private static void ApplyControlTheme(Control control, bool dark)
|
||||
{
|
||||
if (control is null) return;
|
||||
foreach (Control child in control.Controls)
|
||||
ApplyControlTheme(child, dark);
|
||||
if (dark)
|
||||
{
|
||||
switch (control)
|
||||
{
|
||||
case GroupBox gb:
|
||||
gb.ForeColor = DarkFore;
|
||||
gb.BackColor = DarkBackAlt;
|
||||
break;
|
||||
case Button b:
|
||||
b.FlatStyle = FlatStyle.Flat;
|
||||
b.FlatAppearance.BorderColor = DarkBorder;
|
||||
b.BackColor = DarkBackAlt;
|
||||
b.ForeColor = DarkFore;
|
||||
break;
|
||||
case CheckBox cb:
|
||||
cb.BackColor = DarkBack;
|
||||
cb.ForeColor = DarkFore;
|
||||
break;
|
||||
case LinkLabel ll:
|
||||
ll.BackColor = DarkBack;
|
||||
ll.ForeColor = DarkFore; // normal text
|
||||
ll.LinkColor = DarkLink;
|
||||
ll.ActiveLinkColor = Color.White; // high contrast when pressed
|
||||
ll.VisitedLinkColor = DarkLink; // keep consistent
|
||||
break;
|
||||
case Label lbl:
|
||||
lbl.BackColor = DarkBack;
|
||||
lbl.ForeColor = DarkFore;
|
||||
break;
|
||||
case ProgressBar pb:
|
||||
pb.ForeColor = Accent;
|
||||
pb.BackColor = DarkBackAlt;
|
||||
break;
|
||||
case TreeView tv:
|
||||
tv.BackColor = DarkBackAlt;
|
||||
tv.ForeColor = DarkFore;
|
||||
tv.LineColor = DarkBorder;
|
||||
break;
|
||||
case RichTextBox rtb:
|
||||
rtb.BackColor = DarkBackAlt;
|
||||
rtb.ForeColor = DarkFore;
|
||||
break;
|
||||
case TableLayoutPanel tlp:
|
||||
tlp.BackColor = DarkBack;
|
||||
break;
|
||||
case FlowLayoutPanel flp:
|
||||
flp.BackColor = DarkBack;
|
||||
break;
|
||||
}
|
||||
TryApplyScrollbarTheme(control, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Light reset per control type
|
||||
switch (control)
|
||||
{
|
||||
case GroupBox gb:
|
||||
gb.BackColor = LightBack;
|
||||
gb.ForeColor = LightFore;
|
||||
break;
|
||||
case Button b:
|
||||
b.FlatStyle = FlatStyle.Standard;
|
||||
b.BackColor = LightBack;
|
||||
b.ForeColor = LightFore;
|
||||
break;
|
||||
case CheckBox cb:
|
||||
cb.BackColor = LightBack;
|
||||
cb.ForeColor = LightFore;
|
||||
break;
|
||||
case LinkLabel ll:
|
||||
ll.BackColor = LightBack;
|
||||
ll.ForeColor = LightFore;
|
||||
// allow system defaults for link colors
|
||||
ll.LinkColor = SystemColors.HotTrack;
|
||||
ll.ActiveLinkColor = SystemColors.Highlight;
|
||||
ll.VisitedLinkColor = SystemColors.HotTrack;
|
||||
break;
|
||||
case Label lbl:
|
||||
lbl.BackColor = LightBack;
|
||||
lbl.ForeColor = LightFore;
|
||||
break;
|
||||
case ProgressBar pb:
|
||||
pb.BackColor = LightBack;
|
||||
pb.ForeColor = LightFore;
|
||||
break;
|
||||
case TreeView tv:
|
||||
tv.BackColor = LightBack;
|
||||
tv.ForeColor = LightFore;
|
||||
tv.LineColor = LightBorder;
|
||||
break;
|
||||
case RichTextBox rtb:
|
||||
rtb.BackColor = LightBack;
|
||||
rtb.ForeColor = LightFore;
|
||||
break;
|
||||
case TableLayoutPanel tlp:
|
||||
tlp.BackColor = LightBack;
|
||||
break;
|
||||
case FlowLayoutPanel flp:
|
||||
flp.BackColor = LightBack;
|
||||
break;
|
||||
}
|
||||
TryApplyScrollbarTheme(control, false);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Reset(Form form)
|
||||
{
|
||||
form.SuspendLayout();
|
||||
form.BackColor = LightBack;
|
||||
form.ForeColor = LightFore;
|
||||
ApplyTitleBar(form);
|
||||
foreach (Control c in form.Controls)
|
||||
ApplyControlTheme(c, false);
|
||||
form.ResumeLayout(true);
|
||||
}
|
||||
|
||||
private static void ApplyToAllOpenForms()
|
||||
{
|
||||
foreach (Form openForm in Application.OpenForms.Cast<Form>())
|
||||
Apply(openForm);
|
||||
}
|
||||
|
||||
private static void ApplyTitleBar(Form form)
|
||||
{
|
||||
try
|
||||
{
|
||||
int useDark = Program.DarkModeEnabled ?1 :0;
|
||||
NativeMethods.EnableDarkTitleBar(form.Handle, useDark);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private static void TryApplyScrollbarTheme(Control control, bool dark)
|
||||
{
|
||||
// RichTextBox & TreeView host scrollbars internally; use window theme API
|
||||
try
|
||||
{
|
||||
string theme = dark ? "DarkMode_Explorer" : null; // reset with null
|
||||
NativeImports.SetWindowTheme(control.Handle, theme, null);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
internal static class NativeMethods
|
||||
{
|
||||
private const int DWMWA_USE_IMMERSIVE_DARK_MODE =20;
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("dwmapi.dll")]
|
||||
private static extern int DwmSetWindowAttribute(System.IntPtr hwnd, int attr, ref int attrValue, int attrSize);
|
||||
|
||||
internal static void EnableDarkTitleBar(System.IntPtr handle, int useDark)
|
||||
{
|
||||
_ = DwmSetWindowAttribute(handle, DWMWA_USE_IMMERSIVE_DARK_MODE, ref useDark, sizeof(int));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
### [Forked] CreamInstaller: Automatic DLC Unlocker Installer & Configuration Generator
|
||||
### [Revived] CreamInstaller: Automatic DLC Unlocker Installer & Configuration Generator
|
||||
[](https://github.com/FroggMaster/CreamInstaller/releases/latest) [](https://github.com/FroggMaster/CreamInstaller/actions/workflows/ci-builds.yml)
|
||||
|
||||

|
||||

|
||||
|
||||
###### **NOTE:** This is simply a preview image; this is not a list of supported games nor configurations!
|
||||
|
||||
@@ -26,11 +27,18 @@ games and DLCs the user selects; however, through the use of **right-click conte
|
||||
* Automatic DLL installation and configuration generation for CreamAPI, Koaloader, ScreamAPI, Uplay R1 Unlocker and Uplay R2 Unlocker.
|
||||
* Automatic uninstallation of DLLs and configurations for CreamAPI, Koaloader, SmokeAPI, ScreamAPI, Uplay R1 Unlocker and Uplay R2 Unlocker.
|
||||
* Automatic reparation of the Paradox Launcher (and manually via the right-click context menu "Repair" option). *For when the launcher updates whilst you have CreamAPI, SmokeAPI or ScreamAPI installed to it.*
|
||||
---
|
||||
<details>
|
||||
<summary><strong>Continuous Integration (CI) Builds</strong></summary>
|
||||
|
||||
- CreamInstaller is automatically built and tested using GitHub Actions on every push to the **main** branch. You can view all recent CI build runs by clicking the status badge at the top or here: [](https://github.com/FroggMaster/CreamInstaller/actions/workflows/ci-builds.yml)
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
#### Installation:
|
||||
1. Click [here](https://github.com/HvTcCore/CreamInstaller/releases/latest/download/CreamInstaller.zip) to download the latest release from [GitHub](https://github.com/HvtcCore/CreamInstaller).
|
||||
2. Extract the executable from the ZIP file to anywhere on your computer you want. *It's completely self-contained.*
|
||||
1. Click [here](https://github.com/FroggMaster/CreamInstaller/releases/latest/download/CreamInstaller.exe) to download the latest release from [GitHub](https://github.com/FroggMaster/CreamInstaller).
|
||||
2. Move the executable to anywhere on your computer you want. *It's completely self-contained.*
|
||||
|
||||
If the program doesn't seem to launch, try downloading and installing [.NET Desktop Runtime 8.0.7](https://download.visualstudio.microsoft.com/download/pr/bb581716-4cca-466e-9857-512e2371734b/5fe261422a7305171866fd7812d0976f/windowsdesktop-runtime-8.0.7-win-x64.exe) and restarting your computer. Note that the program currently only supports Windows 10+ 64-bit machines as seen [here](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md).
|
||||
|
||||
@@ -52,23 +60,23 @@ If the program doesn't seem to launch, try downloading and installing [.NET Desk
|
||||
#### FAQ / Common Issues:
|
||||
|
||||
**Q:** The program is not launching.
|
||||
**A:** First and foremost, note that the program currently only supports Windows 10+ 64-bit machines as seen [here](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md). If that does not apply to you, then make sure you've extracted the executable from the ZIP file before you've launched it, resolved your anti-virus, and have tried downloading the .NET Desktop Runtime mentioned under [installation instructions](https://github.com/HvTcCore/CreamInstaller#installation) above and restarting your computer. If none of the above work, then I simply cannot do anything about it, I do not control .NET. Either your system is not supported by the current version of .NET, or something is wrong/corrupted with your system.
|
||||
**A:** First and foremost, note that the program currently only supports Windows 10+ 64-bit machines as seen [here](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md). If that does not apply to you, then make sure you've extracted the executable from the ZIP file before you've launched it, resolved your anti-virus, and have tried downloading the .NET Desktop Runtime mentioned under [installation instructions](https://github.com/FroggMaster/CreamInstaller#installation) above and restarting your computer. If none of the above work, then I simply cannot do anything about it, I do not control .NET. Either your system is not supported by the current version of .NET, or something is wrong/corrupted with your system.
|
||||
|
||||
**Q:** The game I installed the unlocker(s) to is not working/the DLCs are not unlocked.
|
||||
**A:** Make sure you've read the note under [Usage](https://github.com/HvTcCore/CreamInstaller#usage) above! Assuming the program functioned as it was supposed to by properly installing DLC unlockers to your chosen games, this is not an issue I can do anything about and it's entirely up to you to seek the appropriate resources to fix it yourself (hint: https://cs.rin.ru/forum/viewforum.php?f=10).
|
||||
**A:** Make sure you've read the note under [Usage](https://github.com/FroggMaster/CreamInstaller#usage) above! Assuming the program functioned as it was supposed to by properly installing DLC unlockers to your chosen games, this is not an issue I can do anything about and it's entirely up to you to seek the appropriate resources to fix it yourself (hint: https://cs.rin.ru/forum/viewforum.php?f=10).
|
||||
|
||||
**Q:** The program and/or files installed by the program are detected as a virus/trojan/malware.
|
||||
**A:** The "issue" of the program's outputted Koaloader DLLs being detected as false positives such as Mamson.A!ac, Phonzy.A!ml, Wacatac.H!ml, Malgent!MSR, Tiggre!rfn, and many many others, has already been posted and explained dozens of times now in many different manners... please do not post it again, you will just be ignored; instead, refer to the explanations within issue #40 and its linked issues: https://github.com/HvTcCore/CreamInstaller/issues/40.
|
||||
**A:** The "issue" of the program's outputted Koaloader DLLs being detected as false positives such as Mamson.A!ac, Phonzy.A!ml, Wacatac.H!ml, Malgent!MSR, Tiggre!rfn, and many many others, has already been posted and explained dozens of times now in many different manners... please do not post it again, you will just be ignored; instead, refer to the explanations within issue #40 and its linked issues: [WebArchived Link: https://github.com/pointfeev/CreamInstaller/issues/40](https://web.archive.org/web/20240604162435/https://github.com/pointfeev/CreamInstaller/issues/40).
|
||||
|
||||
---
|
||||
##### Bugs/Crashes/Issues:
|
||||
For reliable and quick assistance, all bugs, crashes and other issues should be referred to the [GitHub Issues](https://github.com/HvTcCore/CreamInstaller/issues) page!
|
||||
For reliable and quick assistance, all bugs, crashes and other issues should be referred to the [GitHub Issues](https://github.com/FroggMaster/CreamInstaller/issues) page!
|
||||
|
||||
##### **HOWEVER**: Please read the [FAQ entry](https://github.com/HvTcCore/CreamInstaller#faq--common-issues) above and/or [template issue](https://github.com/HvTcCore/CreamInstaller/issues/new/choose) corresponding to your problem should one exist! Also, note that the [GitHub Issues](https://github.com/HvTcCore/CreamInstaller/issues) page is not your personal assistance hotline, rather it is for genuine bugs/crashes/issues with the program itself. If you post an issue which is off-topic or has already been explained within the FAQ, template issues, and/or within this text in general, I will just close it and you will be ignored.
|
||||
##### **HOWEVER**: Please read the [FAQ entry](https://github.com/FroggMaster/CreamInstaller#faq--common-issues) above and/or [template issue](https://github.com/FroggMaster/CreamInstaller/issues/new/choose) corresponding to your problem should one exist! Also, note that the [GitHub Issues](https://github.com/FroggMaster/CreamInstaller/issues) page is not your personal assistance hotline, rather it is for genuine bugs/crashes/issues with the program itself. If you post an issue which is off-topic or has already been explained within the FAQ, template issues, and/or within this text in general, I will just close it and you will be ignored.
|
||||
|
||||
---
|
||||
##### More Information:
|
||||
* SteamCMD installation and appinfo cache can be found at **C:\ProgramData\CreamInstaller**.
|
||||
* The program automatically and very quickly updates from [GitHub](https://github.com/HvTcCore/CreamInstaller) by choice of the user through a dialog on startup.
|
||||
* The program source and other information can be found on [GitHub](https://github.com/HvTcCore/CreamInstaller).
|
||||
* The program automatically and very quickly updates from [GitHub](https://github.com/FroggMaster/CreamInstaller) by choice of the user through a dialog on startup.
|
||||
* The program source and other information can be found on [GitHub](https://github.com/FroggMaster/CreamInstaller).
|
||||
* Credit to [Mattahan](https://www.mattahan.com) for the program icon.
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user