Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Sparronator9999 committed Aug 9, 2024
1 parent 6ae96ce commit 1081b17
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 234 deletions.
2 changes: 1 addition & 1 deletion YAMDCC.Config/FanRPMConf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace YAMDCC.Config
{
[Serializable]
public class FanRPMConf
public sealed class FanRPMConf
{
/// <summary>
/// The register to read to get the fan RPM.
Expand Down
2 changes: 1 addition & 1 deletion YAMDCC.Config/KeySwapConf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace YAMDCC.Config
{
public class KeySwapConf
public sealed class KeySwapConf
{
/// <summary>
/// The register that controls the Win/Fn key swap state.
Expand Down
2 changes: 1 addition & 1 deletion YAMDCC.Config/PerfMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace YAMDCC.Config
{
public class PerfMode
public sealed class PerfMode
{
/// <summary>
/// The name of the performance mode.
Expand Down
2 changes: 1 addition & 1 deletion YAMDCC.Config/PerfModeConf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace YAMDCC.Config
{
public class PerfModeConf
public sealed class PerfModeConf
{
/// <summary>
/// The register that controls the performance mode.
Expand Down
10 changes: 5 additions & 5 deletions YAMDCC.ECAccess/Win32/AdvApi32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static extern bool ControlService(
public static extern bool CloseServiceHandle(IntPtr hSCObject);

[StructLayout(LayoutKind.Sequential)]
internal struct ServiceStatus
public struct ServiceStatus
{
internal ServiceType dwServiceType;
internal ServiceState dwCurrentState;
Expand Down Expand Up @@ -252,7 +252,7 @@ public enum ServiceAccess : uint
}

[Flags]
internal enum ServiceType : uint
public enum ServiceType : uint
{
/// <summary>
/// A kernel-mode driver service.
Expand All @@ -278,7 +278,7 @@ internal enum ServiceType : uint
Win32ShareProcess = 0x00000020,
}

internal enum ServiceState : uint
public enum ServiceState : uint
{
Stopped = 1U,
StartPending = 2U,
Expand All @@ -289,7 +289,7 @@ internal enum ServiceState : uint
Paused = 7U,
}

internal enum ServiceStartType : uint
public enum ServiceStartType : uint
{
/// <summary>
/// A device driver started by the system loader.
Expand Down Expand Up @@ -327,7 +327,7 @@ internal enum ServiceStartType : uint
/// <summary>
/// The action to take if a service fails to start.
/// </summary>
internal enum ServiceError : uint
public enum ServiceError : uint
{
/// <summary>
/// The error is ignored and the service continues to
Expand Down
2 changes: 1 addition & 1 deletion YAMDCC.GUI/Dialogs/CrashDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace YAMDCC.GUI.Dialogs
{
public partial class CrashDialog : Form
internal partial class CrashDialog : Form
{
public CrashDialog(Exception ex, bool threadException)
{
Expand Down
2 changes: 1 addition & 1 deletion YAMDCC.GUI/Dialogs/TextInputDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal partial class TextInputDialog : Form
/// </summary>
public string Result;

internal TextInputDialog(string caption, string title = "", string text = "", bool multiline = false)
public TextInputDialog(string caption, string title = "", string text = "", bool multiline = false)
{
InitializeComponent();
lblCaption.Text = caption;
Expand Down
5 changes: 3 additions & 2 deletions YAMDCC.GUI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace YAMDCC.GUI
{
public partial class MainWindow : Form
internal partial class MainWindow : Form
{
#region Fields
/// <summary>
Expand Down Expand Up @@ -360,7 +360,8 @@ private void tsiUninstall_Click(object sender, EventArgs e)
bool delData = MessageBox.Show(
Strings.GetString("dlgSvcDelData", DataPath),
"Delete configuration data?",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes;
MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2) == DialogResult.Yes;

if (delData)
{
Expand Down
6 changes: 3 additions & 3 deletions YAMDCC.GUI/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static class Strings
/// <para>The value of the specified string name, if found.</para>
/// <para><c>null</c> if the string couldn't be found.</para>
/// </returns>
internal static string GetString(string name)
public static string GetString(string name)
{
if (resMan is null)
{
Expand All @@ -63,7 +63,7 @@ internal static string GetString(string name)
/// <para>The formatted string corresponding to the specified string name, if found.</para>
/// <para><c>null</c> if the string couldn't be found.</para>
/// </returns>
internal static string GetString(string name, object arg0)
public static string GetString(string name, object arg0)
{
string temp = GetString(name);
return temp is null
Expand All @@ -75,7 +75,7 @@ internal static string GetString(string name, object arg0)
/// <param name="args">
/// The objects to format the string with.
/// </param>
internal static string GetString(string name, params object[] args)
public static string GetString(string name, params object[] args)
{
string temp = GetString(name);
return temp is null
Expand Down
75 changes: 0 additions & 75 deletions YAMDCC.Service/ProjectInstaller.Designer.cs

This file was deleted.

23 changes: 20 additions & 3 deletions YAMDCC.Service/ProjectInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,33 @@

using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace YAMDCC.Service
{
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
public class ProjectInstaller : Installer
{
public ProjectInstaller()
{
InitializeComponent();
svcInstaller.Description = Strings.GetString("svcDesc");
ServiceInstaller svcInstaller = new ServiceInstaller
{
Description = Strings.GetString("svcDesc"),
DisplayName = "YAMDCC Service",
ServiceName = "yamdccsvc",
StartType = ServiceStartMode.Automatic
};

ServiceProcessInstaller svcPInstaller = new ServiceProcessInstaller
{
Account = ServiceAccount.LocalSystem
};

Installers.AddRange(new Installer[]
{
svcPInstaller,
svcInstaller
});
}
}
}
129 changes: 0 additions & 129 deletions YAMDCC.Service/ProjectInstaller.resx

This file was deleted.

Loading

0 comments on commit 1081b17

Please sign in to comment.