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
14 LicenseFile=distrib/windows-installer-licences.txt
18 Source: "bindistprep\ghc-@ProjectVersion@\*"; DestDir: "{app}"; Flags: recursesubdirs
21 Name: "{group}\@ProjectVersion@\GHCi"; Filename: "{app}\bin\ghci.exe"; WorkingDir: "{app}\bin"
22 Name: "{group}\@ProjectVersion@\GHC Documentation"; Filename: "{app}\doc\html\index.html"
23 Name: "{group}\@ProjectVersion@\GHC Library Documentation"; Filename: "{app}\doc\html\libraries\index.html"
24 Name: "{group}\@ProjectVersion@\GHC Flag Reference"; Filename: "{app}\doc\html\users_guide\flag-reference.html"
27 ; set up icon associations
28 ; this does _not_ follow the "play nice" proposal
29 ; future version should
30 Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
31 Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
32 Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekey
33 Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico"
34 Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""
36 ; these flags were always set in the past, by the installer
37 ; some programs may rely on them to find GHC
38 Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@ProjectVersion@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
39 Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue
41 ; set the PATH variable, for both GHC and Cabal
42 Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}"; Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype
43 Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}"; Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype
46 ; stolen from Gtk2Hs, I'm sure they like us :-)
50 function NotOnPathAlready(NewValue : String): Boolean;
54 // Log('Checking if Gtk2Hs\bin dir is already on the %PATH%');
55 if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Path) then
56 begin // Successfully read the value
57 // Log('HKCU\Environment\PATH = ' + Path);
58 NewValue := ExpandConstant(NewValue);
59 // Log('Looking for Gtk2Hs\bin dir in %PATH%: ' + BinDir + ' in ' + Path);
60 if Pos(LowerCase(NewValue), Lowercase(Path)) = 0 then
62 // Log('Did not find Gtk2Hs\bin dir in %PATH% so will add it');
67 // Log('Found Gtk2Hs bin dir in %PATH% so will not add it again');
71 else // The key probably doesn't exist
73 // Log('Could not access HKCU\Environment\PATH so assume it is ok to add it');