Giter VIP home page Giter VIP logo

Comments (22)

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

Interested in doing a fix and PR? I have no win 7 machine to test, not really looking forward creating a win 7 vm at the moment.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

Yes I am :-) I can test that is no problem but I have no clue what is going on. We tried on our own code desperately (already spend more than 10 hours in investigating and looking for solutions) Do you have a clue why this COM call seems to be a problem?

A hint is enough if I have a new idea then I can implement and test.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

I forgot to mention one hint could be that the appplication is in the registry in the list of registered programs but in the Microsoft GUI it does not appear (if started manually). This could be a good hint that something is missing...

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

On all machines or just 1 ?

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

Is it a German workstation?

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

0x80070057 = E_INVALIDARG = One or more arguments are not valid

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

German locale and English version on several machines (3 tested, 3 failed) I found the meaning in MSDN docs also but it's not clear what arguments. I just give one argument, the name of the registered app. I thought again about it I'll go systematically through by checking:

1- if it works for another registered app I can see in the MS GUI if manually started
2- look at the differences in the settings in the registry

Then I should be able to solve that issue. It's quite late here already and I fear I'll only be able to work again on that topic next week. Thanks!

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

Had a look at it this morning, it works if I put all regkeys under HKLM... This is not a good solution. I try to find out if there is a way to make it work with keys under HKCU but it does not look promising. With ProcessMonitor I saw that windows does not even try reading out RegisteredApplications from HKCU...

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

The idea of putting it in HKCU is that the users can access it (without admin rights) :-)

Weird, because the demo example works on windows 8 / windows 10.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

Yes it's quite annoying... I also read that for Windows 10 changes were/are?? planned.

https://blogs.windows.com/windowsexperience/2015/05/20/announcing-windows-10-insider-preview-build-10122-for-pcs/

"We know your defaults matter to you. With Windows 10, all apps – both Classic Windows apps and Universal Windows apps – will be unable to invoke a prompt to change your defaults, only Windows. You remain in full control of your default experiences, while reducing some of the unwanted noise that multiple prompts can bring."

Would you agree to have an opt-in "legacy mode": in order to make these application registration "manually" I know this is not recommended by MS but it seems the only way to be able to do it without rights elevation...

It rather sounds that making such registrations via the application itself is somehow deemed to be a dead end in future...

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

About the windows 10 thing: that's how it already works from the first official build (10240). I decided to stick with the windows standards, so the code in this library will use what the user is used to on his/her system.

What this code does (even when windows just shows a dummy message) is adding it in the registry so windows knows that your app can open specific file names (this is still a requirement).

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

I see. Maybe there are also some domain policies playing in the game... It's now xmas time I'll check if this is a possible issue why user registered apps seem to not be recognized...

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

You don't have a non-restrictive Win 7 machine lying around where you can run the example at? I will see if I can find someone, but it might even be easier to create a vm, but earliest will be new year.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

I just tried in a VM on a Win 7 Pro Machine (fully patched), the example fails too in the same manner.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

I restarted investigating this: it turns out (although I compiled as AnyCPU or x64) the .NET application on Windows 7 seems to insist into fetching the regkeys inside Wow6432Node. I have no clue why this is done. But fact is, if I insert the values in the registry below the Orc.FileAssociation lib works like a charm on Win7 too. Is there a chance that this can be adapted to be integrated into the library? I know Win7 is pretty old now....

BTW: we are now using .NET 4.5.2 but seems irrelevant for this topic

`
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wow6432Node\Alpine]
[HKEY_CURRENT_USER\Software\Wow6432Node\Alpine\MyApp]
[HKEY_CURRENT_USER\Software\Wow6432Node\Alpine\MyApp\Capabilities]
"ApplicationDescription"="MyApp"
[HKEY_CURRENT_USER\Software\Wow6432Node\Alpine\MyApp\Capabilities\FileAssociations]
".myappext1"="MyApp"
".myappext2"="MyApp"

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Alpine]
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Alpine\MyApp]
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Alpine\MyApp\Capabilities]
"ApplicationDescription"="MyApp"
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Alpine\MyApp\Capabilities\FileAssociations]
".myappext1"="MyApp"
".myappext2"="MyApp"
`

from orc.fileassociation.

GeertvanHorrik avatar GeertvanHorrik commented on June 29, 2024

Thanks for the investigation. Yes, we are happy to integrate this into the lib. Interested in doing a PR?

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

I will provide a PR but I need some time to setup the environment correctly to compile and run the tests (Azure etc...)

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

Turns out it's not that simple.... The minimal set of keys I need to make it work in Win7 64bit OS & 32bit application Orc.FileAssociation.Example is:

`[HKEY_LOCAL_MACHINE\Software\RegisteredApplications]
"Orc.FileAssociation.Example"="Software\WildGums\Orc.FileAssociation.Example\Capabilities"

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\WildGums]

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\WildGums\Orc.FileAssociation.Example]

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\WildGums\Orc.FileAssociation.Example\Capabilities]
"ApplicationDescription"="Orc.FileAssociation.Example"

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\WildGums\Orc.FileAssociation.Example\Capabilities\FileAssociations]
".abc"="Orc.FileAssociation.Example"
".xyz"="Orc.FileAssociation.Example"
".txt"="Orc.FileAssociation.Example"
`

Unfortunately in order to do that, elevated privileges are required. I cannot really believe this is intentional from Microsoft... However I could find nothing really matching this problem in google to get deeper insight or a kind of confirmation.

from orc.fileassociation.

jdehaan avatar jdehaan commented on June 29, 2024

Does the code work on Windows 10? From what I read this only starts a dialog with a hint on how to do it manually.

One outcome out of this dilemma could be to create several alternative implementations of the interfaces which are initialized in the ModuleInitializer based on some criteria (and/or configuration?)

 var os = Environment.OSVersion;
        switch (os.VersionString)
        {
            case "Microsoft Windows NT 6.1.7601 Service Pack 1":
                serviceLocator.RegisterType<IApplicationRegistrationService, ApplicationRegistrationServiceWin7>();
                serviceLocator.RegisterType<IFileAssociationService, FileAssociationViaRegistryService>();
                break;
            default:
                serviceLocator.RegisterType<IApplicationRegistrationService, ApplicationRegistrationService>();
                serviceLocator.RegisterType<IFileAssociationService, FileAssociationViaComService>();
                break;
        }

I did not think this topic would be so hard. I unfortunately quit due to workload that topic for the moment being.

from orc.fileassociation.

mkhomutov avatar mkhomutov commented on June 29, 2024

image
that's what you will see in Win 10

from orc.fileassociation.

stale avatar stale commented on June 29, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from orc.fileassociation.

lock avatar lock commented on June 29, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from orc.fileassociation.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.