#2505: windows installer should not hijack filetype associations!
------------------------+---------------------------------------------------
    Reporter:  claus    |        Owner:         
        Type:  bug      |       Status:  new    
    Priority:  normal   |    Milestone:         
   Component:  None     |      Version:  6.8.3  
    Severity:  normal   |   Resolution:         
    Keywords:           |     Testcase:         
Architecture:  Unknown  |           Os:  Windows
------------------------+---------------------------------------------------
Comment (by claus):

 Thanks. For future reference, when its installer time again, here are some
 excerpts of what various haskell installers have done to my registry in
 terms of file associations.

 For starters, there seems to be no agreement about filetype, to the extent
 that not all windows tools know what is going on:
 {{{
 $ cmd /c assoc .hs
 .hs=hs_auto_file

 $ cmd /c ftype hs_auto_file
 File type 'hs_auto_file' not found or no open command associated with it.

 $ cmd /c ftype ghc_haskell
 ghc_haskell="C:\ghc\ghc-6.8.3\bin\ghci.exe" "%1"

 $ cmd /c ftype hugs_haskell
 hugs_haskell="C:\Program Files\WinHugs\WinHugs.exe" "%1"
 }}}

 The `ghc_haskell` looks like the one I've tried to restore after ghc 6.8.3
 installation (the information I get for `Haskell Source File` when editing
 filetypes via explorer `Tools->Folder Options`)
 {{{
 $ reg query HKLM\\SOFTWARE\\Classes\\ghc_haskell /s

 ! REG.EXE VERSION 3.0

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell
     <NO NAME>   REG_SZ  Haskell Source File
     EditFlags   REG_DWORD       0x0
     BrowserFlags        REG_DWORD       0x8

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\DefaultIcon
     <NO NAME>   REG_SZ  C:\ghc\ghc-6.8.3\icons\hsicon.ico

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell
     <NO NAME>   REG_SZ  edit

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\edit

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\edit\command
     <NO NAME>   REG_SZ  C:\vim\vim70\gvim.exe "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open
     <NO NAME>   REG_SZ  open with ghci 6.8.3

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open\command
     <NO NAME>   REG_SZ  "C:\ghc\ghc-6.8.3\bin\ghci.exe" "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open\ddeexec

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open\ddeexec\Application
     <NO NAME>   REG_SZ  ghci

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open\ddeexec\Topic
     <NO NAME>   REG_SZ  System

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open_with_ghci_6.9
     <NO NAME>   REG_SZ  open with ghci 6.9

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open_with_ghci_6.9\command
     <NO NAME>   REG_SZ  C:\ghc\ghc-6.9.20080514\bin\ghci.exe "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open_with_WinHugs
     <NO NAME>   REG_SZ  open with WinHugs

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ghc_haskell\shell\open_with_WinHugs\command
     <NO NAME>   REG_SZ  "C:\Program Files\WinHugs\winhugs.exe" %1
 }}}
 Note that the `shell` default is `edit` which directly calls my editor,
 and that I like to have several GHC versions and WinHugs available there
 (the only reason that the "Edit With Vim" entry survived the GHC installer
 is that it is available for all fails, so stored elsewhere).

 The `hugs_haskell` entry seems to be one that I partially restored after a
 WinHugs installer had taken over (also removing my previous preferences):
 {{{
 $ reg query HKLM\\SOFTWARE\\Classes\\hugs_haskell /s

 ! REG.EXE VERSION 3.0

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell
     <NO NAME>   REG_SZ  Haskell Script
     EditFlags   REG_DWORD       0x0
     BrowserFlags        REG_DWORD       0x8

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\DefaultIcon
     <NO NAME>   REG_SZ  "C:\Program Files\WinHugs\WinHugs.exe",1

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell
     <NO NAME>   REG_SZ  Edit

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\Edit
     <NO NAME>   REG_SZ

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\Edit\command
     <NO NAME>   REG_SZ  "C:\Program Files\WinHugs\WinHugs.exe" /edit "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\Open
     <NO NAME>   REG_SZ

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\Open\command
     <NO NAME>   REG_SZ  "C:\Program Files\WinHugs\WinHugs.exe" "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.6.1
     <NO NAME>   REG_SZ  open with ghci 6.6.1

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.6.1\command
     <NO NAME>   REG_SZ  C:\ghc\ghc-6.6.1\bin\ghci.exe "%1"

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.9
     <NO NAME>   REG_SZ  open with ghci 6.9

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.9\command
     <NO NAME>   REG_SZ  C:\ghc\ghc-6.9.20080514\bin\ghci.exe "%1"

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.9\ddeexec

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.9\ddeexec\Application
     <NO NAME>   REG_SZ  ghci

 
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hugs_haskell\shell\open_with_ghci_6.9\ddeexec\Topic
     <NO NAME>   REG_SZ  System
 }}}
 Note that WinHugs believed at the time it should handle all editing of
 Haskell files..

 The behaviour I'd like to see is that each installer '''adds''' its
 functions to the existing menu, for the existing filetype, with
 descriptive names like "`Open with GHCi x.x`", "`Edit via WinHugs y.y`",
 etc. Then I can choose which of these, if any, to call from the default
 `open` and `edit` functions, and changing defaults never looses any
 options. Unless there is no existing default action or filetype,
 overriding what is there should be optional (default: no override).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2505#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to