Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows GUI: Fix shell extension registries #968

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Source/Common/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,10 @@ int Preferences::ExplorerShell()
}
}
}
ExplorerShell_Edit("SystemFileAssociations\\audio", 0, IsChanged);
ExplorerShell_Edit("SystemFileAssociations\\Directory.Audio", 0, IsChanged);
ExplorerShell_Edit("SystemFileAssociations\\Directory.Video", 0, IsChanged);
ExplorerShell_Edit("SystemFileAssociations\\video", 0, IsChanged);
JeromeMartinez marked this conversation as resolved.
Show resolved Hide resolved
ExplorerShell_Edit("Software\\Classes\\SystemFileAssociations\\audio", 0, IsChanged);
ExplorerShell_Edit("Software\\Classes\\SystemFileAssociations\\Directory.Audio", 0, IsChanged);
ExplorerShell_Edit("Software\\Classes\\SystemFileAssociations\\Directory.Video", 0, IsChanged);
ExplorerShell_Edit("Software\\Classes\\SystemFileAssociations\\video", 0, IsChanged);

//Adding/removing to SystemFileAssociations
int32s ShellExtension=Config.Read(__T("ShellExtension")).To_int32s();
Expand Down
22 changes: 15 additions & 7 deletions Source/Install/MediaInfo_Extensions.nsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif

!macro MediaInfo_Extensions_Install_I Extension
; Old InfoTip
DeleteRegKey HKCR "${Extension}\shellex\{00021500-0000-0000-C000-000000000046}"
Expand Down Expand Up @@ -37,10 +44,13 @@
; Removing unwanted entries
!insertmacro MediaInfo_Extensions_Uninstall_I "Directory.Audio"
!insertmacro MediaInfo_Extensions_Uninstall_I "Directory.Video"
!insertmacro MediaInfo_Extensions_Uninstall_I "audio"
!insertmacro MediaInfo_Extensions_Uninstall_I "Folder"
!insertmacro MediaInfo_Extensions_Uninstall_I "video"

; directories
WriteRegStr HKCU "Software\Classes\Directory\Shell\MediaInfo" "Icon" "$INSTDIR\MediaInfo.exe"
WriteRegStr HKCU "Software\Classes\Directory\\Shell\MediaInfo\Command" "" "$\"$INSTDIR\MediaInfo.exe$\" $\"%1$\""
WriteRegStr HKCU "Software\Classes\Directory\Shell\MediaInfo\Command" "" "$\"$INSTDIR\MediaInfo.exe$\" $\"%1$\""

; Per item
!insertmacro MediaInfo_Extensions_Install_I ".264"
Expand Down Expand Up @@ -198,9 +208,8 @@
!insertmacro MediaInfo_Extensions_Install_I ".wvc"
!insertmacro MediaInfo_Extensions_Install_I ".y4m"

!insertmacro MediaInfo_Extensions_Install_I "audio"
!insertmacro MediaInfo_Extensions_Install_I "Folder"
!insertmacro MediaInfo_Extensions_Install_I "video"
; Notify Windows Shell to refresh
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
!macroend

!macro MediaInfo_Extensions_Uninstall
Expand Down Expand Up @@ -371,7 +380,6 @@
!insertmacro MediaInfo_Extensions_Uninstall_I ".wvc"
!insertmacro MediaInfo_Extensions_Uninstall_I ".y4m"

!insertmacro MediaInfo_Extensions_Uninstall_I "audio"
!insertmacro MediaInfo_Extensions_Uninstall_I "Folder"
!insertmacro MediaInfo_Extensions_Uninstall_I "video"
; Notify Windows Shell to refresh
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
!macroend
Loading