R7.9: Explorer's New makes docx, xlsx, pptx and md on Windows
Each app installs a blank file and points ShellNew at it. Explorer lists a type only through its default class, so a type no program handles (no default, or one naming no class) gets the app's class; an installed handler is never replaced. Uninstall removes only what this install wrote. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2f971c646f
commit
632a66eb46
11 files changed
+80
-5
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Writes packaging/windows/new: the blank files Explorer's New makes.
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")/../.." && pwd)
|
||||
soffice=$root/engines/lo-src/instdir/program/soffice.com
|
||||
[ -x "$soffice" ] || {
|
||||
echo "templates.sh: no kernel at $soffice; run scripts/build-libreoffice.sh" >&2
|
||||
exit 1
|
||||
}
|
||||
out=$root/packaging/windows/new
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
mkdir "$work/in"
|
||||
# The kernel reads an empty file as a new document.
|
||||
for ext in docx xlsx pptx; do
|
||||
: >"$work/in/new.$ext"
|
||||
"$soffice" --headless --norestore "-env:UserInstallation=file:///$(cygpath -m "$work/profile")" \
|
||||
--convert-to "$ext" --outdir "$(cygpath -w "$out")" "$(cygpath -w "$work/in/new.$ext")"
|
||||
[ -s "$out/new.$ext" ] || {
|
||||
echo "templates.sh: the kernel wrote no new.$ext" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
: >"$out/new.md"
|
||||
Reference in new issue
Block a user