Skip to content

Commit

Permalink
Windows Permissions (netdata#18443)
Browse files Browse the repository at this point in the history
* wins_perm: Modify original netdata_claim manifest adding external version

* wins_perm: Add resources to netdatacli

* wins_perm: Add resources to netdata

* win_rename: Restore lines removed. They will be removed in another PR.

* win_perm: Update manifest
  • Loading branch information
thiagoftsm authored Sep 3, 2024
1 parent 596e868 commit 6075275
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Session.*.vim

# Special exceptions
!packaging/repoconfig/Makefile
packaging/windows/resources/*.manifest

# Jupyter notebook checkpoints
.ipynb_checkpoints
Expand Down
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2241,17 +2241,27 @@ endif()
# build netdata (only Linux ATM)
#

if(OS_WINDOWS)
set(NETDATA_CLAIM_RES_FILES "packaging/windows/resources/netdata_claim.rc")
configure_file(packaging/windows/resources/netdata_claim.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata_claim.manifest @ONLY)

set(NETDATACLI_RES_FILES "packaging/windows/resources/netdatacli.rc")
configure_file(packaging/windows/resources/netdatacli.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdatacli.manifest @ONLY)

set(NETDATA_RES_FILES "packaging/windows/resources/netdata.rc")
configure_file(packaging/windows/resources/netdata.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata.manifest @ONLY)
endif()

add_executable(netdata
${NETDATA_FILES}
"${ACLK_FILES}"
"$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
"$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
"$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
"$<$<BOOL:${OS_WINDOWS}>:${NETDATA_RES_FILES}>"
)

if(OS_WINDOWS)
set(NETDATA_CLAIM_RES_FILES "packaging/windows/resources/netdata_claim.rc")

add_executable(netdata_claim ${CLAIM_WINDOWS_FILES} ${NETDATA_CLAIM_RES_FILES})
target_link_libraries(netdata_claim shell32;gdi32;msftedit)
endif()
Expand Down Expand Up @@ -2353,7 +2363,7 @@ set(NETDATACLI_FILES
src/cli/cli.c
)

add_executable(netdatacli ${NETDATACLI_FILES})
add_executable(netdatacli ${NETDATACLI_FILES} "$<$<BOOL:${OS_WINDOWS}>:${NETDATACLI_RES_FILES}>")
target_link_libraries(netdatacli libnetdata)

install(TARGETS netdatacli
Expand Down
16 changes: 16 additions & 0 deletions packaging/windows/resources/netdata.manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
processorArchitecture="*"
name="netdata"
type="win32"/>
<description>Netdata is a high-performance, cloud-native, and on-premises observability platform designed to monitor metrics and logs with unparalleled efficiency.</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
3 changes: 3 additions & 0 deletions packaging/windows/resources/netdata.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "winuser.h"
1 RT_MANIFEST "netdata.manifest"
11 ICON "../NetdataWhite.ico"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.99.0.0"
<assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
processorArchitecture="*"
name="netdata_claim"
type="win32"/>
Expand Down
16 changes: 16 additions & 0 deletions packaging/windows/resources/netdatacli.manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="@CMAKE_PROJECT_VERSION@"
processorArchitecture="*"
name="netdatacli"
type="win32"/>
<description>The netdatacli executable provides a simple way to control the Netdata agent's operation.</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
3 changes: 3 additions & 0 deletions packaging/windows/resources/netdatacli.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "winuser.h"
1 RT_MANIFEST "netdatacli.manifest"
11 ICON "../NetdataWhite.ico"

0 comments on commit 6075275

Please sign in to comment.