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
@@ -10,11 +10,16 @@ progid="ElyOffice.$name"
|
||||
classes='Software\Classes'
|
||||
exts=$(awk -F'\t' -v slug="$slug" '$1 == slug && $2 != "/" { print $2 }' "$root/packaging/types.tsv")
|
||||
folder=$(awk -F'\t' -v slug="$slug" '$1 == slug && $2 == "/" { print "yes" }' "$root/packaging/types.tsv")
|
||||
# Types Explorer's New menu makes, from packaging/windows/new.
|
||||
fresh=""
|
||||
for ext in $exts; do
|
||||
[ ! -e "$root/packaging/windows/new/new.$ext" ] || fresh="$fresh $ext"
|
||||
done
|
||||
|
||||
# Open With lists the app; the user's default stays theirs.
|
||||
echo '!macro ElyTypesInstall'
|
||||
if [ -n "$exts" ]; then
|
||||
echo " WriteRegStr HKCU \"$classes\\$progid\" \"\" \"$name\""
|
||||
echo " WriteRegStr HKCU \"$classes\\$progid\" \"\" \"$name Document\""
|
||||
echo " WriteRegStr HKCU \"$classes\\$progid\\DefaultIcon\" \"\" \"\$INSTDIR\\$slug.ico\""
|
||||
echo " WriteRegStr HKCU \"$classes\\$progid\\shell\\open\\command\" \"\" '\"\$INSTDIR\\$slug.exe\" \"%1\"'"
|
||||
echo " WriteRegStr HKCU \"$classes\\Applications\\$slug.exe\" \"FriendlyAppName\" \"$name\""
|
||||
@@ -23,6 +28,20 @@ if [ -n "$exts" ]; then
|
||||
echo " WriteRegStr HKCU \"$classes\\Applications\\$slug.exe\\SupportedTypes\" \".$ext\" \"\""
|
||||
done
|
||||
fi
|
||||
for ext in $fresh; do
|
||||
echo " WriteRegStr HKCU \"$classes\\.$ext\\ShellNew\" \"FileName\" \"\$INSTDIR\\new.$ext\""
|
||||
# New needs a class; take only a handlerless type.
|
||||
echo " ReadRegStr \$0 HKCR \".$ext\" \"\""
|
||||
echo " ClearErrors"
|
||||
# A default naming no class handles nothing either.
|
||||
echo " \${If} \$0 != \"\""
|
||||
echo " EnumRegKey \$1 HKCR \"\$0\" 0"
|
||||
echo " \${EndIf}"
|
||||
echo " \${If} \$0 == \"\""
|
||||
echo " \${OrIf} \${Errors}"
|
||||
echo " WriteRegStr HKCU \"$classes\\.$ext\" \"\" \"$progid\""
|
||||
echo " \${EndIf}"
|
||||
done
|
||||
if [ -n "$folder" ]; then
|
||||
echo " WriteRegStr HKCU \"$classes\\Directory\\shell\\$progid\" \"\" \"Open in $name\""
|
||||
echo " WriteRegStr HKCU \"$classes\\Directory\\shell\\$progid\" \"Icon\" \"\$INSTDIR\\$slug.ico\""
|
||||
@@ -39,6 +58,17 @@ if [ -n "$exts" ]; then
|
||||
echo " DeleteRegValue HKCU \"$classes\\.$ext\\OpenWithProgids\" \"$progid\""
|
||||
done
|
||||
fi
|
||||
# Only what this install wrote.
|
||||
for ext in $fresh; do
|
||||
echo " ReadRegStr \$0 HKCU \"$classes\\.$ext\\ShellNew\" \"FileName\""
|
||||
echo " \${If} \$0 == \"\$INSTDIR\\new.$ext\""
|
||||
echo " DeleteRegKey HKCU \"$classes\\.$ext\\ShellNew\""
|
||||
echo " \${EndIf}"
|
||||
echo " ReadRegStr \$0 HKCU \"$classes\\.$ext\" \"\""
|
||||
echo " \${If} \$0 == \"$progid\""
|
||||
echo " DeleteRegValue HKCU \"$classes\\.$ext\" \"\""
|
||||
echo " \${EndIf}"
|
||||
done
|
||||
if [ -n "$folder" ]; then
|
||||
echo " DeleteRegKey HKCU \"$classes\\Directory\\shell\\$progid\""
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user