diff --git a/.gitattributes b/.gitattributes index 0f36a4ceb6..949fc96771 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,8 +8,3 @@ # Custom for Visual Studio *.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md index 35fe85dc0e..ba85c8e5cf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,6 +9,7 @@ Windows Compiling OpenRA requires the following dependencies: * [Windows PowerShell >= 4.0](http://microsoft.com/powershell) (included by default in recent Windows 10 versions) * [.NET Framework 4.6.1 (Developer Pack)](https://dotnet.microsoft.com/download/dotnet-framework/net461) (or via Visual Studio 2017) +* [.NET Core 2.2 SDK](https://dotnet.microsoft.com/download/dotnet-core/2.2) (or via Visual Studio 2017) Type `make dependencies` in a command terminal to download pre-compiled native libraries for: * [SDL 2](http://www.libsdl.org/download-2.0.php) diff --git a/Makefile b/Makefile index 4522ffe59b..55887761d8 100644 --- a/Makefile +++ b/Makefile @@ -33,18 +33,11 @@ # to start the game, run: # openra - - ############################## TOOLCHAIN ############################### # -CSC = csc -CSFLAGS = -nologo -warn:4 -langversion:5 -unsafe -warnaserror -DEFINE = TRACE -COMMON_LIBS = System.dll System.Core.dll System.Numerics.dll thirdparty/download/ICSharpCode.SharpZipLib.dll thirdparty/download/FuzzyLogicLibrary.dll thirdparty/download/MaxMind.Db.dll thirdparty/download/Eluant.dll thirdparty/download/rix0rrr.BeaconLib.dll - # List of .NET assemblies that we can guarantee exist # OpenRA.Game.dll is a harmless false positive that we can ignore -WHITELISTED_OPENRA_ASSEMBLIES = $(game_TARGET) $(utility_TARGET) $(pdefault_TARGET) $(mod_common_TARGET) $(mod_cnc_TARGET) $(mod_d2k_TARGET) OpenRA.Game.dll +WHITELISTED_OPENRA_ASSEMBLIES = OpenRA.Game.exe OpenRA.Utility.exe OpenRA.Platforms.Default.dll OpenRA.Mods.Common.dll OpenRA.Mods.Cnc.dll OpenRA.Mods.D2k.dll OpenRA.Game.dll # These are explicitly shipped alongside our core files by the packaging script WHITELISTED_THIRDPARTY_ASSEMBLIES = ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll MaxMind.Db.dll Eluant.dll rix0rrr.BeaconLib.dll Open.Nat.dll SDL2-CS.dll OpenAL-CS.dll @@ -56,16 +49,6 @@ WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll S NUNIT_LIBS_PATH := NUNIT_LIBS := $(NUNIT_LIBS_PATH)nunit.framework.dll -DEBUG = false -ifeq ($(DEBUG), $(filter $(DEBUG),false no n off 0)) -CSFLAGS += -debug:pdbonly -optimize+ -else -CSFLAGS += -debug:full -optimize- -DEFINE := DEBUG;$(DEFINE) -endif - - - ######################### UTILITIES/SETTINGS ########################### # # install locations @@ -92,6 +75,9 @@ INSTALL_DIR = $(INSTALL) -d INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 +# Toolchain +MSBUILD = msbuild -verbosity:m -nologo + # program targets CORE = pdefault game utility server VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -104,77 +90,13 @@ else os-dependencies = linux-dependencies endif - - -######################## PROGRAM TARGET RULES ########################## -# -# Core binaries - -game_SRCS := $(shell find OpenRA.Game/ -iname '*.cs') -game_TARGET = OpenRA.Game.exe -game_KIND = winexe -game_LIBS = $(COMMON_LIBS) $(game_DEPS) thirdparty/download/Open.Nat.dll -PROGRAMS += game -game: $(game_TARGET) - -# Platform dlls -pdefault_SRCS := $(shell find OpenRA.Platforms.Default/ -iname '*.cs') -pdefault_TARGET = OpenRA.Platforms.Default.dll -pdefault_KIND = library -pdefault_DEPS = $(game_TARGET) -pdefault_LIBS = $(COMMON_LIBS) thirdparty/download/SDL2-CS.dll thirdparty/download/OpenAL-CS.dll $(pdefault_DEPS) -PROGRAMS += pdefault -platforms: $(pdefault_TARGET) - -# Mods Common -mod_common_SRCS := $(shell find OpenRA.Mods.Common/ -iname '*.cs') -mod_common_TARGET = mods/common/OpenRA.Mods.Common.dll -mod_common_KIND = library -mod_common_DEPS = $(game_TARGET) -mod_common_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) -PROGRAMS += mod_common -mod_common: $(mod_common_TARGET) - -# NUnit testing -test_dll_SRCS := $(shell find OpenRA.Test/ -iname '*.cs') -test_dll_TARGET = OpenRA.Test.dll -test_dll_KIND = library -test_dll_DEPS = $(game_TARGET) $(mod_common_TARGET) -test_dll_FLAGS = -warn:1 -test_dll_LIBS = $(COMMON_LIBS) $(game_TARGET) $(mod_common_TARGET) $(NUNIT_LIBS) -PROGRAMS += test_dll -test_dll: $(test_dll_TARGET) - -##### Official Mods ##### - -STD_MOD_LIBS = $(game_TARGET) -STD_MOD_DEPS = $(STD_MOD_LIBS) - -# Command and Conquer -mod_cnc_SRCS := $(shell find OpenRA.Mods.Cnc/ -iname '*.cs') -mod_cnc_TARGET = mods/common/OpenRA.Mods.Cnc.dll -mod_cnc_KIND = library -mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) -mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) -PROGRAMS += mod_cnc -mod_cnc: $(mod_cnc_TARGET) - -# Dune 2000 -mod_d2k_SRCS := $(shell find OpenRA.Mods.D2k/ -iname '*.cs') -mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll -mod_d2k_KIND = library -mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_common_TARGET) -mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET) -PROGRAMS += mod_d2k -mod_d2k: $(mod_d2k_TARGET) - check-scripts: @echo @echo "Checking for Lua syntax errors..." @luac -p $(shell find mods/*/maps/* -iname '*.lua') @luac -p $(shell find lua/* -iname '*.lua') -check: utility stylecheck mods +check: core @echo @echo "Checking runtime assemblies..." @mono --debug OpenRA.Utility.exe all --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES) @@ -208,7 +130,7 @@ check: utility stylecheck mods NUNIT_CONSOLE := $(shell test -f thirdparty/download/nunit3-console.exe && echo mono thirdparty/download/nunit3-console.exe || \ which nunit3-console 2>/dev/null || which nunit2-console 2>/dev/null || which nunit-console 2>/dev/null) -nunit: test_dll +nunit: core @echo @echo "Checking unit tests..." @if [ "$(NUNIT_CONSOLE)" = "" ] ; then \ @@ -225,7 +147,7 @@ nunit: test_dll fi @$(NUNIT_CONSOLE) --noresult OpenRA.Test.nunit -test: utility mods +test: core @echo @echo "Testing Tiberian Sun mod MiniYAML..." @mono --debug OpenRA.Utility.exe ts --check-yaml @@ -239,72 +161,18 @@ test: utility mods @echo "Testing Red Alert mod MiniYAML..." @mono --debug OpenRA.Utility.exe ra --check-yaml - -##### Launchers / Utilities ##### - -utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs') -utility_TARGET = OpenRA.Utility.exe -utility_KIND = exe -utility_DEPS = $(game_TARGET) -utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/download/ICSharpCode.SharpZipLib.dll -PROGRAMS += utility -utility: $(utility_TARGET) - -stylecheck_SRCS := $(shell find OpenRA.StyleCheck/ -iname '*.cs') -stylecheck_TARGET = OpenRA.StyleCheck.exe -stylecheck_KIND = exe -stylecheck_LIBS = thirdparty/download/StyleCop.dll thirdparty/download/StyleCop.CSharp.dll thirdparty/download/StyleCop.CSharp.Rules.dll -PROGRAMS += stylecheck -stylecheck: $(stylecheck_TARGET) - -# Dedicated server -server_SRCS := $(shell find OpenRA.Server/ -iname '*.cs') -server_TARGET = OpenRA.Server.exe -server_KIND = exe -server_DEPS = $(game_TARGET) -server_LIBS = $(COMMON_LIBS) $(server_DEPS) -PROGRAMS += server -server: $(server_TARGET) - -# Patches binary headers to work around a mono bug -fixheader.exe: packaging/fixheader.cs - @command -v $(CSC) >/dev/null || (echo "Mono is not installed. Please install Mono from http://www.mono-project.com/download/ before building OpenRA."; exit 1) - @echo CSC fixheader.exe - @$(CSC) packaging/fixheader.cs $(CSFLAGS) -out:fixheader.exe -t:exe $(COMMON_LIBS:%=-r:%) - -# Generate build rules for each target defined above in PROGRAMS -define BUILD_ASSEMBLY - -$$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS) fixheader.exe - @echo CSC $$(@) - @$(CSC) $$($(1)_LIBS:%=-r:%) \ - -out:$$(@) $(CSFLAGS) $$($(1)_FLAGS) \ - -define:"$(DEFINE)" \ - -t:"$$($(1)_KIND)" \ - $$($(1)_EXTRA) \ - $$($(1)_SRCS) - @mono fixheader.exe $$(@) > /dev/null - @test `echo $$(@) | sed 's/^.*\.//'` = "dll" && chmod a-x $$(@) || `` - @$$($(1)_EXTRA_CMDS) -endef - -$(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog)))) - - - ########################## MAKE/INSTALL RULES ########################## # -default: dependencies core +all: dependencies core -core: game platforms mods utility server - -mods: mod_common mod_cnc mod_d2k - -all: dependencies core stylecheck +core: + @command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) + @$(MSBUILD) -t:build -p:Configuration=Release clean: - @-$(RM_F) $(shell find . -maxdepth 1 -iname '*.dll.config' -a ! -iname 'OpenRA.Platforms.Default.dll.config') - @-$(RM_F) *.exe *.dll *.dylib ./OpenRA*/*.dll ./OpenRA*/*.mdb *.mdb mods/**/*.dll mods/**/*.mdb *.resources + @ $(MSBUILD) -t:clean + @-$(RM_F) *.config + @-$(RM_F) *.exe *.dll *.dylib ./OpenRA*/*.dll *.pdb mods/**/*.dll mods/**/*.pdb *.resources @-$(RM_RF) ./*/bin ./*/obj @-$(RM_RF) ./thirdparty/download @@ -314,6 +182,7 @@ cli-dependencies: @./thirdparty/fetch-thirdparty-deps.sh @ $(CP_R) thirdparty/download/*.dll . @ $(CP_R) thirdparty/download/*.dll.config . + @ test -f OpenRA.Game/obj/project.assets.json || $(MSBUILD) -t:restore linux-dependencies: cli-dependencies geoip-dependencies linux-native-dependencies @@ -347,16 +216,19 @@ version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mo man-page: utility mods @mono --debug OpenRA.Utility.exe all --man-page > openra.6 -install: default install-core +install: dependencies core install-core install-linux-shortcuts: install-linux-scripts install-linux-icons install-linux-desktop install-engine: @-echo "Installing OpenRA engine to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)" - @$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)" - @$(CP) OpenRA.Platforms.Default.dll.config "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) OpenRA.Game.exe "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) OpenRA.Server.exe "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) OpenRA.Utility.exe "$(DATA_INSTALL_DIR)" + @$(INSTALL_PROGRAM) OpenRA.Platforms.Default.dll "$(DATA_INSTALL_DIR)" + @$(INSTALL_DATA) OpenRA.Platforms.Default.dll.config "$(DATA_INSTALL_DIR)" @$(INSTALL_DATA) "GeoLite2-Country.mmdb.gz" "$(DATA_INSTALL_DIR)/GeoLite2-Country.mmdb.gz" @$(INSTALL_DATA) VERSION "$(DATA_INSTALL_DIR)/VERSION" @$(INSTALL_DATA) AUTHORS "$(DATA_INSTALL_DIR)/AUTHORS" @@ -369,7 +241,6 @@ install-engine: @$(CP) Eluant* "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) ICSharpCode.SharpZipLib.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) FuzzyLogicLibrary.dll "$(DATA_INSTALL_DIR)" - @$(CP) OpenRA.Platforms.Default.dll.config "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) Open.Nat.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) MaxMind.Db.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) rix0rrr.BeaconLib.dll "$(DATA_INSTALL_DIR)" @@ -378,8 +249,8 @@ install-common-mod-files: @-echo "Installing OpenRA common mod files to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)/mods" @$(CP_R) mods/common "$(DATA_INSTALL_DIR)/mods/" - @$(INSTALL_PROGRAM) $(mod_common_TARGET) "$(DATA_INSTALL_DIR)/mods/common" - @$(INSTALL_PROGRAM) $(mod_cnc_TARGET) "$(DATA_INSTALL_DIR)/mods/common" + @$(INSTALL_PROGRAM) mods/common/OpenRA.Mods.Common.dll "$(DATA_INSTALL_DIR)/mods/common" + @$(INSTALL_PROGRAM) mods/common/OpenRA.Mods.Cnc.dll "$(DATA_INSTALL_DIR)/mods/common" @$(INSTALL_DATA) "global mix database.dat" "$(DATA_INSTALL_DIR)/global mix database.dat" install-default-mods: @@ -388,7 +259,7 @@ install-default-mods: @$(CP_R) mods/cnc "$(DATA_INSTALL_DIR)/mods/" @$(CP_R) mods/ra "$(DATA_INSTALL_DIR)/mods/" @$(CP_R) mods/d2k "$(DATA_INSTALL_DIR)/mods/" - @$(INSTALL_PROGRAM) $(mod_d2k_TARGET) "$(DATA_INSTALL_DIR)/mods/d2k" + @$(INSTALL_PROGRAM) mods/d2k/OpenRA.Mods.D2k.dll "$(DATA_INSTALL_DIR)/mods/d2k" @$(CP_R) mods/modcontent "$(DATA_INSTALL_DIR)/mods/" install-core: install-engine install-common-mod-files install-default-mods @@ -518,13 +389,10 @@ help: @echo 'to start the game, run:' @echo ' openra' - - - ########################### MAKEFILE SETTINGS ########################## # -.DEFAULT_GOAL := default +.DEFAULT_GOAL := all .SUFFIXES: -.PHONY: core package all mods clean distclean dependencies version $(PROGRAMS) nunit +.PHONY: core package all mods clean distclean dependencies version nunit diff --git a/OpenRA.Game.exe.config b/OpenRA.Game/App.config similarity index 100% rename from OpenRA.Game.exe.config rename to OpenRA.Game/App.config diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 8a6d60b24e..551e8d5be6 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -1,61 +1,24 @@ - - + - Debug - x86 - 9.0.30729 - 2.0 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - WinExe - Properties - OpenRA - OpenRA.Game - - - 3.5 - - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - v4.5 - true - - - true - full - .. - TRACE;DEBUG + Exe + net461 true - x86 - false - Game.Mod=ra - Game.Mod=ra - 5 - - - true - .. - TRACE - true - pdbonly - x86 - false true - Game.Mod=ra - Game.Mod=ra + false + 5 + true + true + false + OpenRA + .. + false + x86 + x86 + false + + + DEBUG;TRACE + false Project @@ -74,8 +37,6 @@ Game.Mod=ts - - ..\thirdparty\download\Open.Nat.dll @@ -91,247 +52,13 @@ ..\thirdparty\download\MaxMind.Db.dll False - + + false + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - + + + + \ No newline at end of file diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj index 70b8c99318..41ed27d1c7 100644 --- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj +++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj @@ -1,210 +1,32 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {2881135D-4D62-493E-8F83-5EEE92CCC6BE} - Library - Properties - OpenRA.Mods.Cnc - OpenRA.Mods.Cnc - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.5 - - - true - full - DEBUG;TRACE - x86 - prompt - bin\Debug\ + net461 true - 5 - - - true - bin\Release\ - TRACE - true - pdbonly - x86 - prompt true + 5 + true + true + ../mods/common + false + x86 + x86 + + + DEBUG;TRACE + false - - ..\thirdparty\download\Eluant.dll False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game False - {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6} - OpenRA.Mods.Common False - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - + \ No newline at end of file diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 954d6614cd..0dc0fd1bb9 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -1,39 +1,19 @@ - - - + - Debug - AnyCPU - {FE6C8CC0-2F07-442A-B29F-17617B3B7FC6} - Library - Properties - OpenRA.Mods.Common - OpenRA.Mods.Common - v4.5 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x86 + net461 true - 5 - - - true - bin\Release\ - TRACE - true - pdbonly - x86 - prompt true + 5 + true + true + ../mods/common + false + x86 + x86 + + + DEBUG;TRACE + false @@ -44,8 +24,6 @@ ..\thirdparty\download\rix0rrr.BeaconLib.dll False - - ..\thirdparty\download\Eluant.dll False @@ -57,943 +35,7 @@ - {0dfb103f-2962-400f-8c6d-e2c28ccba633} - OpenRA.Game False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj index 3c6767fa4e..323ae22777 100644 --- a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj @@ -1,133 +1,32 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {C0B0465C-6BE2-409C-8770-3A9BF64C4344} - Library - Properties - OpenRA.Mods.D2k - OpenRA.Mods.D2k - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.5 - - - true - full - DEBUG;TRACE - x86 - prompt - bin\Debug\ - TRACE;DEBUG; + net461 true - 5 - - - true - bin\Release\ - TRACE - true - pdbonly - x86 - prompt true + 5 + true + true + ../mods/d2k + false + x86 + x86 + + + DEBUG;TRACE + false - - ..\thirdparty\download\Eluant.dll False - - - - - - - - - - - - - - - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game False - {fe6c8cc0-2f07-442a-b29f-17617b3b7fc6} - OpenRA.Mods.Common False - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - + \ No newline at end of file diff --git a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj index 5d5f046c1b..514bc4e3d2 100644 --- a/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj +++ b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.csproj @@ -1,38 +1,21 @@ - - + - Debug - AnyCPU - 10.0.0 - 2.0 - {33D03738-C154-4028-8EA8-63A3C488A651} - Library - OpenRA.Platforms.Default - OpenRA.Platforms.Default - v4.5 + net461 + true + true + 5 + true + true + .. + false + x86 + x86 - - true - full - ..\ - TRACE;DEBUG - x86 - prompt - true - 5 - - - true - ..\ - TRACE - true - pdbonly - x86 - prompt - true + + DEBUG;TRACE + false - ..\thirdparty\download\Eluant.dll @@ -44,29 +27,11 @@ - - - - - - - - - - - - - - - - + - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - False - + + PreserveNewest + \ No newline at end of file diff --git a/OpenRA.Platforms.Default.dll.config b/OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config similarity index 100% rename from OpenRA.Platforms.Default.dll.config rename to OpenRA.Platforms.Default/OpenRA.Platforms.Default.dll.config diff --git a/OpenRA.PostProcess/OpenRA.PostProcess.csproj b/OpenRA.PostProcess/OpenRA.PostProcess.csproj new file mode 100644 index 0000000000..2c96fc6344 --- /dev/null +++ b/OpenRA.PostProcess/OpenRA.PostProcess.csproj @@ -0,0 +1,22 @@ + + + Exe + net461 + true + true + false + .. + false + 5 + true + true + x86 + x86 + false + false + + + DEBUG;TRACE + false + + diff --git a/OpenRA.PostProcess/Program.cs b/OpenRA.PostProcess/Program.cs new file mode 100644 index 0000000000..864233237b --- /dev/null +++ b/OpenRA.PostProcess/Program.cs @@ -0,0 +1,47 @@ +#region Copyright & License Information +/* + * Copyright 2007-2019 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System; +using System.IO; +using System.Linq; + +namespace OpenRA.PostProcess +{ + class Program + { + static void Main(string[] args) + { + var assembly = args.First(); + var flags = args.Skip(1).ToArray(); + + Console.WriteLine("Post-processing {0}", assembly); + var data = File.ReadAllBytes(assembly); + var peOffset = BitConverter.ToInt32(data, 0x3c); + + foreach (var flag in flags) + { + if (flag == "-LAA") + { + // Set /LARGEADDRESSAWARE Flag (Application can handle large (>2GB) addresses) + Console.WriteLine(" - Enabling /LARGEADDRESSAWARE"); + data[peOffset + 4 + 18] |= 0x20; + } + else + Console.WriteLine("error: Unknown flag '{0}'", flag); + } + + if (flags.Length == 0) + Console.WriteLine("error: No flags were specified"); + + File.WriteAllBytes(args[0], data); + } + } +} diff --git a/OpenRA.Server/OpenRA.Server.csproj b/OpenRA.Server/OpenRA.Server.csproj index d90a643355..730cedc236 100644 --- a/OpenRA.Server/OpenRA.Server.csproj +++ b/OpenRA.Server/OpenRA.Server.csproj @@ -1,96 +1,31 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {76F621A1-3D8E-4A99-9F7E-B071EB657817} Exe - Properties - OpenRA.Server - OpenRA.Server - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.5 - - - true - full - ..\ - DEBUG;TRACE - prompt - false - x86 + net461 true - 5 - - - true - ..\ - TRACE - true - pdbonly - x86 - false - prompt true + false + .. + false + 5 + true + true + x86 + x86 + false + + + DEBUG;TRACE + false - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - False + + + false - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - \ No newline at end of file diff --git a/OpenRA.StyleCheck.exe.config b/OpenRA.StyleCheck/App.config similarity index 100% rename from OpenRA.StyleCheck.exe.config rename to OpenRA.StyleCheck/App.config diff --git a/OpenRA.StyleCheck/OpenRA.StyleCheck.csproj b/OpenRA.StyleCheck/OpenRA.StyleCheck.csproj index f341b53cad..5f97cd9edd 100644 --- a/OpenRA.StyleCheck/OpenRA.StyleCheck.csproj +++ b/OpenRA.StyleCheck/OpenRA.StyleCheck.csproj @@ -1,42 +1,29 @@ - - + - Debug - AnyCPU - {5FEAB6DC-4E81-4B63-958B-22FC3534C606} Exe - OpenRA.StyleCheck - OpenRA.StyleCheck - v4.5 - - - true - full - false - ..\ - DEBUG;TRACE - prompt - 4 - true - x86 - 5 - - + net461 + true true - ..\ - prompt - 4 - true + false + .. + false + 5 + true + true + x86 x86 + false + + + DEBUG;TRACE + false - ..\StyleCop.dll - + - \ No newline at end of file diff --git a/OpenRA.Test/OpenRA.Test.csproj b/OpenRA.Test/OpenRA.Test.csproj index 88efc5eea0..9fd3ff586c 100644 --- a/OpenRA.Test/OpenRA.Test.csproj +++ b/OpenRA.Test/OpenRA.Test.csproj @@ -1,85 +1,35 @@ - - - + - Debug - x86 - {6CB8E1B7-6B36-4D93-8633-7C573E194AC4} - Library - Properties - OpenRA.Test - OpenRA.Test - v4.5 - 512 - - - true - ..\ - DEBUG;TRACE - full - x86 - prompt + net461 + true 5 - - true - ..\ - TRACE - pdbonly + true + .. + false + x86 x86 - prompt - true + + + DEBUG;TRACE + false - - False + ..\thirdparty\download\Eluant.dll False - - False + + ..\thirdparty\download\nunit.framework.dll False + False - - - - - - - - - - - - - - - - {0dfb103f-2962-400f-8c6d-e2c28ccba633} - OpenRA.Game - False - + - {fe6c8cc0-2f07-442a-b29f-17617b3b7fc6} - OpenRA.Mods.Common False - - - - - - - - \ No newline at end of file diff --git a/OpenRA.Utility.exe.config b/OpenRA.Utility.exe.config deleted file mode 100644 index f9952017c3..0000000000 --- a/OpenRA.Utility.exe.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/OpenRA.Utility/OpenRA.Utility.csproj b/OpenRA.Utility/OpenRA.Utility.csproj index 04880b826d..730cedc236 100644 --- a/OpenRA.Utility/OpenRA.Utility.csproj +++ b/OpenRA.Utility/OpenRA.Utility.csproj @@ -1,96 +1,31 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {F33337BE-CB69-4B24-850F-07D23E408DDF} Exe - Properties - OpenRA.Utility - OpenRA.Utility - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.5 - - - true - full - ..\ - DEBUG;TRACE - prompt - false - x86 + net461 true - 5 - - - true - ..\ - TRACE - true - pdbonly - x86 - false - prompt true + false + .. + false + 5 + true + true + x86 + x86 + false + + + DEBUG;TRACE + false - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - False + + + false - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - \ No newline at end of file diff --git a/OpenRA.sln b/OpenRA.sln index c62966e069..2d57d67928 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2010 @@ -178,6 +178,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tiberian Sun Lua scripts", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.StyleCheck", "OpenRA.StyleCheck\OpenRA.StyleCheck.csproj", "{5FEAB6DC-4E81-4B63-958B-22FC3534C606}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.PostProcess", "OpenRA.PostProcess\OpenRA.PostProcess.csproj", "{EE63AF7E-92EA-48FB-81E2-53D7D92F8050}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -220,6 +222,10 @@ Global {5FEAB6DC-4E81-4B63-958B-22FC3534C606}.Debug|x86.Build.0 = Debug|x86 {5FEAB6DC-4E81-4B63-958B-22FC3534C606}.Release|x86.ActiveCfg = Release|x86 {5FEAB6DC-4E81-4B63-958B-22FC3534C606}.Release|x86.Build.0 = Release|x86 + {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Debug|x86.ActiveCfg = Debug|x86 + {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Debug|x86.Build.0 = Debug|x86 + {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release|x86.ActiveCfg = Release|x86 + {EE63AF7E-92EA-48FB-81E2-53D7D92F8050}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -228,172 +234,7 @@ Global StartupItem = OpenRA.Game\OpenRA.Game.csproj Policies = $0 $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault $0.TextStylePolicy = $7 - $2.TabsToSpaces = False - $2.NoTabsAfterNonTabs = True - $2.inheritsSet = VisualStudio - $2.inheritsScope = text/plain - $2.scope = text/x-csharp - $0.CSharpFormattingPolicy = $3 - $3.IndentSwitchBody = True - $3.AnonymousMethodBraceStyle = NextLine - $3.PropertyBraceStyle = NextLine - $3.PropertyGetBraceStyle = NextLine - $3.PropertySetBraceStyle = NextLine - $3.EventBraceStyle = NextLine - $3.EventAddBraceStyle = NextLine - $3.EventRemoveBraceStyle = NextLine - $3.StatementBraceStyle = NextLine - $3.ArrayInitializerBraceStyle = NextLine - $3.BeforeMethodDeclarationParentheses = False - $3.BeforeMethodCallParentheses = False - $3.BeforeConstructorDeclarationParentheses = False - $3.BeforeDelegateDeclarationParentheses = False - $3.NewParentheses = False - $3.inheritsSet = Mono - $3.inheritsScope = text/x-csharp - $3.scope = text/x-csharp - $4.TabsToSpaces = False - $4.NoTabsAfterNonTabs = True - $4.inheritsSet = VisualStudio - $4.inheritsScope = text/plain - $4.scope = text/plain - $5.NoTabsAfterNonTabs = True - $5.inheritsSet = Mono - $5.inheritsScope = text/plain - $5.scope = text/microsoft-resx - $0.XmlFormattingPolicy = $8 - $6.inheritsSet = Mono - $6.inheritsScope = application/xml - $6.scope = text/microsoft-resx - $7.NoTabsAfterNonTabs = True - $7.inheritsSet = Mono - $7.inheritsScope = text/plain - $7.scope = application/xml - $8.inheritsSet = Mono - $8.inheritsScope = application/xml - $8.scope = application/xml - $0.StandardHeader = $9 - $9.Text = @#region Copyright & License Information\n/*\n * Copyright 2007-${Year} The OpenRA Developers (see AUTHORS)\n * This file is part of OpenRA, which is free software. It is made\n * available to you under the terms of the GNU General Public License\n * as published by the Free Software Foundation. For more information,\n * see COPYING.\n */\n#endregion - $9.IncludeInNewFiles = True - $0.NameConventionPolicy = $10 - $10.Rules = $11 - $11.NamingRule = $31 - $12.Name = Namespaces - $12.AffectedEntity = Namespace - $12.VisibilityMask = VisibilityMask - $12.NamingStyle = PascalCase - $12.IncludeInstanceMembers = True - $12.IncludeStaticEntities = True - $13.Name = Types - $13.AffectedEntity = Class, Struct, Enum, Delegate - $13.VisibilityMask = Public - $13.NamingStyle = PascalCase - $13.IncludeInstanceMembers = True - $13.IncludeStaticEntities = True - $14.Name = Interfaces - $14.RequiredPrefixes = $15 - $15.String = I - $14.AffectedEntity = Interface - $14.VisibilityMask = Public - $14.NamingStyle = PascalCase - $14.IncludeInstanceMembers = True - $14.IncludeStaticEntities = True - $16.Name = Attributes - $16.RequiredSuffixes = $17 - $17.String = Attribute - $16.AffectedEntity = CustomAttributes - $16.VisibilityMask = Public - $16.NamingStyle = PascalCase - $16.IncludeInstanceMembers = True - $16.IncludeStaticEntities = True - $18.Name = Event Arguments - $18.RequiredSuffixes = $19 - $19.String = EventArgs - $18.AffectedEntity = CustomEventArgs - $18.VisibilityMask = Public - $18.NamingStyle = PascalCase - $18.IncludeInstanceMembers = True - $18.IncludeStaticEntities = True - $20.Name = Exceptions - $20.RequiredSuffixes = $21 - $21.String = Exception - $20.AffectedEntity = CustomExceptions - $20.VisibilityMask = VisibilityMask - $20.NamingStyle = PascalCase - $20.IncludeInstanceMembers = True - $20.IncludeStaticEntities = True - $22.Name = Methods - $22.AffectedEntity = Methods - $22.VisibilityMask = Protected, Public - $22.NamingStyle = PascalCase - $22.IncludeInstanceMembers = True - $22.IncludeStaticEntities = True - $23.Name = Static Readonly Fields - $23.AffectedEntity = ReadonlyField - $23.VisibilityMask = Protected, Public - $23.NamingStyle = PascalCase - $23.IncludeInstanceMembers = False - $23.IncludeStaticEntities = True - $24.Name = Fields - $24.AffectedEntity = Field - $24.VisibilityMask = Protected, Public - $24.NamingStyle = PascalCase - $24.IncludeInstanceMembers = True - $24.IncludeStaticEntities = True - $25.Name = ReadOnly Fields - $25.AffectedEntity = ReadonlyField - $25.VisibilityMask = Protected, Public - $25.NamingStyle = PascalCase - $25.IncludeInstanceMembers = True - $25.IncludeStaticEntities = False - $26.Name = Constant Fields - $26.AffectedEntity = ConstantField - $26.VisibilityMask = Protected, Public - $26.NamingStyle = PascalCase - $26.IncludeInstanceMembers = True - $26.IncludeStaticEntities = True - $27.Name = Properties - $27.AffectedEntity = Property - $27.VisibilityMask = Protected, Public - $27.NamingStyle = PascalCase - $27.IncludeInstanceMembers = True - $27.IncludeStaticEntities = True - $28.Name = Events - $28.AffectedEntity = Event - $28.VisibilityMask = Protected, Public - $28.NamingStyle = PascalCase - $28.IncludeInstanceMembers = True - $28.IncludeStaticEntities = True - $29.Name = Enum Members - $29.AffectedEntity = EnumMember - $29.VisibilityMask = VisibilityMask - $29.NamingStyle = PascalCase - $29.IncludeInstanceMembers = True - $29.IncludeStaticEntities = True - $30.Name = Parameters - $30.AffectedEntity = Parameter - $30.VisibilityMask = VisibilityMask - $30.NamingStyle = CamelCase - $30.IncludeInstanceMembers = True - $30.IncludeStaticEntities = True - $31.Name = Type Parameters - $31.RequiredPrefixes = $32 - $32.String = T - $31.AffectedEntity = TypeParameter - $31.VisibilityMask = VisibilityMask - $31.NamingStyle = PascalCase - $31.IncludeInstanceMembers = True - $31.IncludeStaticEntities = True - $0.VersionControlPolicy = $33 - $33.inheritsSet = Mono - $0.ChangeLogPolicy = $34 - $34.UpdateMode = None - $34.MessageStyle = $35 - $35.LineAlign = 0 - $34.inheritsSet = Mono outputpath = . EndGlobalSection EndGlobal diff --git a/make.ps1 b/make.ps1 index e371f807a9..82e42bb6de 100644 --- a/make.ps1 +++ b/make.ps1 @@ -6,51 +6,45 @@ function All-Command { Dependencies-Command - $msBuild = FindMSBuild - $msBuildArguments = "/t:Rebuild /nr:false" - if ($msBuild -eq $null) + + if (!(Test-Path "C:\Program Files\dotnet\dotnet.exe")) { - echo "Unable to locate an appropriate version of MSBuild." + DotnetNotFound + return + } + + $proc = Start-Process "C:\Program Files\dotnet\dotnet.exe" "build /nr:false" -NoNewWindow -PassThru -Wait + if ($proc.ExitCode -ne 0) + { + echo "Build failed. If just the development tools failed to build, try installing Visual Studio. You may also still be able to run the game." } else { - $proc = Start-Process $msBuild $msBuildArguments -NoNewWindow -PassThru -Wait - if ($proc.ExitCode -ne 0) - { - echo "Build failed. If just the development tools failed to build, try installing Visual Studio. You may also still be able to run the game." - } - else - { - echo "Build succeeded." - } + echo "Build succeeded." } } function Clean-Command { - $msBuild = FindMSBuild - $msBuildArguments = "/t:Clean /nr:false" - if ($msBuild -eq $null) + if (!(Test-Path "C:\Program Files\dotnet\dotnet.exe")) { - echo "Unable to locate an appropriate version of MSBuild." + DotnetNotFound + return } - else + $proc = Start-Process "C:\Program Files\dotnet\dotnet.exe" "clean /nr:false" -NoNewWindow -PassThru -Wait + rm *.dll + rm mods/*/*.dll + rm *.config + rm *.pdb + rm mods/*/*.pdb + rm *.exe + rm ./*/bin -r + rm ./*/obj -r + if (Test-Path thirdparty/download/) { - $proc = Start-Process $msBuild $msBuildArguments -NoNewWindow -PassThru -Wait - rm *.dll - rm mods/*/*.dll - Get-ChildItem *.dll.config -exclude OpenRA.Platforms.Default.dll.config | Remove-Item - rm *.pdb - rm mods/*/*.pdb - rm *.exe - rm ./*/bin -r - rm ./*/obj -r - if (Test-Path thirdparty/download/) - { - rmdir thirdparty/download -Recurse -Force - } - echo "Clean complete." + rmdir thirdparty/download -Recurse -Force } + echo "Clean complete." } function Version-Command @@ -110,6 +104,18 @@ function Dependencies-Command cp download/windows/*.dll .. cd .. echo "Dependencies copied." + + if (!(Test-Path "C:\Program Files\dotnet\dotnet.exe")) + { + DotnetNotFound + return + } + + $proc = Start-Process "C:\Program Files\dotnet\dotnet.exe" "restore /nr:false" -NoNewWindow -PassThru -Wait + if ($proc.ExitCode -ne 0) + { + echo "Project restoration failed." + } } function Test-Command @@ -203,29 +209,16 @@ function Docs-Command } } -function FindMSBuild -{ - $key = "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" - $property = Get-ItemProperty $key -ErrorAction SilentlyContinue - if ($property -eq $null -or $property.MSBuildToolsPath -eq $null) - { - return $null - } - - $path = Join-Path $property.MSBuildToolsPath -ChildPath "MSBuild.exe" - if (Test-Path $path) - { - return $path - } - - return $null -} - function UtilityNotFound { echo "OpenRA.Utility.exe could not be found. Build the project first using the `"all`" command." } +function DotnetNotFound +{ + echo "The 'dotnet' tool is required to compile OpenRA. Please install the .NET Core SDK or Visual studio and try again." +} + function WaitForInput { echo "Press enter to continue." diff --git a/packaging/fixheader.cs b/packaging/fixheader.cs deleted file mode 100644 index 01f5526ff8..0000000000 --- a/packaging/fixheader.cs +++ /dev/null @@ -1,57 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2019 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System; -using System.IO; - -namespace fixheader -{ - class fixheader - { - static byte[] data; - static int peOffset; - - static void Main(string[] args) - { - Console.WriteLine("fixheader {0}", args[0]); - data = File.ReadAllBytes(args[0]); - peOffset = BitConverter.ToInt32(data, 0x3c); - var corHeaderRva = BitConverter.ToInt32(data, peOffset + 20 + 100 + 14 * 8); - var corHeaderOffset = RvaToOffset(corHeaderRva); - - data[corHeaderOffset + 16] |= 2; - - // Set Flag "Application can handle large (>2GB) addresses (/LARGEADDRESSAWARE)" - data[peOffset + 4 + 18] |= 0x20; - - File.WriteAllBytes(args[0], data); - } - - static int RvaToOffset(int va) - { - var numSections = BitConverter.ToInt16(data, peOffset + 6); - var numDataDirectories = BitConverter.ToInt32(data, peOffset + 24 + 92); - var sectionTableStart = peOffset + 24 + 96 + 8 * numDataDirectories; - - for (var i = 0; i < numSections; i++) - { - var virtualSize = BitConverter.ToInt32(data, sectionTableStart + 40 * i + 8); - var virtualAddr = BitConverter.ToInt32(data, sectionTableStart + 40 * i + 12); - var fileOffset = BitConverter.ToInt32(data, sectionTableStart + 40 * i + 20); - - if (va >= virtualAddr && va < virtualAddr + virtualSize) - return va - virtualAddr + fileOffset; - } - - return 0; - } - } -} diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index d41ef00eb5..18a440d79a 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -30,9 +30,9 @@ fi function makelauncher() { sed "s|DISPLAY_NAME|$2|" WindowsLauncher.cs.in | sed "s|MOD_ID|$3|" | sed "s|FAQ_URL|${FAQ_URL}|" > WindowsLauncher.cs - csc WindowsLauncher.cs -warn:4 -warnaserror -out:"$1" -t:winexe ${LAUNCHER_LIBS} -win32icon:"$4" + csc WindowsLauncher.cs -warn:4 -warnaserror -platform:"x86" -out:"$1" -t:winexe ${LAUNCHER_LIBS} -win32icon:"$4" rm WindowsLauncher.cs - mono "${SRCDIR}/fixheader.exe" "$1" > /dev/null + mono "${SRCDIR}/OpenRA.PostProcess.exe" "$1" -LAA > /dev/null } echo "Building core files"