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

Commit c25609b

Browse files
author
Merrick Zhang
committed
Fix build and release workflow issues
1 parent 024953c commit c25609b

File tree

3 files changed

+20
-83
lines changed

3 files changed

+20
-83
lines changed

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

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,22 @@ jobs:
4141
4242
- name: Copy built files
4343
run: |
44-
# Try different possible output directories
45-
$possibleDirs = @(
46-
"build/bin/${{ matrix.configuration }}/${{ matrix.platform }}",
47-
"bin/${{ matrix.configuration }}/${{ matrix.platform }}",
48-
"build/VisualStudio/${{ matrix.configuration }}/${{ matrix.platform }}",
49-
"${{ matrix.configuration }}/${{ matrix.platform }}"
50-
)
44+
# Use the exact output directory we specified in msbuild
45+
$srcDir = "build/bin/${{ matrix.configuration }}/${{ matrix.platform }}"
46+
$destDir = "output/${{ matrix.platform }}"
5147
52-
$srcDir = $null
53-
foreach ($dir in $possibleDirs) {
54-
if (Test-Path "$dir\Notepad4.exe") {
55-
$srcDir = $dir
56-
break
57-
}
58-
}
59-
60-
if ($srcDir) {
48+
if (Test-Path "$srcDir\Notepad4.exe") {
6149
Write-Host "Found Notepad4.exe in: $srcDir"
62-
$destDir = "output/${{ matrix.platform }}"
6350
Copy-Item -Path "$srcDir\Notepad4.exe" -Destination "$destDir"
6451
Copy-Item -Path "$srcDir\matepath.exe" -Destination "$destDir"
52+
# Also copy locale folder if it exists
53+
if (Test-Path "$srcDir\locale") {
54+
Copy-Item -Path "$srcDir\locale" -Destination "$destDir" -Recurse
55+
}
6556
} else {
66-
Write-Error "Could not find Notepad4.exe in any of the possible directories"
57+
Write-Error "Could not find Notepad4.exe in $srcDir"
58+
# List directory structure for debugging
59+
Get-ChildItem -Path "." -Recurse -File | Where-Object { $_.Name -match "\.exe$" } | Select-Object FullName
6760
exit 1
6861
}
6962

build/Notepad4.nsi

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -57,59 +57,18 @@ Section "Notepad4 Main Program" SEC_MAIN
5757
SectionEnd
5858

5959
Section "Language Packs" SEC_LOCALE
60-
; Build locale path using ARCH variable
61-
; Actual locale path: build\bin\Release\{platform}\locale\
60+
; Use locale directory from SOURCE_DIR (already copied by previous step)
61+
; SOURCE_DIR points to output/{platform} which contains locale subdirectory
6262

63-
; Set base directory for locales
64-
!define LOCALE_BASE_DIR "..\build\bin\Release"
63+
; Check if locale directory exists
64+
IfFileExists "${SOURCE_DIR}\locale" +2 0
65+
Goto end_locale_section
6566

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"
67+
; Copy entire locale directory recursively
68+
SetOutPath "$INSTDIR"
69+
File /r "${SOURCE_DIR}\locale\*"
11070

111-
SetOutPath "$INSTDIR\locale\zh-Hant"
112-
File /r "${LOCALE_FULL_DIR}\zh-Hant\*.dll"
71+
end_locale_section:
11372
SectionEnd
11473

11574
; Component descriptions

build/VisualStudio/Notepad4.vcxproj

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@
3939
<ConfigurationType>Application</ConfigurationType>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
42-
<PropertyGroup Condition="'$(Configuration)'=='Release' or '$(Configuration)'=='AVX2Release' or '$(Configuration)'=='AVX512Release'" Label="Configuration">
43-
<UseDebugLibraries>false</UseDebugLibraries>
44-
<WholeProgramOptimization>true</WholeProgramOptimization>
45-
</PropertyGroup>
46-
<PropertyGroup Condition="$(Configuration.EndsWith('LLVMRelease'))" Label="Configuration">
47-
<UseDebugLibraries>false</UseDebugLibraries>
48-
</PropertyGroup>
49-
<PropertyGroup Condition="'$(Configuration)'=='Debug' or '$(Configuration)'=='AVX2Debug' or '$(Configuration)'=='AVX512Debug'" Label="Configuration">
50-
<UseDebugLibraries>true</UseDebugLibraries>
51-
</PropertyGroup>
52-
<PropertyGroup Condition="$(Configuration.EndsWith('LLVMDebug'))" Label="Configuration">
53-
<UseDebugLibraries>true</UseDebugLibraries>
54-
</PropertyGroup>
5542
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5643
<PlatformToolset>v143</PlatformToolset>
5744
</PropertyGroup>
@@ -75,8 +62,6 @@
7562
<PropertyGroup>
7663
<LinkIncremental Condition="$(Configuration.EndsWith('Debug'))">true</LinkIncremental>
7764
<LinkIncremental Condition="$(Configuration.EndsWith('Release'))">false</LinkIncremental>
78-
<OutDir Condition="!$(Configuration.StartsWith('AVX'))">$(SolutionDir)..\bin\$(Configuration)\$(Platform)\</OutDir>
79-
<IntDir Condition="!$(Configuration.StartsWith('AVX'))">$(SolutionDir)..\bin\$(Configuration)\$(Platform)\obj\$(ProjectName)\</IntDir>
8065
<GenerateManifest>false</GenerateManifest>
8166
</PropertyGroup>
8267
<PropertyGroup Condition="$(Configuration.EndsWith('Release'))">

0 commit comments

Comments
 (0)