Skip to content

Commit

Permalink
Disable W^X on Win7
Browse files Browse the repository at this point in the history
  • Loading branch information
Starkku committed Jul 14, 2023
1 parent cdbdbb0 commit 400e732
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ private static void StartProcess(string relativePath, bool run32Bit = false, boo
Environment.Exit(3);
}

OperatingSystem os = Environment.OSVersion;

// Required on Win7 due to W^X causing issues there.
if (os.Platform == PlatformID.Win32NT && os.Version.Major == 6 && os.Version.Minor == 1)
Environment.SetEnvironmentVariable("DOTNET_EnableWriteXorExecute", "0");

This comment has been minimized.

Copy link
@SadPencil

SadPencil Jul 14, 2023

Member

https://stackoverflow.com/a/14582921

perhaps better to specify it in a ProcessStartInfo?


using var _ = Process.Start(new ProcessStartInfo
{
FileName = dotnetHost.FullName,
Expand Down

0 comments on commit 400e732

Please sign in to comment.