Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: File association on Windows

by stevieb (Canon)
on Jan 19, 2021 at 08:55 UTC ( [id://11127092]=note: print w/replies, xml ) Need Help??


in reply to [FIXED] File association on Windows

The problem wasn't the berrybrew code, nor how I was implementing the changes. Something went awry with my development environment that was causing the issue. I stood up two new separate VMs and can't reproduce the problem, so essentially the undesired behaviour I was trying to fix is definitely fixed.

I don't know where in the dev VM the problem lies, nor do I really care to spend any further time troubleshooting, so I'm just dumping the VM and configuring a new dev system.

Replies are listed 'Best First'.
Re^2: File association on Windows -- broken?
by Discipulus (Canon) on Jan 19, 2021 at 11:07 UTC
    I was investigating a bit and, no is not fixed :)

    I avoid file type association and I always do: perl myprog.pl in the command prompt. I associate .pl and .pm files with my text editor Notepad++

    I have followed your steps and then in an unpriviledged cmd prompt:

    C>ftype tempPerl tempPerl="C:\EX_D\ulisseDUE\perl5.32.64bit\perl\bin\perl.exe" >assoc .pl .pl=tempPerl >c:\Users\Tizio.Caio\Desktop\hello.pl

    Notepad++ was launched without any effect of the file type association.

    The registry show what is was set previously and explain the actual behaviour:

    C>REG QUERY HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Fi +leExts\.pl HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\OpenWithList HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\OpenWithProgids HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\UserChoice C>REG QUERY HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Fi +leExts\.pl\OpenWithList HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\OpenWithList a REG_SZ {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\OpenWith.exe MRUList REG_SZ ba b REG_SZ notepad++.exe C>REG QUERY HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Fi +leExts\.pl\OpenWithProgids HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\OpenWithProgids pl_auto_file REG_NONE C>REG QUERY HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Fi +leExts\.pl\UserChoice HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\F +ileExts\.pl\UserChoice ProgId REG_SZ Applications\notepad++.exe Hash REG_SZ TXlP+tcVMI0=

    Then I googled and I found:

    The above tests executed on: Microsoft Windows 10 Pro 0.0.19041 N/D build 19041

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      Thanks for the detailed response!

      I, too, always use perl script.pl on all systems, Linux included. In all honesty, I never even use Windows, except to develop berrybrew ironically ;)

      This feature was solely developed because one of my users had asked for it, and since I don't use Windows, didn't notice the problem until another user stumbled across it.

      In your ftype, you're missing a couple of entries. Compare yours:

      tempPerl="C:\EX_D\ulisseDUE\perl5.32.64bit\perl\bin\perl.exe"

      ...to mine:

      C:\repos\berrybrew>ftype berrybrewPerl berrybrewPerl=C:\berrybrew\5.10.1_32\perl\bin\perl.exe %1 %*

      The %1 is the script name, and %* are any arguments passed to it.

      Output (only hitting ENTER once to execute the command):

      C:\repos\berrybrew>t\data\assoc.pl Hello, world! C:\berrybrew\5.10.1_32\perl\bin\perl.exe C:\repos\berrybrew>

      Script:

      use warnings; use strict; print "Hello, world!\n"; print "$^X\n";

      I can't repro the original problem that was reported (having to hit enter twice) on three new systems I've spun up and tried it on, so I'm as content as I can be until it gets wider testing after release and I get actual feedback on it.

      I'll make a note on this thread when I finish the full release with point form notes on how to test it while actually using berrybrew if you or anyone else is interested in testing it in the larger scheme of things.

      As far as registry, I set only HKCR\.pl for the association, and HKCR\berrybrewPerl\shell\open\command for the ftype definition from within the berrybrew library.

        Full run using a dev build of berrybrew.

        > assoc .pl .pl=Perl_program_file > ftype Perl_program_file Perl_program_file=C:\Strawberry\perl\bin\perl.exe %1 %* > build\berrybrew list 5.16.3_64 5.10.1_32 > build\berrybrew switch 5.16.3_64 Switched to Perl version 5.16.3_64... > build\berrrybrew associate set berrybrew is now managing the Perl file association > assoc .pl .pl=berrybrewPerl > ftype berrybrewPerl berrybrewPerl=C:\berrybrew\5.16.3_64\perl\bin\perl.exe %1 %* > t\data\assoc.pl Hello, world! C:\berrybrew\5.16.3_64\perl\bin\perl.exe > build\berrybrew.exe switch 5.10.1_32 Switched to Perl version 5.10.1_32... > ftype berrybrewPerl berrybrewPerl=C:\berrybrew\5.10.1_32\perl\bin\perl.exe %1 %* > t\data\assoc.pl Hello, world! C:\berrybrew\5.10.1_32\perl\bin\perl.exe > build\berrybrew associate unset Set Perl file association back to default > assoc .pl .pl=Perl_program_file > ftype Perl_program_file Perl_program_file=C:\Strawberry\perl\bin\perl.exe %1 %*
        Hello stevieb,

        yes I had a typo, but I have redone all steps correctly and the association still doesnt work correctly.

        The issue is confirmed for version 1803 in this article but I have assoc.exe and ftype.exe not working as expected in version 10 Pro 0.0.19041 N/D build 19041

        They say the bug was introduced with the kb4462919 but please dont follow the insane path of: fixed with this other one which introduced these more bugs fixed with..

        L*

        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127092]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-25 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found