Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

Commit 024953c

Browse files
author
Merrick Zhang
committed
Add Windows Modern Theme support and update NSIS installer configuration
1. Update GitHub Actions workflow to build locale projects for all architectures 2. Enhance NSIS script with Modern User Interface support 3. Add logic to automatically determine platform directory based on ARCH variable 4. Fix locale file paths for different architectures 5. Add component page and improve installation UI
1 parent 9c8ba21 commit 024953c

File tree

2 files changed

+89
-2
lines changed

2 files changed

+89
-2
lines changed

.github/workflows/build-and-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
run: |
3030
$outDir = "build/bin/${{ matrix.configuration }}/${{ matrix.platform }}"
3131
msbuild build/VisualStudio/Notepad4.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:OutDir=$outDir\ /verbosity:minimal
32+
msbuild locale/Locale.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:OutDir=$outDir\ /verbosity:minimal
3233
3334
- name: Debug - List directory structure after build
3435
run: |

build/Notepad4.nsi

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,48 @@
55
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
66
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
77

8+
!include "x64.nsh"
9+
810
!include "MUI2.nsh"
911

12+
; MUI General Settings
1013
!define MUI_ABORTWARNING
1114
!define MUI_ICON "..\res\Notepad4.ico"
12-
; !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\uninstall.ico"
15+
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
16+
!define MUI_HEADERIMAGE
17+
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
18+
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
19+
!define MUI_COMPONENTSPAGE_SMALLDESC
1320

21+
; Page Settings
22+
!insertmacro MUI_PAGE_WELCOME
23+
!insertmacro MUI_PAGE_LICENSE "..\License.txt"
24+
!insertmacro MUI_PAGE_COMPONENTS
1425
!insertmacro MUI_PAGE_DIRECTORY
1526
!insertmacro MUI_PAGE_INSTFILES
27+
!insertmacro MUI_PAGE_FINISH
1628

29+
; Uninstall Page Settings
30+
!insertmacro MUI_UNPAGE_WELCOME
1731
!insertmacro MUI_UNPAGE_CONFIRM
1832
!insertmacro MUI_UNPAGE_INSTFILES
33+
!insertmacro MUI_UNPAGE_FINISH
1934

35+
; Language Settings
2036
!insertmacro MUI_LANGUAGE "English"
2137

2238
Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${ARCH})"
2339
OutFile "${OUTPUT_FILE}"
2440
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
2541
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Path"
2642

27-
Section "MainSection" SEC01
43+
; Component page configuration
44+
!define MUI_COMPONENTSPAGE_NODESC
45+
46+
Section "Notepad4 Main Program" SEC_MAIN
47+
SectionIn RO
2848
SetOutPath "$INSTDIR"
49+
; Use SOURCE_DIR variable passed from command line
2950
File "${SOURCE_DIR}\Notepad4.exe"
3051
File "${SOURCE_DIR}\matepath.exe"
3152

@@ -35,11 +56,76 @@ Section "MainSection" SEC01
3556
WriteUninstaller "$INSTDIR\uninstall.exe"
3657
SectionEnd
3758

59+
Section "Language Packs" SEC_LOCALE
60+
; Build locale path using ARCH variable
61+
; Actual locale path: build\bin\Release\{platform}\locale\
62+
63+
; Set base directory for locales
64+
!define LOCALE_BASE_DIR "..\build\bin\Release"
65+
66+
; Determine platform directory based on ARCH variable
67+
!ifdef ARCH
68+
!if "${ARCH}" == "x86"
69+
!define PLATFORM_DIR "Win32"
70+
!elseif "${ARCH}" == "x64"
71+
!define PLATFORM_DIR "x64"
72+
!elseif "${ARCH}" == "arm64"
73+
!define PLATFORM_DIR "ARM64"
74+
!else
75+
!define PLATFORM_DIR "Win32"
76+
!endif
77+
!else
78+
!define PLATFORM_DIR "Win32"
79+
!endif
80+
81+
; Build full locale directory path
82+
!define LOCALE_FULL_DIR "${LOCALE_BASE_DIR}\${PLATFORM_DIR}\locale"
83+
84+
SetOutPath "$INSTDIR\locale\de"
85+
File /r "${LOCALE_FULL_DIR}\de\*.dll"
86+
87+
SetOutPath "$INSTDIR\locale\fr"
88+
File /r "${LOCALE_FULL_DIR}\fr\*.dll"
89+
90+
SetOutPath "$INSTDIR\locale\it"
91+
File /r "${LOCALE_FULL_DIR}\it\*.dll"
92+
93+
SetOutPath "$INSTDIR\locale\ja"
94+
File /r "${LOCALE_FULL_DIR}\ja\*.dll"
95+
96+
SetOutPath "$INSTDIR\locale\ko"
97+
File /r "${LOCALE_FULL_DIR}\ko\*.dll"
98+
99+
SetOutPath "$INSTDIR\locale\pl"
100+
File /r "${LOCALE_FULL_DIR}\pl\*.dll"
101+
102+
SetOutPath "$INSTDIR\locale\pt-BR"
103+
File /r "${LOCALE_FULL_DIR}\pt-BR\*.dll"
104+
105+
SetOutPath "$INSTDIR\locale\ru"
106+
File /r "${LOCALE_FULL_DIR}\ru\*.dll"
107+
108+
SetOutPath "$INSTDIR\locale\zh-Hans"
109+
File /r "${LOCALE_FULL_DIR}\zh-Hans\*.dll"
110+
111+
SetOutPath "$INSTDIR\locale\zh-Hant"
112+
File /r "${LOCALE_FULL_DIR}\zh-Hant\*.dll"
113+
SectionEnd
114+
115+
; Component descriptions
116+
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
117+
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MAIN} "Notepad4 main program and matepath tool"
118+
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALE} "Multi-language support files"
119+
!insertmacro MUI_FUNCTION_DESCRIPTION_END
120+
38121
Section "Uninstall"
39122
Delete "$INSTDIR\uninstall.exe"
40123
Delete "$INSTDIR\Notepad4.exe"
41124
Delete "$INSTDIR\matepath.exe"
42125

126+
; Delete locale folders
127+
RMDir /r "$INSTDIR\locale"
128+
43129
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
44130
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
45131

0 commit comments

Comments
 (0)