Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.53k stars 174 forks source link

Cudatext shell extension caused explorer to crash #3627

Closed ghost closed 4 months ago

ghost commented 3 years ago

With the shell extension installed using the shipped batch script, whenever you select more than one file (regardless if they are text files or not) using Ctrl + click and then right click on the selected explorer will be crashed and asked to be restarted. The problem doesn't happen before the Cudatext shell extension installed.

It's latest Cudatext downloaded from Fosshub, for Windows 64 bit and running on Windows 7 64 bit. I observed something very strange. This shell extension doesn't detect if the file is text file or not, regardless of the file type it will show Open with Cudatext, for zip archives, binary files and as I recall (could be wrong) when you right click on folder or disk drive the Open with Cudatext still appears!

Please rework the Cudatext shell extension. Thanks.

Forum thread: http://synwrite.sourceforge.net/forums/viewtopic.php?f=5&t=2716

Alexey-T commented 3 years ago

@dinkumoil

Alexey-T commented 3 years ago

@altPOCA Please see https://wiki.freepascal.org/CudaText#Troubleshooting_the_Windows_shell_extension_for_CudaText

ghost commented 3 years ago

@altPOCA Please see https://wiki.freepascal.org/CudaText#Troubleshooting_the_Windows_shell_extension_for_CudaText

Doesn't help. I put it clearly I use Windows 7 64 bit and CudaText 64 bit, the shell extension of the 64 bit CudaText is also 64 bit. The main problem to be focus on which is really a bug is when you select more than one file with the CudaText shell extension installed, you right click on them and explorer will crash. Uninstall the CudaText shell extension and everything is back to normal again.

The later part IMHO is just a design flaw when this Open with CudaText is applicable to even folder and disk drive. Imagine what would happen when you open a disk drive with CudaText? CudaText will be served as a file manager? Or it will open all files on this drive? Or it just do nothing? It's really bad design when doing so. I know CudaText has an embedded Hex editor but why don't create another entry named Open with CudaText (hex editor) and preserve Open with CudaText only for text files?

Alexey-T commented 3 years ago

About opening folder and drives-- Cud opens a folder (or D:\ root folder) in its Project Manager panel. Like other VSCode/Atom can do. About the crash - I wait for @dinkumoil

dinkumoil commented 3 years ago

@altPOCA

Author of CudaText shell extension here.

CudaText opens folders and drives because these features were requested by users and the author of CudaText (@Alexey-T ) himself. If you think this is a design flaw, that's only your opinion which is obviously based on lack of information - as @Alexey-T already wrote, standard Project Manager plugin (included in every CudaText installation) processes opening of drives and folders with CudaText.

Regarding your crash issue: I use Windows 7 x64 too as my daily work system (Win 7 Ultimate x64, german edition to be exact) and of course I also installed my own shell extension. I'm not facing any crash at all caused by the shell extension. Moreover, there are presumably many users world wide who use my shell extension and noone reported crashes yet. So, it must be something special with your system configuration.

Since I can not look at your machine, the only thing you can do is to think about exactly that: What is different/special with your machine? This could be nearly everything: Non-standard Windows theme, tools for Windows UI customizations, other shell extensions or how much of them are installed on your machine, maybe it is something completely different. Try to change everything what comes to your mind back to a more "default-state" until the crash behavior is gone. Maybe you should also read again the complete troubleshooting guide @Alexey-T already pointed you to to ensure that your installation's state is as it should be.

Don't get me wrong, I'm interested in finding the cause for this issue but I need your help. Unless I can reproduce your issue I'm not able to help.

ghost commented 3 years ago

@altPOCA

Author of CudaText shell extension here.

CudaText opens folders and drives because these features were requested by users and the author of CudaText (@Alexey-T ) himself. If you think this is a design flaw, that's only your opinion which is obviously based on lack of information - as @Alexey-T already wrote, standard Project Manager plugin (included in every CudaText installation) processes opening of drives and folders with CudaText.

Regarding your crash issue: I use Windows 7 x64 too as my daily work system (Win 7 Ultimate x64, german edition to be exact) and of course I also installed my own shell extension. I'm not facing any crash at all caused by the shell extension. Moreover, there are presumably many users world wide who use my shell extension and noone reported crashes yet. So, it must be something special with your system configuration.

Since I can not look at your machine, the only thing you can do is to think about exactly that: What is different/special with your machine? This could be nearly everything: Non-standard Windows theme, tools for Windows UI customizations, other shell extensions or how much of them are installed on your machine, maybe it is something completely different. Try to change everything what comes to your mind back to a more "default-state" until the crash behavior is gone. Maybe you should also read again the complete troubleshooting guide @Alexey-T already pointed you to to ensure that your installation's state is as it should be.

Don't get me wrong, I'm interested in finding the cause for this issue but I need your help. Unless I can reproduce your issue I'm not able to help.

It's really your shell extension. Remove it (also via your provided batch script) and everything is back to normal. Maybe I'm just bad luck :smile:

dinkumoil commented 3 years ago

@altPOCA

Maybe I'm just bad luck

For sure you are impolite and not willing to try some things to help me helping you. Thus, I don't want to waste my time any longer. Case closed, I'm out.

ghost commented 3 years ago

@altPOCA

Maybe I'm just bad luck

For sure you are impolite and not willing to try some things to help me helping you. Thus, I don't want to waste my time any longer. Case closed, I'm out.

I can't see where I'm impolite. Thing is that and simple as that. If you can't reproduce then it's something wrong on my system or I'm just bad luck. Code sometimes could fail a mysterious way. I have no idea what's wrong with my system since I did nothing wrong with it and I don't have the ability to investigate it further so let's consider I'm just bad luck. I'm quit, too.

BTW, removed CudaText and go for Geany. More sane. Will not display Open with Geany on disk drives and folders. Bye.

Alexey-T commented 3 years ago

Sad. Maybe you can write, where "Geany is more sane", excluding the shell extension... maybe we'll fix that.

GeniusBroccoli commented 10 months ago

On Windows 11 the install shell script cyclically restarts, so I need to kill the process in the task manager.

Alexey-T commented 10 months ago

@dinkumoil Do you observe this bug? https://github.com/Alexey-T/CudaText/issues/3627#issuecomment-1857673900

dinkumoil commented 10 months ago

@Alexey-T : I don't have access to a Windows 11 system, so I cannot test.

@GeniusBroccoli : The only possible reason for your issue that comes to my mind is that the automatic restart of the install script into admin mode fails for some reason. Is it possible that on your Windows 11 machine VBScript or even the wohle Windows Script Host feature is deactivated? However, you can overcome the problem by starting the install script with admin rights, then it should not try to restart itself to be able to install the shell extension.

But in general, I don't know if the shell extension is even able to run on Windows 11 because it uses the old technique of shell extensions that was valid up to Windows 10. If you install it on Windows 11, it will show up only in a submenu of Explorer context menu at its best.

GeniusBroccoli commented 10 months ago

@dinkumoil I run it with admin rights and have similar issue. I try to test it later with clean installed Windows 10/11.

GeniusBroccoli commented 10 months ago

I don't test it on clear W10/11. I can register shell with simple bat file in the CudaText dir regsvr32 %~dp0cudatext_shell64.dll. P.S. I use tweak, that enables old drop down menu in Windows 11, then I am not interested registration in modern menu.

dinkumoil commented 8 months ago

@Alexey-T I pushed a fix for upcoming installation/uninstallation problems of the shell extension on new versions of Windows 11 into my CudaText Shell Extension repo. You should update the install/uninstall scripts you provide with your distribution of CudaText with the new versions.

Background: https://techcommunity.microsoft.com/t5/windows-it-pro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/ba-p/4039242

Alexey-T commented 8 months ago

Thanks for your support. I will update all 4 cmd-scripts (2 for x64 version) in the next Cud release.