Skip to content

Commit

Permalink
NMake builds: Embed UAC manifest for dom_update_namespace
Browse files Browse the repository at this point in the history
...if a 32-bit Windows build is being carried out. This will prevent UAC
from interfering when the test program is run, as any 32-bit Windows
executable with 'update' in its filename will trigger an UAC prompt
which will get into our way.
  • Loading branch information
fanc999-1 committed Sep 23, 2024
1 parent d5f9f8d commit 869e648
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions MSVC_NMake/build-rules-msvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ $(libxmlxx_OBJS)
# $(dependent_objects)
# <<
# @-if exist [email protected] mt /manifest [email protected] /outputresource:$@;1
vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe: $(LIBXMLXX_LIB) $(dom_update_namespace_OBJS) $(DOM_UPDATE_NAMESPACE_MANIFEST)
link $(LDFLAGS) $(dom_update_namespace_OBJS) $(LIBXMLXX_LIB) $(GLIBMM_LIB) $(LIBSIGC_LIB) $(GOBJECT_LIBS) $(LIBXML2_LIBS) /out:$@
@if not "$(DOM_UPDATE_NAMESPACE_MANIFEST)" == "" mt /manifest $@.manifest /outputresource:$@;1

clean:
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe.manifest
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb
Expand Down
6 changes: 6 additions & 0 deletions MSVC_NMake/config-msvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ LIBXMLXX_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBXMLXX_LIBNAME).lib

LIBXML2_LIBS = libxml2.lib
GOBJECT_LIBS = gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib

!if "$(PLAT)" == "Win32"
DOM_UPDATE_NAMESPACE_MANIFEST = vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe.manifest
!else
DOM_UPDATE_NAMESPACE_MANIFEST =
!endif
2 changes: 1 addition & 1 deletion MSVC_NMake/create-lists-msvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ NULL=
!if [echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\libxmlxx-examples\testutilities.obj: ..\examples\testutilities.cc>>libxmlxx.mak & @echo. if not exist ^$(@D)\ md ^$(@D)>>libxmlxx.mak & @echo. ^$(CXX) ^$(LIBXMLXX_EX_CFLAGS) ^$(CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>libxmlxx.mak & @echo.>>libxmlxx.mak]
!endif

!if [for %d in (examples tests) do @for /f %t in ('dir /ad /b ..\%d') do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe: ^$(LIBXMLXX_LIB) ^$(%t_OBJS)>>libxmlxx.mak & @echo. link ^$(LDFLAGS) ^$** ^$(GLIBMM_LIB) ^$(LIBXML2_LIBS) ^$(GOBJECT_LIBS) ^$(LIBSIGC_LIB) /out:^$@>>libxmlxx.mak & @echo.>>libxmlxx.mak]
!if [for %d in (examples tests) do @for /f %t in ('dir /ad /b ..\%d') do @if not "%t" == "dom_update_namespace" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe: ^$(LIBXMLXX_LIB) ^$(%t_OBJS)>>libxmlxx.mak & @echo. link ^$(LDFLAGS) ^$** ^$(GLIBMM_LIB) ^$(LIBXML2_LIBS) ^$(GOBJECT_LIBS) ^$(LIBSIGC_LIB) /out:^$@>>libxmlxx.mak & @echo.>>libxmlxx.mak]
!endif

!if [echo.>>libxmlxx.mak]
Expand Down
14 changes: 14 additions & 0 deletions MSVC_NMake/generate-msvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ pkg-ver.mak: ..\configure.ac
@pkg-ver.bat
@del ver.txt pkg-ver.bat
$(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 libxml++\libxml++.rc

vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe.manifest:
@echo Generating $@...
@echo ^<?xml version='1.0' encoding='UTF-8' standalone='yes'?^>>$@
@echo ^<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'^>>>$@
@echo ^<assemblyIdentity version='0.0.0.0' processorArchitecture='*' name='$(@B)' type='win32' /^>>>$@
@echo ^<trustInfo xmlns='urn:schemas-microsoft-com:asm.v3'^>>>$@
@echo ^<security^>>>$@
@echo ^<requestedPrivileges^>>>$@
@echo ^<requestedExecutionLevel level='asInvoker' uiAccess='false' /^>>>$@
@echo ^</requestedPrivileges^>>>$@
@echo ^</security^>>>$@
@echo ^</trustInfo^>>>$@
@echo ^</assembly^>>>$@

0 comments on commit 869e648

Please sign in to comment.