From 8819ffe355cbd847785b5ac960c2ba6f2340cfcb Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Fri, 27 Feb 2026 15:29:26 +0700 Subject: [PATCH] Revert "feat: update actions" This reverts commit cdce3a6b1a1f07c8da2f78f23f4f856f145c93bb. --- .github/workflows/release.yml | 10 ++++++---- TimeMocker.Hook/InjectionEntryPoint.cs | 12 +++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb44bac..7538907 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,17 +10,19 @@ permissions: jobs: build-and-release: - runs-on: windows-2019 + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v6 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.x - name: Build Solution - run: msbuild TimeMocker.sln -p:Configuration=Release -p:Platform=x64 -m + run: dotnet build TimeMocker.sln -c Release -p:Platform=x64 - name: Prepare Release Artifacts run: | diff --git a/TimeMocker.Hook/InjectionEntryPoint.cs b/TimeMocker.Hook/InjectionEntryPoint.cs index 92a66dd..613f796 100644 --- a/TimeMocker.Hook/InjectionEntryPoint.cs +++ b/TimeMocker.Hook/InjectionEntryPoint.cs @@ -65,29 +65,23 @@ namespace TimeMocker.Hook public void Run(RemoteHooking.IContext context, string mmfName) { - string logPath = Path.Combine(Path.GetTempPath(), "TimeMocker.Hook.log"); - try { - File.AppendAllText(logPath, $"[{DateTime.Now}] Starting hook, MMF: {mmfName}\r\n"); - // Open the shared memory created by the UI process _mmf = System.IO.MemoryMappedFiles.MemoryMappedFile.OpenExisting(mmfName); _view = _mmf.CreateViewAccessor(0, Marshal.SizeOf()); - File.AppendAllText(logPath, $"[{DateTime.Now}] MMF opened successfully\r\n"); InstallHooks(); - File.AppendAllText(logPath, $"[{DateTime.Now}] Hooks installed successfully\r\n"); - RemoteHooking.WakeUpProcess(); - File.AppendAllText(logPath, $"[{DateTime.Now}] Process woken up\r\n"); // Keep alive until process exits while (true) Thread.Sleep(500); } catch (Exception ex) { - File.AppendAllText(logPath, $"[{DateTime.Now}] ERROR: {ex.GetType().Name}: {ex.Message}\r\n{ex.StackTrace}\r\n"); + File.AppendAllText( + Path.Combine(Path.GetTempPath(), "TimeMocker.Hook.log"), + $"[{DateTime.Now}] ERROR: {ex}\r\n"); } finally {