Skip to content

Commit bd1f057

Browse files
added app manifest + minor changes
1 parent ab37e42 commit bd1f057

File tree

6 files changed

+67
-15
lines changed

6 files changed

+67
-15
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77

88
!src/*.c
99
!src/*.h
10+
!src/winres/*.manifest
11+
!src/winres/*.rc

Diff for: Makefile

+25-11
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,52 @@ headers := $(wildcard $(srcdir)/*.h)
1212
sources := $(wildcard $(srcdir)/*.c)
1313
objects := $(sources:$(srcdir)/%.c=$(objdir)/%.o)
1414

15-
appname := $(bindir)/tf2patcher
15+
appname := tf2patcher
16+
appfile := $(bindir)/$(appname)
17+
18+
ifeq ($(TARGET),64)
19+
restarget := pe-x86-64
20+
cctarget := -m64
21+
else
22+
restarget := pe-i386
23+
cctarget := -m32
24+
endif
1625

1726

1827
ifeq ($(OS),Windows_NT)
1928
RM := del /Q /F
2029
MKDIR := mkdir
21-
appname := $(addsuffix .exe,$(appname))
2230
slashfix = $(subst /,\,$(1)) # callable function for replacing slashes with backslashes
31+
32+
appfile := $(addsuffix .exe,$(appfile))
2333
LFLAGS += -lpsapi # for mingw support
34+
35+
resfilein := $(srcdir)\winres\$(appname).rc
36+
resfileout := $(objdir)\$(appname).res
2437
else
2538
RM := rm -f
2639
MKDIR := mkdir -p
2740
slashfix = $(1)
2841
endif
2942

3043

31-
all: $(dirs) $(objects)
32-
$(CC) $(ARCH) $(CFLAGS) $(objects) -o $(appname) $(LFLAGS)
44+
45+
all: $(dirs) $(objects) winres
46+
$(CC) $(cctarget) $(CFLAGS) $(objects) $(resfileout) -o $(appfile) $(LFLAGS)
3347

3448
$(objects): $(objdir)/%.o: $(srcdir)/%.c $(headers)
35-
$(CC) $(ARCH) $(CFLAGS) -I$(srcdir) -c $< -o $@
49+
$(CC) $(cctarget) $(CFLAGS) -I$(srcdir) -c $< -o $@
3650

3751
$(dirs):
3852
$(MKDIR) $@
3953

40-
win32: ARCH=-m32
41-
win32: all
4254

43-
win64: ARCH=-m64
44-
win64: all
55+
ifeq ($(OS),Windows_NT)
56+
winres: $(resfilein)
57+
windres --input $(resfilein) --output $(resfileout) --output-format=coff --target=$(restarget)
58+
endif
4559

4660
clean:
47-
$(RM) $(call slashfix,$(objects)) $(call slashfix,$(appname))
61+
$(RM) $(call slashfix,$(objects)) $(call slashfix,$(appfile)) $(call slashfix,$(resfileout))
4862

49-
.PHONY: all clean win32 win64
63+
.PHONY: all clean winres

Diff for: README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ It is completely safe to use. However:
3131

3232
## Building from source
3333

34-
Just run `make`.
34+
Run `make TARGET=32` or `make TARGET=64`, depending on which architecture you want to build for.
3535

3636
C11-aware compiler is required.
3737

3838

39-
4039
## How does it work
4140
Due to a recent TF2 source code leak it became incredibly easy to determine the most optimal patching strategy for decal stuff.
4241

Diff for: src/tf2patcher.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int main(int argc, char *argv[])
194194
{
195195
printf(
196196
" --------------------------------------------\n"
197-
" | TF2 decal tool patcher 2.0.1 |\n"
197+
" | TF2 decal tool patcher 2.0.2 |\n"
198198
" | (c) default-username, Apr 2020, Mar 2016 |\n"
199199
" --------------------------------------------\n"
200200
"\n");
@@ -223,7 +223,7 @@ int main(int argc, char *argv[])
223223

224224
free_resources();
225225

226-
printf("Press ENTER to exit...");
226+
printf("Press ENTER to exit...\n");
227227
getchar();
228228

229229
return res ? EXIT_SUCCESS : EXIT_FAILURE;

Diff for: src/winres/tf2patcher.exe.manifest

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
3+
4+
<assemblyIdentity
5+
type="win32"
6+
name="defaultUsername.tf2patcher"
7+
version="2.0.2.0"
8+
/>
9+
10+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
11+
<application>
12+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS> <!-- Vista/WS2008 -->
13+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS> <!-- W7/WS2008R2 -->
14+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS> <!-- W8/WS2012 -->
15+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS> <!-- W8.1/WS2012R2 -->
16+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS> <!-- W10/WS2016/WS2019 -->
17+
</application>
18+
</compatibility>
19+
20+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
21+
<security>
22+
<requestedPrivileges>
23+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
24+
</requestedPrivileges>
25+
</security>
26+
</trustInfo>
27+
28+
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
29+
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
30+
<autoElevate>False</autoElevate>
31+
</asmv3:windowsSettings>
32+
</asmv3:application>
33+
34+
</assembly>

Diff for: src/winres/tf2patcher.rc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "winuser.h"
2+
3+
1 RT_MANIFEST tf2patcher.exe.manifest

0 commit comments

Comments
 (0)