Commit abe9e6fc authored by Ian Lynagh's avatar Ian Lynagh
Browse files

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)
parent 8612b811
; 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 :-)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment