4 AppVerName=GHC @ProjectVersion@
5 DefaultDirName={sd}\ghc\ghc-@ProjectVersion@
8 UninstallDisplayIcon={app}\bin\ghci.exe
11 PrivilegesRequired=none
12 ChangesAssociations=yes
13 ChangesEnvironment=yes
17 Source: "bindistprep\ghc-@ProjectVersion@\*"; DestDir: "{app}"; Flags: recursesubdirs
20 Name: "{group}\@ProjectVersion@\GHCi"; Filename: "{app}\bin\ghci.exe"
21 Name: "{group}\@ProjectVersion@\GHC Documentation"; Filename: "{app}\doc\index.html"
22 Name: "{group}\@ProjectVersion@\GHC Library Documentation"; Filename: "{app}\doc\libraries\index.html"
23 Name: "{group}\@ProjectVersion@\GHC Flag Reference"; Filename: "{app}\doc\users_guide\flag-reference.html"
26 ; set up icon associations
27 ; this does _not_ follow the "play nice" proposal
28 ; future version should
29 Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
30 Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
31 Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekey
32 Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico"
33 Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""
35 ; these flags were always set in the past, by the installer
36 ; some programs may rely on them to find GHC
37 Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@ProjectVersion@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
38 Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue
40 ; set the PATH variable, for both GHC and Cabal
41 Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}"; Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype
42 Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}"; Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype
45 ; stolen from Gtk2Hs, I'm sure they like us :-)
49 function NotOnPathAlready(NewValue : String): Boolean;
53 // Log('Checking if Gtk2Hs\bin dir is already on the %PATH%');
54 if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Path) then
55 begin // Successfully read the value
56 // Log('HKCU\Environment\PATH = ' + Path);
57 NewValue := ExpandConstant(NewValue);
58 // Log('Looking for Gtk2Hs\bin dir in %PATH%: ' + BinDir + ' in ' + Path);
59 if Pos(LowerCase(NewValue), Lowercase(Path)) = 0 then
61 // Log('Did not find Gtk2Hs\bin dir in %PATH% so will add it');
66 // Log('Found Gtk2Hs bin dir in %PATH% so will not add it again');
70 else // The key probably doesn't exist
72 // Log('Could not access HKCU\Environment\PATH so assume it is ok to add it');