Ship ControlMyMonitor.exe alongside instead of embedding
- Remove embedded resource pattern (dropper behavior triggers AV) - ControlMyMonitor.exe now copied to output directory as content - Removes extraction to temp folder at runtime - Should eliminate Wacatac.H!ml false positive 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
fc3ebe14be
commit
0e530238f6
@ -15,9 +15,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.1.2</Version>
|
<Version>1.1.3</Version>
|
||||||
<AssemblyVersion>1.1.2.0</AssemblyVersion>
|
<AssemblyVersion>1.1.3.0</AssemblyVersion>
|
||||||
<FileVersion>1.1.2.0</FileVersion>
|
<FileVersion>1.1.3.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#define MyAppName "Monitor Control"
|
#define MyAppName "Monitor Control"
|
||||||
#define MyAppVersion "1.1.2"
|
#define MyAppVersion "1.1.3"
|
||||||
#define MyAppPublisher "MarketAlly"
|
#define MyAppPublisher "MarketAlly"
|
||||||
#define MyAppExeName "DellMonitorControl.exe"
|
#define MyAppExeName "DellMonitorControl.exe"
|
||||||
#define MyAppIcon "MonitorIcon.ico"
|
#define MyAppIcon "MonitorIcon.ico"
|
||||||
|
|||||||
@ -25,13 +25,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Resource\ControlMyMonitor.exe" />
|
<Content Include="Resource\ControlMyMonitor.exe">
|
||||||
</ItemGroup>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Link>ControlMyMonitor.exe</Link>
|
||||||
<ItemGroup>
|
</Content>
|
||||||
<EmbeddedResource Include="Resource\ControlMyMonitor.exe">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -10,13 +10,14 @@ namespace CMM.Library.Method;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class CMMCommand
|
public static class CMMCommand
|
||||||
{
|
{
|
||||||
static readonly string CMMTmpFolder = Path.Combine(Path.GetTempPath(), $"CMM");
|
static readonly string CMMTmpFolder = Path.Combine(Path.GetTempPath(), "CMM");
|
||||||
static readonly string CMMexe = Path.Combine(CMMTmpFolder, "ControlMyMonitor.exe");
|
static readonly string CMMexe = Path.Combine(AppContext.BaseDirectory, "ControlMyMonitor.exe");
|
||||||
static readonly string CMMsMonitors = Path.Combine(CMMTmpFolder, "smonitors.tmp");
|
static readonly string CMMsMonitors = Path.Combine(CMMTmpFolder, "smonitors.tmp");
|
||||||
|
|
||||||
public static async Task ScanMonitor()
|
public static async Task ScanMonitor()
|
||||||
{
|
{
|
||||||
await BytesToFileAsync(new(CMMexe));
|
// Ensure temp folder exists for output files
|
||||||
|
Directory.CreateDirectory(CMMTmpFolder);
|
||||||
await ConsoleHelper.ExecuteExeAsync(CMMexe, $"/smonitors {CMMsMonitors}");
|
await ConsoleHelper.ExecuteExeAsync(CMMexe, $"/smonitors {CMMsMonitors}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,22 +280,4 @@ public static class CMMCommand
|
|||||||
return monitors;
|
return monitors;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BytesToFile(FileInfo fi)
|
|
||||||
{
|
|
||||||
fi.Refresh();
|
|
||||||
if (fi.Exists) return;
|
|
||||||
if (!fi.Directory.Exists) fi.Directory.Create();
|
|
||||||
|
|
||||||
File.WriteAllBytes(fi.FullName, fi.Name.ResourceToByteArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
static async Task BytesToFileAsync(FileInfo fi)
|
|
||||||
{
|
|
||||||
fi.Refresh();
|
|
||||||
if (fi.Exists) return;
|
|
||||||
if (!fi.Directory.Exists) fi.Directory.Create();
|
|
||||||
|
|
||||||
await File.WriteAllBytesAsync(fi.FullName, fi.Name.ResourceToByteArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user