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

Show icon and associate slicer with .mrb and .mrml files #3167

Open
slicerbot opened this issue Mar 12, 2020 · 3 comments
Open

Show icon and associate slicer with .mrb and .mrml files #3167

slicerbot opened this issue Mar 12, 2020 · 3 comments
Labels
good first issue Priority: Low Small, non-essential improvements or fixes Type: Enhancement Improvement to functionality
Milestone

Comments

@slicerbot
Copy link
Collaborator

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.

@lassoan lassoan added Priority: Low Small, non-essential improvements or fixes Type: Enhancement Improvement to functionality labels Mar 20, 2020
@lassoan lassoan added this to the Slicer 4.11.0 milestone Mar 20, 2020
@lassoan lassoan changed the title cosmetics for .mrb files Show icon and associate slicer with .mrb and .mrml files Mar 26, 2020
@lassoan
Copy link
Contributor

lassoan commented Mar 26, 2020

This works well in Windows.

@pieper has it ever worked on Mac?
@jcfr has it ever worked on Linux?

@jamesobutler
Copy link
Contributor

The code for how file association works on Windows. Unsure how it does on other platforms

# -------------------------------------------------------------------------
# File extensions
# -------------------------------------------------------------------------
set(FILE_EXTENSIONS .mrml .xcat .mrb)
if(FILE_EXTENSIONS)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS)
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS)
foreach(ext ${FILE_EXTENSIONS})
string(LENGTH "${ext}" len)
math(EXPR len_m1 "${len} - 1")
string(SUBSTRING "${ext}" 1 ${len_m1} ext_wo_dot)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
WriteRegStr SHCTX \\\"SOFTWARE\\\\Classes\\\\${APPLICATION_NAME}\\\" \\\"\\\" \\\"${APPLICATION_NAME} supported file\\\"
WriteRegStr SHCTX \\\"SOFTWARE\\\\Classes\\\\${APPLICATION_NAME}\\\\shell\\\\open\\\\command\\\" \
\\\"\\\" \\\"$\\\\\\\"$INSTDIR\\\\${EXECUTABLE_NAME}.exe$\\\\\\\" $\\\\\\\"%1$\\\\\\\"\\\"
WriteRegStr SHCTX \\\"SOFTWARE\\\\Classes\\\\${ext}\\\" \\\"\\\" \\\"${APPLICATION_NAME}\\\"
WriteRegStr SHCTX \\\"SOFTWARE\\\\Classes\\\\${ext}\\\" \\\"Content Type\\\" \\\"application/x-${ext_wo_dot}\\\"
")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
DeleteRegKey SHCTX \\\"SOFTWARE\\\\Classes\\\\${APPLICATION_NAME}\\\"
DeleteRegKey SHCTX \\\"SOFTWARE\\\\Classes\\\\${ext}\\\"
")
endforeach()
endif()
endif()

@pieper
Copy link
Member

pieper commented Mar 18, 2021

No, with the currently mac and linux don't get associations registered. Not a big deal to me, but I'm sure it could be done if anyone feels strongly about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Priority: Low Small, non-essential improvements or fixes Type: Enhancement Improvement to functionality
Development

No branches or pull requests

4 participants