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

File Associations Broken on Windows #800

Closed
JoelProminic opened this issue Mar 29, 2021 · 14 comments
Closed

File Associations Broken on Windows #800

JoelProminic opened this issue Mar 29, 2021 · 14 comments

Comments

@JoelProminic
Copy link
Contributor

While testing #799, we noticed that Windows did not give the option to open .*proj or other files with Moonshine.

2021_03_29__FileAssociation_3_1_0

I can still open the files with Moonshine if I manually select Moonshine in the file chooser.

I installed the latest stable build (3.0.0), and found that it works fine. So, it seems this bug was not introduced with the NSIS installer change.

2021_03_29__FileAssociation_3_0_0

Could this bug be caused by the switch to Harman AIR (#773)?

@rat-moonshine
Copy link
Collaborator

Unfortunately, installing stable v3.0.0 on my Windows system didn't shown me any file-association either.

I tried to build current branch build using Adobe AIR 30.0, that also didn't shown me any file-association sign. ;/

@JoelProminic
Copy link
Contributor Author

I did some investigation for this with @rat-moonshine today.

I see that the commands for extensions are assoc and ftype.

C:\Users\JAnderson>assoc .xml
.xml=xmlfile

C:\Users\JAnderson>ftype xmlfile
xmlfile="C:\Program Files\Internet Explorer\iexplore.exe" %1

C:\Users\JAnderson>assoc .as3proj
.as3proj=Moonshine.Project.Configuration.File.1

C:\Users\JAnderson>ftype Moonshine.Project.Configuration.File.1
File type 'Moonshine.Project.Configuration.File.1' not found or no open command associated with it.

By my understanding, these mappings are defined by registry keys. I see the "file type" registry entires, but not the "ProgID"

C:\Users\JAnderson>reg query HKEY_CLASSES_ROOT /s /f "Moonshine"

HKEY_CLASSES_ROOT\.as
    (Default)    REG_SZ    Moonshine.ActionScript.File

HKEY_CLASSES_ROOT\.as3proj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.1

HKEY_CLASSES_ROOT\.awd
    (Default)    REG_SZ    Moonshine.AwayBuilder.File

HKEY_CLASSES_ROOT\.grailsproj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.4

HKEY_CLASSES_ROOT\.javaproj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.3

HKEY_CLASSES_ROOT\.mxml
    (Default)    REG_SZ    Moonshine.MXML.File

HKEY_CLASSES_ROOT\.veditorproj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.2

After some testing, we confirmed that the registry keys are not updating when Moonshine is installed. With a fresh Windows machine, no Moonshine registry keys are added.

Since we are using NSIS for the installer now, we probably need to have it manage the registry keys as well. The API is here.

@rat-moonshine
Copy link
Collaborator

File association on Windows now fixed with NSIS integration. This fix applied into master. Please, check.

@rat-moonshine rat-moonshine added the test ready Feature/bug ready for testing label Mar 31, 2021
@piotrzarzycki21
Copy link
Collaborator

piotrzarzycki21 commented Mar 31, 2021

File association on Windows now fixed with NSIS integration. This fix applied into master. Please, check.

@rat-moonshine Your changes may have been lost somehow due to some weird push from Bing to master. I have applied back what was on master before, but it looks like there is missing following commit e532d4f - You may have to apply it again.

rat-moonshine added a commit that referenced this issue Mar 31, 2021
@rat-moonshine
Copy link
Collaborator

I have re-committed my changes, should be good for a test now.

@JoelProminic
Copy link
Contributor Author

I confirmed that the registry keys were updated:

C:\Users\JAnderson>reg query HKEY_CLASSES_ROOT /s /f "Moonshine"

HKEY_CLASSES_ROOT\.as
    (Default)    REG_SZ    Moonshine.ActionScript.File

HKEY_CLASSES_ROOT\.as3proj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.1

HKEY_CLASSES_ROOT\.awd
    (Default)    REG_SZ    Moonshine.AwayBuilder.File

HKEY_CLASSES_ROOT\.css
    (Default)    REG_SZ    Moonshine.CSS.File

HKEY_CLASSES_ROOT\.grailsproj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.4

HKEY_CLASSES_ROOT\.htm
    (Default)    REG_SZ    Moonshine.HTML.File

HKEY_CLASSES_ROOT\.html
    (Default)    REG_SZ    Moonshine.HTML.File.2

...

HKEY_CLASSES_ROOT\Moonshine.ActionScript.File
    (Default)    REG_SZ    Moonshine.ActionScript.File

HKEY_CLASSES_ROOT\Moonshine.ActionScript.File\DefaultIcon
    (Default)    REG_SZ    C:\Program Files\Moonshine\Moonshine.exe,0

HKEY_CLASSES_ROOT\Moonshine.ActionScript.File\shell\edit
    (Default)    REG_SZ    Edit Moonshine.ActionScript.File

HKEY_CLASSES_ROOT\Moonshine.ActionScript.File\shell\edit\command
    (Default)    REG_SZ    "C:\Program Files\Moonshine\Moonshine.exe" "%1"

HKEY_CLASSES_ROOT\Moonshine.ActionScript.File\shell\open\command
    (Default)    REG_SZ    "C:\Program Files\Moonshine\Moonshine.exe" "%1"

I confirmed that the files opened automatically with Moonshine.

I'm a little concerned about setting Moonshine as the default for some common files (like .html). However, in my tests I saw that .html files still opened with Firefox by default, so this seems to be fine.

However, I did notice that registry keys were not cleaned up when Moonshine was uninstalled. For example, this means that .mxml files were still considered "Moonshine.MXML.File" even though Moonshine was no longer available. Does NSIS have an API for this as well?

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Apr 1, 2021

However, I did notice that registry keys were not cleaned up when Moonshine was uninstalled. For example, this means that .mxml files were still considered "Moonshine.MXML.File" even though Moonshine was no longer available. Does NSIS have an API for this as well?

It probably does, I just didn't removed the association during an uninstallation. I shall add the cleanup, if it's helpful to some cases.

@rat-moonshine
Copy link
Collaborator

I have added the unregistering steps for the Moonshine file-association during an uninstall on Windows. Please, check.

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Apr 2, 2021

Recently @JoelProminic reported that even after the un-installation and file-type-disassociation, command-line still reports leftover descriptions in registry:

$reg query HKEY_CLASSES_ROOT /s /f "Moonshine"

HKEY_CLASSES_ROOT\.as
    (Default)    REG_SZ    Moonshine.ActionScript.File

HKEY_CLASSES_ROOT\.as3proj
    (Default)    REG_SZ    Moonshine.Project.Configuration.File.1

HKEY_CLASSES_ROOT\.awd
    (Default)    REG_SZ    Moonshine.AwayBuilder.File

Those leftover descriptions now being removes during an un-installation and should return no value when the command run.

@JoelProminic
Copy link
Contributor Author

I confirmed that all the extension-related Moonshine registry keys were cleaned up when I uninstalled Moonshine.

@rat-moonshine
Copy link
Collaborator

@JoelProminic recently reported that double-clicking a project file from Explorer/Finder do focus Moonshine but nothing opens. I also confirm the similar behavior for known files.

I have now commit a fix, a new build should be ready for a test.

@rat-moonshine
Copy link
Collaborator

Earlier freeze scenario is now fixed with newest build. Please, check.

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Jan 16, 2024

I tested this today with latest build, and following are my test matrix. @JoelProminic please add, if any other point you may think. Else, I think we can close it.

Description Results
Moonshine-IDE associated files can be double-clicked to open in Moonshine Shows Moonshine icon on the files, double-clicking opens into Moonshine
Double-clicking a project file freeze the application No
Uninstalling Moonshine removes files association Previously associated Moonshine icon removes (needs a restart). Double-clicking opens system prompt to open with application

@piotrzarzycki21
Copy link
Collaborator

I have tested this today with my Windows 10 Home machine. I did test with Flex, Royale and JavaGradleProjects everything works fine. I'm closing issue - let's reopen it or move to another milestone in case of problems.

@piotrzarzycki21 piotrzarzycki21 removed the test ready Feature/bug ready for testing label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Moonshine-IDE - Bug Fixing
  
Awaiting triage
Development

No branches or pull requests

3 participants