Skip to content

Commit 1081b17

Browse files
Small changes
- Make "No" the default option when asking to delete YAMDCC's ProgramData directory - Convert ProjectInstaller into a non-Component Designer source file - Change some permission modifiers to be consistent with the rest of the project
1 parent 6ae96ce commit 1081b17

File tree

15 files changed

+41
-234
lines changed

15 files changed

+41
-234
lines changed

YAMDCC.Config/FanRPMConf.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace YAMDCC.Config
2121
{
2222
[Serializable]
23-
public class FanRPMConf
23+
public sealed class FanRPMConf
2424
{
2525
/// <summary>
2626
/// The register to read to get the fan RPM.

YAMDCC.Config/KeySwapConf.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace YAMDCC.Config
44
{
5-
public class KeySwapConf
5+
public sealed class KeySwapConf
66
{
77
/// <summary>
88
/// The register that controls the Win/Fn key swap state.

YAMDCC.Config/PerfMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace YAMDCC.Config
44
{
5-
public class PerfMode
5+
public sealed class PerfMode
66
{
77
/// <summary>
88
/// The name of the performance mode.

YAMDCC.Config/PerfModeConf.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace YAMDCC.Config
44
{
5-
public class PerfModeConf
5+
public sealed class PerfModeConf
66
{
77
/// <summary>
88
/// The register that controls the performance mode.

YAMDCC.ECAccess/Win32/AdvApi32.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public static extern bool ControlService(
196196
public static extern bool CloseServiceHandle(IntPtr hSCObject);
197197

198198
[StructLayout(LayoutKind.Sequential)]
199-
internal struct ServiceStatus
199+
public struct ServiceStatus
200200
{
201201
internal ServiceType dwServiceType;
202202
internal ServiceState dwCurrentState;
@@ -252,7 +252,7 @@ public enum ServiceAccess : uint
252252
}
253253

254254
[Flags]
255-
internal enum ServiceType : uint
255+
public enum ServiceType : uint
256256
{
257257
/// <summary>
258258
/// A kernel-mode driver service.
@@ -278,7 +278,7 @@ internal enum ServiceType : uint
278278
Win32ShareProcess = 0x00000020,
279279
}
280280

281-
internal enum ServiceState : uint
281+
public enum ServiceState : uint
282282
{
283283
Stopped = 1U,
284284
StartPending = 2U,
@@ -289,7 +289,7 @@ internal enum ServiceState : uint
289289
Paused = 7U,
290290
}
291291

292-
internal enum ServiceStartType : uint
292+
public enum ServiceStartType : uint
293293
{
294294
/// <summary>
295295
/// A device driver started by the system loader.
@@ -327,7 +327,7 @@ internal enum ServiceStartType : uint
327327
/// <summary>
328328
/// The action to take if a service fails to start.
329329
/// </summary>
330-
internal enum ServiceError : uint
330+
public enum ServiceError : uint
331331
{
332332
/// <summary>
333333
/// The error is ignored and the service continues to

YAMDCC.GUI/Dialogs/CrashDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace YAMDCC.GUI.Dialogs
77
{
8-
public partial class CrashDialog : Form
8+
internal partial class CrashDialog : Form
99
{
1010
public CrashDialog(Exception ex, bool threadException)
1111
{

YAMDCC.GUI/Dialogs/TextInputDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal partial class TextInputDialog : Form
2525
/// </summary>
2626
public string Result;
2727

28-
internal TextInputDialog(string caption, string title = "", string text = "", bool multiline = false)
28+
public TextInputDialog(string caption, string title = "", string text = "", bool multiline = false)
2929
{
3030
InitializeComponent();
3131
lblCaption.Text = caption;

YAMDCC.GUI/MainWindow.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
namespace YAMDCC.GUI
3030
{
31-
public partial class MainWindow : Form
31+
internal partial class MainWindow : Form
3232
{
3333
#region Fields
3434
/// <summary>
@@ -360,7 +360,8 @@ private void tsiUninstall_Click(object sender, EventArgs e)
360360
bool delData = MessageBox.Show(
361361
Strings.GetString("dlgSvcDelData", DataPath),
362362
"Delete configuration data?",
363-
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes;
363+
MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
364+
MessageBoxDefaultButton.Button2) == DialogResult.Yes;
364365

365366
if (delData)
366367
{

YAMDCC.GUI/Strings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal static class Strings
4040
/// <para>The value of the specified string name, if found.</para>
4141
/// <para><c>null</c> if the string couldn't be found.</para>
4242
/// </returns>
43-
internal static string GetString(string name)
43+
public static string GetString(string name)
4444
{
4545
if (resMan is null)
4646
{
@@ -63,7 +63,7 @@ internal static string GetString(string name)
6363
/// <para>The formatted string corresponding to the specified string name, if found.</para>
6464
/// <para><c>null</c> if the string couldn't be found.</para>
6565
/// </returns>
66-
internal static string GetString(string name, object arg0)
66+
public static string GetString(string name, object arg0)
6767
{
6868
string temp = GetString(name);
6969
return temp is null
@@ -75,7 +75,7 @@ internal static string GetString(string name, object arg0)
7575
/// <param name="args">
7676
/// The objects to format the string with.
7777
/// </param>
78-
internal static string GetString(string name, params object[] args)
78+
public static string GetString(string name, params object[] args)
7979
{
8080
string temp = GetString(name);
8181
return temp is null

YAMDCC.Service/ProjectInstaller.Designer.cs

Lines changed: 0 additions & 75 deletions
This file was deleted.

YAMDCC.Service/ProjectInstaller.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,33 @@
1616

1717
using System.ComponentModel;
1818
using System.Configuration.Install;
19+
using System.ServiceProcess;
1920

2021
namespace YAMDCC.Service
2122
{
2223
[RunInstaller(true)]
23-
public partial class ProjectInstaller : Installer
24+
public class ProjectInstaller : Installer
2425
{
2526
public ProjectInstaller()
2627
{
27-
InitializeComponent();
28-
svcInstaller.Description = Strings.GetString("svcDesc");
28+
ServiceInstaller svcInstaller = new ServiceInstaller
29+
{
30+
Description = Strings.GetString("svcDesc"),
31+
DisplayName = "YAMDCC Service",
32+
ServiceName = "yamdccsvc",
33+
StartType = ServiceStartMode.Automatic
34+
};
35+
36+
ServiceProcessInstaller svcPInstaller = new ServiceProcessInstaller
37+
{
38+
Account = ServiceAccount.LocalSystem
39+
};
40+
41+
Installers.AddRange(new Installer[]
42+
{
43+
svcPInstaller,
44+
svcInstaller
45+
});
2946
}
3047
}
3148
}

YAMDCC.Service/ProjectInstaller.resx

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)