Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e78deed

Browse files
committed
update
1 parent a81f2b4 commit e78deed

File tree

9 files changed

+832
-3
lines changed

9 files changed

+832
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ bld/
3232
[Oo]ut/
3333
[Ll]og/
3434
[Ll]ogs/
35+
dist/
3536

3637
# Visual Studio 2015/2017 cache/options directory
3738
.vs/

CodeDependencies.iss

Lines changed: 718 additions & 0 deletions
Large diffs are not rendered by default.

MainForm.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using TinyDRPC.Utils;
44
using BlueMystic;
55
using Microsoft.Win32;
6+
using System.Windows.Forms;
67

78
namespace TinyDRPC
89
{
@@ -381,6 +382,17 @@ private void MainFormOnResize(object sender, EventArgs e)
381382
{
382383
Hide();
383384
tinyDrpcNotifyIcon.Visible = true;
385+
ConfigurationManager configManager = new ConfigurationManager();
386+
TinyDRPC.Utils.Configuration config = configManager.LoadConfiguration();
387+
if(config.minimizedAtFirst == false)
388+
{
389+
tinyDrpcNotifyIcon.BalloonTipIcon = ToolTipIcon.Info;
390+
tinyDrpcNotifyIcon.BalloonTipText = "TinyDRPC is minimized in the system tray; to open the main window, double-click on this icon; you only see this tip once. Enjoy!";
391+
tinyDrpcNotifyIcon.BalloonTipTitle = "TinyDRPC is now minimized at system tray";
392+
tinyDrpcNotifyIcon.ShowBalloonTip(5000);
393+
config.minimizedAtFirst = true;
394+
configManager.SaveConfiguration(config);
395+
}
384396
}
385397
}
386398

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ Tiny Discord Rich Presence Client, customize your "Playing" status, written in C
3333
- Install it then run it (or you can download portable version).
3434
- Customize setting for your own.
3535

36+
## Development
37+
38+
- Required Visual Studio 2022 and .NET SDK 8.0 installed
39+
40+
## Building
41+
42+
- Make sure you have `iscc.exe` (Inno Setup Compiler), `7z`, and `dotnet` (remember add to PATH if you don't have)
43+
- Run `build.bat`
44+
3645
## Tutorial
3746

3847
### How to custom "Playing \<your wanted name\>"
@@ -72,3 +81,7 @@ Tiny Discord Rich Presence Client, customize your "Playing" status, written in C
7281
## License
7382

7483
[MIT License](LICENSE.txt)
84+
85+
## Authors
86+
87+
[michioxd](https://github.com/michioxd)

TinyDRPC.iss

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define public Dependency_Path_NetCoreCheck "dependencies\"
5+
#include "CodeDependencies.iss"
6+
7+
#define MyAppName "TinyDRPC"
8+
#define MyAppVersion "1.0"
9+
#define MyAppPublisher "michioxd"
10+
#define MyAppURL "https://github.com/michioxd/TinyDRPC"
11+
#define MyAppExeName "TinyDRPC.exe"
12+
13+
[Setup]
14+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
15+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
16+
AppId={{67E6850A-B68C-491D-8895-DD4B5D03139F}
17+
AppName={#MyAppName}
18+
AppVersion={#MyAppVersion}
19+
;AppVerName={#MyAppName} {#MyAppVersion}
20+
AppPublisher={#MyAppPublisher}
21+
AppPublisherURL={#MyAppURL}
22+
AppSupportURL={#MyAppURL}
23+
AppUpdatesURL={#MyAppURL}
24+
DefaultDirName={localappdata}\{#MyAppName}
25+
DisableProgramGroupPage=yes
26+
LicenseFile="LICENSE.txt"
27+
; Remove the following line to run in administrative install mode (install for all users.)
28+
PrivilegesRequired=lowest
29+
PrivilegesRequiredOverridesAllowed=commandline
30+
OutputDir="dist"
31+
OutputBaseFilename=TinyDRPC-setup
32+
Compression=lzma
33+
SolidCompression=yes
34+
WizardStyle=modern
35+
36+
[Languages]
37+
Name: "english"; MessagesFile: "compiler:Default.isl"
38+
39+
[Tasks]
40+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
41+
42+
[Files]
43+
Source: "dist\bin\r2r\*"; DestDir: "{app}"; Flags: ignoreversion
44+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
45+
46+
[Icons]
47+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
48+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
49+
50+
[Run]
51+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
52+
53+
[Code]
54+
function InitializeSetup: Boolean;
55+
begin
56+
#ifdef Dependency_Path_NetCoreCheck
57+
Dependency_AddDotNet80;
58+
Dependency_AddDotNet80Desktop;
59+
#endif
60+
61+
Result := True;
62+
end;

Utils/Configuration.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ public class Configuration
2121
public bool saveRunningState { get; set; }
2222
public bool lastStateIsRunning { get; set; }
2323
public bool runMinimized { get; set; }
24+
public bool minimizedAtFirst { get; set; }
2425
}
2526

2627
public class ConfigurationManager
2728
{
28-
private const string ConfigFileName = "TinyDRPC.inf";
29+
private static readonly string ConfigPathName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TinyDRPC");
30+
private static readonly string ConfigFileName = Path.Combine(ConfigPathName, "TinyDRPC.inf");
2931

3032
public Configuration LoadConfiguration()
3133
{
@@ -55,6 +57,7 @@ public Configuration LoadConfiguration()
5557

5658
public void SaveConfiguration(Configuration config)
5759
{
60+
Directory.CreateDirectory(ConfigPathName);
5861
using (StreamWriter writer = new StreamWriter(ConfigFileName))
5962
{
6063
writer.WriteLine($"topText={config.topText}");
@@ -65,14 +68,15 @@ public void SaveConfiguration(Configuration config)
6568
writer.WriteLine($"button1Url={config.button1Url}");
6669
writer.WriteLine($"button2Url={config.button2Url}");
6770
writer.WriteLine($"largeImageKey={config.largeImageKey}");
68-
writer.WriteLine($"largeImageText={config.largeImageKey}");
71+
writer.WriteLine($"largeImageText={config.largeImageText}");
6972
writer.WriteLine($"smallImageKey={config.smallImageKey}");
7073
writer.WriteLine($"enableButton1={(config.enableButton1 ? "1" : "0")}");
7174
writer.WriteLine($"enableButton2={(config.enableButton2 ? "1" : "0")}");
7275
writer.WriteLine($"runOnStartup={(config.runOnStartup ? "1" : "0")}");
7376
writer.WriteLine($"saveRunningState={(config.saveRunningState ? "1" : "0")}");
7477
writer.WriteLine($"lastStateIsRunning={(config.lastStateIsRunning ? "1" : "0")}");
7578
writer.WriteLine($"runMinimized={(config.runMinimized ? "1" : "0")}");
79+
writer.WriteLine($"minimizedAtFirst={(config.minimizedAtFirst ? "1" : "0")}");
7680
}
7781
}
7882

@@ -128,6 +132,9 @@ private void SetProperty(Configuration config, string key, string value)
128132
case "runMinimized":
129133
config.runMinimized = (value == "1") ? true : false;
130134
break;
135+
case "minimizedAtFirst":
136+
config.minimizedAtFirst = (value == "1") ? true : false;
137+
break;
131138
default:
132139
throw new Exception($"Unknown key: {key}");
133140
}
@@ -152,7 +159,8 @@ private Configuration CreateDefaultConfiguration()
152159
runOnStartup = false,
153160
saveRunningState = true,
154161
lastStateIsRunning = false,
155-
runMinimized = true
162+
runMinimized = true,
163+
minimizedAtFirst = false
156164
};
157165
SaveConfiguration(config);
158166
return config;

build.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
3+
rmdir /s /q ".\dist"
4+
5+
echo Building
6+
dotnet publish -c Release -o ".\dist\bin\nor2r"
7+
8+
echo Creating portable archive using 7zip
9+
7z a ".\dist\TinyDRPC-portable.zip" ".\dist\bin\nor2r\*"
10+
11+
echo Building r2r
12+
dotnet publish -c Release -o ".\dist\bin\r2r" -p:PublishReadyToRun=true
13+
14+
echo Building setup
15+
iscc ".\TinyDRPC.iss"

dependencies/netcorecheck.exe

116 KB
Binary file not shown.

dependencies/netcorecheck_x64.exe

143 KB
Binary file not shown.

0 commit comments

Comments
 (0)