Skip to content

Commit 9a0fc9f

Browse files
committed
More script fixes.
1 parent 9763ffa commit 9a0fc9f

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

scripts/patch-nsis-paths.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
"$local_root$rest"
4545
/ge;
4646

47+
# Remove the /a flag from File directives — it sets Windows file attributes
48+
# and is silently skipped on non-Windows, causing files to not be included.
49+
my $fa_count = 0;
50+
$fa_count++ while $content =~ /\bFile\s+\/a\b/g;
51+
$content =~ s/\bFile\s+\/a\b/File/g;
52+
print "Removed $fa_count 'File /a' flags (unsupported on non-Windows)\n" if $fa_count;
53+
4754
open my $out, '>', $nsi_file or die "Cannot write $nsi_file: $!";
4855
print $out $content;
4956
close $out;

scripts/sign-and-deploy.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,15 @@ rebuild_windows_installer() {
204204
log "Rebuilding NSIS installer: $installer_name"
205205
(
206206
cd "$script_dir"
207-
makensis -NOCD -X"OutFile $installer_name" "$(basename "$script_path")"
207+
makensis -NOCD "$(basename "$script_path")"
208208
)
209209

210-
local output_path="$script_dir/$installer_name"
211-
[[ -f "$output_path" ]] || error "NSIS rebuild did not produce $installer_name"
212-
mv "$output_path" "$installer_path"
210+
# makensis outputs whatever filename the .nsi defines; find it
211+
local output_exe
212+
output_exe=$(find "$script_dir" -maxdepth 1 -name "*.exe" -newer "$script_path" | head -1)
213+
[[ -n "$output_exe" ]] || error "NSIS rebuild did not produce an installer"
214+
log "NSIS produced: $(basename "$output_exe")"
215+
mv "$output_exe" "$installer_path"
213216
}
214217

215218
resolve_tag_sha() {
@@ -259,7 +262,7 @@ download_artifacts_from_run() {
259262
if gh run download "$run_id" \
260263
--repo "$GITHUB_REPO" \
261264
--name "$name" \
262-
--dir "$DOWNLOAD_DIR"; then
265+
--dir "$DOWNLOAD_DIR/$name"; then
263266
touch "$DOWNLOAD_DIR/.downloaded-$name"
264267
log " $name: done"
265268
else

0 commit comments

Comments
 (0)