From abe9e6fc56e9fe75dc85b7895f326f88e635225e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 21 Oct 2010 12:29:42 +0000 Subject: [PATCH] Windows installer improvements from Claus - add link to inno setup docs, so readers don't have to guess what ghc.iss might be - add Task section, and associated most Registry actions with separate (sub)tasks, so that file associations, default action, and PATH setting can be optional - copy license file into doc directory - install icon file again, so that DefaultIcon is no longer a dangling pointer (#4352) - only delete ghc_haskell key if empty (in case there were other tools using it) - add versioned GHCi to right-click menu (to allow for multiple tool installs) --- distrib/ghc.iss.in | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/distrib/ghc.iss.in b/distrib/ghc.iss.in index 0dc7b13..151fefc 100644 --- a/distrib/ghc.iss.in +++ b/distrib/ghc.iss.in @@ -1,3 +1,4 @@ +; Inno Setup documentation: http://www.jrsoftware.org/ishelp/ [Setup] AppName=GHC @@ -13,10 +14,21 @@ ChangesAssociations=yes ChangesEnvironment=yes LicenseFile=distrib/windows-installer-licences.txt +; tasks can be disabled selectively +[Tasks] +Name: fileassoc; Description: "Associate with .hs/.lhs files" +Name: fileassoc\default; Description: "Make this version of GHCi the default" +Name: fileassoc\addon; Description: "Add versioned GHCi to right-click menu" +Name: fileassoc\icon; Description: "Add icon" +Name: path; Description: "Add bin directories to PATH" +; install main payload, license file and icon [Files] Source: "bindistprep\ghc-@ProjectVersion@\*"; DestDir: "{app}"; Flags: recursesubdirs +Source: "distrib\windows-installer-licences.txt"; DestDir: "{app}\doc" +Source: "distrib\hsicon.ico"; DestDir: "{app}\icons" +; Start Menu shortcuts [Icons] Name: "{group}\@ProjectVersion@\GHCi"; Filename: "{app}\bin\ghci.exe"; WorkingDir: "{app}\bin" Name: "{group}\@ProjectVersion@\GHC Documentation"; Filename: "{app}\doc\html\index.html" @@ -24,14 +36,22 @@ Name: "{group}\@ProjectVersion@\GHC Library Documentation"; Filename: "{app}\doc Name: "{group}\@ProjectVersion@\GHC Flag Reference"; Filename: "{app}\doc\html\users_guide\flag-reference.html" [Registry] -; set up icon associations -; this does _not_ follow the "play nice" proposal +; set up file associations +; this does _not_ entirely follow the "play nice" proposal (cf. ticket #916) ; future version should -Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue -Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue -Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekey -Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico" -Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1""" +Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue; Tasks: fileassoc +Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue; Tasks: fileassoc +Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekeyifempty; Tasks: fileassoc + +; make this GHCi the default action +Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: fileassoc\default + +; add versioned GHCi entry to right-click menu +Root: HKCR; Subkey: "ghc_haskell\shell\Open with GHCi @ProjectVersion@"; ValueType: none; ValueName: ""; ValueData: ""; Flags: uninsdeletekey; Tasks: fileassoc\addon +Root: HKCR; Subkey: "ghc_haskell\shell\Open with GHCi @ProjectVersion@\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: fileassoc\addon + +; associate file type with icon +Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico"; Tasks: fileassoc\icon ; these flags were always set in the past, by the installer ; some programs may rely on them to find GHC @@ -39,8 +59,8 @@ Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@ProjectVersion@"; ValueType: stri Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue ; set the PATH variable, for both GHC and Cabal -Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}"; Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype -Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}"; Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype +Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}"; Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype; Tasks: path +Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}"; Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype; Tasks: path ; stolen from Gtk2Hs, I'm sure they like us :-) -- 1.7.10.4