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

Associate .3mf and .stl files with PrusaSlicer in Windows #8332

Open
2 tasks
ygoe opened this issue May 14, 2022 · 16 comments
Open
2 tasks

Associate .3mf and .stl files with PrusaSlicer in Windows #8332

ygoe opened this issue May 14, 2022 · 16 comments

Comments

@ygoe
Copy link

ygoe commented May 14, 2022

Description of the bug

.3mf files are not opened with any application in SpeedCommander. They also have no icon. When double-clicking, I get the error message that there is no application associated with this file type. When double-clicking in Windows Explorer, it opens in Paint 3D. I guess that's an error.

Similar problem for .stl files. No associated app for Speed Commander. Explorer at least asks how to open the file and includes PrusaSlicer in the options. I selected it and it opened so. Next time, it didn't ask but open in Paint 3D instead. Looks like Microsoft doesn't like PrusaSlicer for some obscure reason.

I already checked the program settings and enabled the corresponding option to associate PrusaSlicer with these formats. The setting is also saved for the next program start. But it has zero effect.

Project file & How to reproduce

All .3mf files

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

2.4.2+win64

Operating system

Windows 10 21H2

Printer model

Mini+ (irrelevant)

@ygoe ygoe changed the title Associate .3mf files with PrusaSlicer in Windows Associate .3mf and .stl files with PrusaSlicer in Windows May 14, 2022
@stepikovo
Copy link

Have you checked the settings in Windows? https://support.microsoft.com/en-us/windows/change-default-programs-in-windows-e5d82cad-17d1-c53b-3505-f10a32e1894d

It should look like this then and works fine
win

@bubnikv
Copy link
Collaborator

bubnikv commented May 16, 2022

One may certainly register PrusaSlicer manually. We implemented automatic registration into PrusaSlicer Windows build, however it may not work correctly as it manipulates registry the old way.

We should do https://techcommunity.microsoft.com/t5/ask-the-performance-team/how-to-configure-file-associations-for-it-pros/ba-p/1313151

@enricoturri1966 is responsible for that.

@ygoe
Copy link
Author

ygoe commented May 21, 2022

In the Windows settings, both file extensions had no default app. I could select PrusaSlicer from the list and now they open as expected. That's how I do it manually.

And what does the option in the PrusaSlicer settings do?

@bubnikv
Copy link
Collaborator

bubnikv commented May 23, 2022

We investigated the issue further. Since Windows 10 applications are no more allowed to register file extensions. Thus we will have to remove the option from PrusaSlicer settings.

We are investigating futher whether the installer will be allowed to register the file extension.

@ygoe
Copy link
Author

ygoe commented May 23, 2022

This isn't true, lots of other applications can do it as well. Maybe it's the API that has changed. Note that file extensions can be registered per system (required admin rights) or per user (works anytime).

@bubnikv
Copy link
Collaborator

bubnikv commented May 23, 2022 via email

@ygoe
Copy link
Author

ygoe commented May 23, 2022

Which applications can register their file extensions? At least in a way that Windows asks next time and suggests the new app in a list of alternatives? Umm, let me go through my installed applications...

  • Firefox (.html, .url) (same for Brave and Chrome if you wanted)
  • Visual Studio (.sln, .csproj, .cs and loads more)
  • DBeaver (.sql)
  • Inno Setup / Inno Script Studio (.iss)
  • OpenSCAD (.scad) (I think FreeCAD also has one, I haven't really used it yet)
  • Microsoft Office (.docx, .xlsx and loads more) (LibreOffice should also have a few)
  • Acrobat Reader (.pdf with some strange instructions)
  • Paint.NET (.png, .jpg ...)
  • Affinity Photo/Designer (.afphoto, .afdesign)
  • VLC (.mkv, .mp4 ...)
  • Notepad++ (.txt and anything you want, with manual setup within the app settings, not Windows)

I usually open files through a file commander (like Explorer) and not through the app itself, so I know when it doesn't work.

That's the most common apps. I don't know how they do it. Most of them are open source. Maybe you can investigate how Inno Setup does it, IIRC it has a command to register file extensions for the installed app. Also, Stack Overflow is a good resource to ask for advice. It's been a while since I last registered a file extension for one of my apps, but it did work in Windows 10 as before without problems.

After all, there's a registry branch that contains all the data. You can always write it yourself: HKEY_CURRENT_USER\SOFTWARE\Classes

This should work:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\.3mf]
@="Prusa.Slicer.1"

[HKEY_CURRENT_USER\SOFTWARE\Classes\Prusa.Slicer.1\Shell\Open\Command]
@="\"C:\\Program Files\\Prusa3D\\PrusaSlicer\\prusa-slicer.exe\" \"%1\""

And here's the Inno Setup script to register *.fl with my app. Seems to use the system-wide settings.

[Registry]
; Register .fl file name extension
Root: HKCR; Subkey: ".fl"; ValueType: string; ValueName: ""; ValueData: "FieldLogFile"; Flags: uninsdeletevalue 
Root: HKCR; Subkey: "FieldLogFile"; ValueType: string; ValueName: ""; ValueData: "FieldLog file"; Flags: uninsdeletekey
Root: HKCR; Subkey: "FieldLogFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\FieldLogViewer.exe,1"
Root: HKCR; Subkey: "FieldLogFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\FieldLogViewer.exe"" ""%1"""
Root: HKCR; Subkey: "FieldLogFile\shell\opensingle"; ValueType: string; ValueName: ""; ValueData: "{cm:OpenSingleFileCommand}"
Root: HKCR; Subkey: "FieldLogFile\shell\opensingle\command"; ValueType: string; ValueName: ""; ValueData: """{app}\FieldLogViewer.exe"" /s ""%1"""

; Add to .fl "Open with" menu
Root: HKCR; Subkey: ".fl\OpenWithList\FieldLogViewer.exe"; ValueType: string; ValueName: ""; ValueData: ""; Flags: uninsdeletekey
Root: HKCR; Subkey: "Applications\FieldLogViewer.exe"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "FieldLogViewer"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Applications\FieldLogViewer.exe\shell\open"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "FieldLogViewer"
Root: HKCR; Subkey: "Applications\FieldLogViewer.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\FieldLogViewer.exe"" ""%1"""

@bubnikv
Copy link
Collaborator

bubnikv commented May 23, 2022 via email

@bubnikv
Copy link
Collaborator

bubnikv commented May 23, 2022 via email

@ygoe
Copy link
Author

ygoe commented May 23, 2022

Hm, I thought that installers were just applications, too. (I'm talking about Inno Setup, Nullsoft Installer or other custom installers, not that MSI crap.) The registry API is available to all processes, within their user account privilege limits. And the current_user hive is certainly writeable by the user, that's what it's there for. It means that format associations are only set for the current user, not all users on the system, but that's totally fine actually. It doesn't matter if it's the installer or the app itself that does the association, it's just a matter of user experience. The installer provides a little more comfort and an easy start (and can register for all users if already installing for all users as admin); the app setting allows easy later changes. I'm fine with either one.

And tell me more about that "registry signing"? Never heard of that.

@bubnikv
Copy link
Collaborator

bubnikv commented May 24, 2022 via email

@bubnikv
Copy link
Collaborator

bubnikv commented May 24, 2022 via email

@bubnikv
Copy link
Collaborator

bubnikv commented May 24, 2022 via email

enricoturri1966 added a commit that referenced this issue May 25, 2022
…rusaSlicer as default application for .3mf and .stl files and GCodeViewer as default application for .gcode files
@bubnikv
Copy link
Collaborator

bubnikv commented Oct 11, 2022 via email

@lukasmatena
Copy link
Collaborator

We tried to fix this in 2.6.0-alpha2. Feedback is appreciated.

@Ali229
Copy link

Ali229 commented Feb 2, 2023

I'm not 100% if this is the same issue but I cannot open .stl files using prusa slicer 2.6.0-alpha2.
Reproduced by:

  1. Right click stl file go to properties> change open with and set to prusa slicer 2.6.0-alpha2.
  2. Open the stl file
  3. Get prompt "Select an app to open this .stl file" (selecting prusa-slicer from the list shows this prompt again)

Not sure if this is caused by multiple installations (both alpha and stable), I tried removing others but issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants