Cleanup, rename and packaging fix (Windows Codes) (#18455)
thiagoftsm committed
Sep 4, 2024 at 01:20 UTC
6dda70fd952aa3c1b4438e279b03eec28f2b1aa3
7 files changed
+29
-77
CMakeLists.txt
+15
-73
@@ -1301,10 +1301,10 @@ set(CLAIM_PLUGIN_FILES
1301
)
1302
1303
set(CLAIM_WINDOWS_FILES
1304
- src/claim/netdata_claim.c
1305
- src/claim/netdata_claim.h
1306
- src/claim/netdata_claim_window.c
1307
- src/claim/netdata_claim_window.h
1304
+ src/claim/main.c
1305
+ src/claim/main.h
1306
+ src/claim/ui.c
1307
+ src/claim/ui.h
1308
)
1309
1310
set(ACLK_ALWAYS_BUILD
@@ -2262,8 +2262,9 @@ add_executable(netdata
2262
)
2263
2264
if(OS_WINDOWS)
2265
- add_executable(netdata_claim ${CLAIM_WINDOWS_FILES} ${NETDATA_CLAIM_RES_FILES})
2266
- target_link_libraries(netdata_claim shell32;gdi32;msftedit)
2265
+ add_executable(NetdataClaim ${CLAIM_WINDOWS_FILES} ${NETDATA_CLAIM_RES_FILES})
2266
+ target_link_libraries(NetdataClaim shell32;gdi32;msftedit)
2267
+ target_compile_options(NetdataClaim PUBLIC -mwindows)
2268
endif()
2269
2270
target_compile_definitions(netdata PRIVATE
@@ -2448,15 +2449,15 @@ set(varlibdir_POST "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")
2449
set(netdata_user_POST "${NETDATA_USER}")
2450
set(netdata_group_POST "${NETDATA_USER}")
2451
2451
-configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
2452
-install(PROGRAMS
2453
- ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
2454
- COMPONENT netdata
2455
- DESTINATION "${BINDIR}")
2456
-
2457
-if(OS_WINDOWS)
2452
+if(NOT OS_WINDOWS)
2453
+ configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
2454
+ install(PROGRAMS
2455
+ ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
2456
+ COMPONENT netdata
2457
+ DESTINATION "${BINDIR}")
2458
+else()
2459
install(PROGRAMS
2459
- ${CMAKE_BINARY_DIR}/netdata_claim.exe
2460
+ ${CMAKE_BINARY_DIR}/NetdataClaim.exe
2461
COMPONENT netdata
2462
DESTINATION "${BINDIR}")
2463
endif()
@@ -3013,65 +3014,6 @@ if(NOT OS_WINDOWS)
3014
endif()
3015
3016
if(OS_WINDOWS)
3016
- install(FILES /usr/bin/awk.exe
3017
- /usr/bin/bash.exe
3018
- /usr/bin/cat.exe
3019
- /usr/bin/chown.exe
3020
- /usr/bin/curl.exe
3021
- /usr/bin/env.exe
3022
- /usr/bin/grep.exe
3023
- /usr/bin/mkdir.exe
3024
- /usr/bin/openssl.exe
3025
- /usr/bin/rm.exe
3026
- /usr/bin/sed.exe
3027
- /usr/bin/sh.exe
3028
- /usr/bin/tail.exe
3029
- /usr/bin/tr.exe
3030
- /usr/bin/uuidgen.exe
3031
- /usr/bin/whoami.exe
3032
- DESTINATION "${BINDIR}")
3033
-
3034
- install(FILES /usr/bin/msys-2.0.dll
3035
- /usr/bin/msys-asn1-8.dll
3036
- /usr/bin/msys-brotlicommon-1.dll
3037
- /usr/bin/msys-brotlidec-1.dll
3038
- /usr/bin/msys-brotlienc-1.dll
3039
- /usr/bin/msys-com_err-1.dll
3040
- /usr/bin/msys-crypt-2.dll
3041
- /usr/bin/msys-crypto-3.dll
3042
- /usr/bin/msys-curl-4.dll
3043
- /usr/bin/msys-gcc_s-seh-1.dll
3044
- /usr/bin/msys-gmp-10.dll
3045
- /usr/bin/msys-gssapi-3.dll
3046
- /usr/bin/msys-hcrypto-4.dll
3047
- /usr/bin/msys-heimbase-1.dll
3048
- /usr/bin/msys-heimntlm-0.dll
3049
- /usr/bin/msys-hx509-5.dll
3050
- /usr/bin/msys-iconv-2.dll
3051
- /usr/bin/msys-idn2-0.dll
3052
- /usr/bin/msys-intl-8.dll
3053
- /usr/bin/msys-krb5-26.dll
3054
- /usr/bin/msys-lz4-1.dll
3055
- /usr/bin/msys-mpfr-6.dll
3056
- /usr/bin/msys-ncursesw6.dll
3057
- /usr/bin/msys-nghttp2-14.dll
3058
- /usr/bin/msys-pcre-1.dll
3059
- /usr/bin/msys-protobuf-32.dll
3060
- /usr/bin/msys-psl-5.dll
3061
- /usr/bin/msys-readline8.dll
3062
- /usr/bin/msys-roken-18.dll
3063
- /usr/bin/msys-sqlite3-0.dll
3064
- /usr/bin/msys-ssh2-1.dll
3065
- /usr/bin/msys-ssl-3.dll
3066
- /usr/bin/msys-stdc++-6.dll
3067
- /usr/bin/msys-unistring-5.dll
3068
- /usr/bin/msys-uuid-1.dll
3069
- /usr/bin/msys-uv-1.dll
3070
- /usr/bin/msys-wind-0.dll
3071
- /usr/bin/msys-z.dll
3072
- /usr/bin/msys-zstd-1.dll
3073
- DESTINATION "${BINDIR}")
3074
-
3017
# Make bash & netdata happy
3018
install(DIRECTORY DESTINATION tmp)
3019
packaging/windows/installer.nsi
+1
-1
@@ -117,7 +117,7 @@ Function NetdataConfigLeave
117
118
${If} $0 == 135
119
${AndIf} $1 >= 36
120
- nsExec::ExecToLog '$INSTDIR\usr\bin\netdata_claim.exe /T $cloudToken /R $cloudRooms /P $proxy /I $insecure'
120
+ nsExec::ExecToLog '$INSTDIR\usr\bin\NetdataClaim.exe /T $cloudToken /R $cloudRooms /P $proxy /I $insecure'
121
pop $0
122
${Else}
123
MessageBox MB_OK "The Cloud information does not have the expected length."
packaging/windows/package-windows.sh
+10
@@ -18,6 +18,16 @@ fi
18
19
set -exu -o pipefail
20
21
+# Regenerate keys everytime there is an update
22
+if [ -d /opt/netdata/etc/pki/ ]; then
23
+ rm -rf /opt/netdata/etc/pki/
24
+fi
25
+
26
+# Remove previous installation of msys2 script
27
+if [ -f /opt/netdata/usr/bin/bashbug ]; then
28
+ rm -rf /opt/netdata/usr/bin/bashbug
29
+fi
30
+
31
${GITHUB_ACTIONS+echo "::group::Installing"}
32
cmake --install "${build}"
33
${GITHUB_ACTIONS+echo "::endgroup::"}
src/claim/main.c
renamed
+1
-1
@@ -9,7 +9,7 @@
9
#include <string.h>
10
#include <signal.h>
11
12
-#include "netdata_claim.h"
12
+#include "main.h"
13
14
LPWSTR token = NULL;
15
LPWSTR room = NULL;
src/claim/main.h
renamed
+1
-1
@@ -4,7 +4,7 @@
4
# define NETDATA_CLAIM_H_ 1
5
6
#include <wchar.h>
7
-#include "netdata_claim_window.h"
7
+#include "ui.h"
8
9
extern LPWSTR token;
10
extern LPWSTR room;
src/claim/ui.c
renamed
+1
-1
@@ -5,7 +5,7 @@
5
#include <windows.h>
6
#include "richedit.h"
7
#include "tchar.h"
8
-#include "netdata_claim.h"
8
+#include "main.h"
9
10
static LPCTSTR szWindowClass = _T("DesktopApp");
11