1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
Notes on Hugs 1.4 under Windows 95 / NT
*** Uninstalling Hugs ***
If you install using InstallShield (used by the pre-compiled binary
release) then Hugs will be found on the Add/Remove program menu on the
control panel. You should uninstall existing versions of Hugs before
installing a new one.
*** Windows interfaces to Hugs ***
There are two windows interfaces to Hugs: winhugs is an interface to
the Hugs system which does not provide editing but does have a
scrollable interaction window and some nice browsers. This was
developed using Windows 3.1 technology and doesn't always follow
Windows programming conventions. It also interferes with the Graphics
package and you can't run Fran or other programs which use the Win32
graphics modules.
We are currently developing a more traditional windows interface to
the Hugs compiler, hugsedit. Look on haskell.org/hugs for the latest
information on this. Unlike winhugs, hugsEdit is a separate program
which calls the console version of Hugs as a subprocess.
*** The Console Window ***
If you are using Hugs in a console window, it is easy to change the
properties of the console window to make Hugs more useable. On NT, you
can either create a shortcut to Hugs which has an adaquate console
window or you can fiddle with the default Console settings on the
control panel. If you use Windows 95, you're out of luck as far as I
know. If you use either WinHugs or HugsEdit or run Hugs from the
shell, this doesn't matter. Note that you can cut and paste into
console windows using an untitled menu under the Hugs icon in the
window.
*** The Win32 Graphics Library ***
We have imported many Win32 functions into Hugs. These can be
accessed either through the Win32 module directly or through the
Graphics module. We hope to eventually port Graphics to other
platforms while Win32 is very specific to the Windows API.
You probably shouldn't use Win32 unless you have to since it may
change in the future. Note that Win32 has changed significantly since it's
initial release.
*** The Registry ***
The registry is a small database maintained by Windows 95 / NT that holds
persistant information about the environment and applications. You
can view and / or edit the registry using the `regedit' program in
Windows. You can also place values in the registry by opening a
`.reg' file.
Hugs uses the registry in three ways:
a) At startup, initial options which define search path, heap size,
and other preferences are read from the registry. Using :set
changes these settings. The runhugs program uses the same
options settings - changing the heap size in hugs will also
change heap used by runhugs (command line options used
by runhugs override the registry options).
b) The registry associates .hs files with an icon and sets up Hugs
to open a .hs or .lhs file when double-clicked. The .hsx extension
is associated with runhugs. (I've had problems with the Internet
Explorer 4.0 not noticing when file icons change. The only way
around this that I know is to manually set the file icon for .hs
and .hsx to the icons in the hugs/icons directory).
c) The registry keeps track of where Hugs is installed.
When Hugs is installed via installShield (the pre-packaged binary
release) these registry keys are set up automatically. If you compile
Hugs from sources, you need to deal with the registry manually.
Initialization
When Hugs is initialized, it looks for initialization options first in
HKEY_CURRENT_USER\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs\???
where ??? is the version of Hugs you are running. If this doesn't
exist, the next place Hugs looks is
HKEY_LOCAL_MACHINE\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs\???
If you have more than one version of Hugs on your machine they won't
interfere with each other, although only one will be associated with
.hs files when they are opened.
The :set command writes the current set of options into the registry.
If you give Hugs a bad search path (using :set -P) you may have to go
into the registry editor to fix (or remove) the saved search path.
You can usually fix path problems by deleting the
HKEY_CURRENT_USER\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs\???
key entirely. The :set command always writes to CURRENT_USER, not
LOCAL_MACHINE.
Initial Options
The InstallShield installation creates an initial option string by looking
for persistant hugs options. Any key found in
HKEY_LOCAL_MACHINE\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs\options
will have it's value concatenated onto the initial option list. When
a package such as Fran is installed, it adds a key here so that
future Hugs installations will retain the search path entries that
Fran adds. You can also keep your own permanent preferences: a key such as
My Options = -h1M -.
will add these options to the initial Hugs options set during installation.
The names of the key are not important: only the key values are used.
The installation of Hugs does not set any of these options - it only reads
them and places them in the initial Hugs option string.
The following .reg file can be used to set up your own Hugs options:
---- Change <<dir>> to hugs install directory. Double any \
---- Change <<Version>> to Hugs installation version
---- Cut here: hugsopts.reg ----
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs]
"HUGSVERSION"="<<Version>>"
[HKEY_LOCAL_MACHINE\SOFTWARE\Yale and Nottingham Haskell Developers\Hugs\<<Version>>]
s"InstallDir"="<<dir>>"
[HKEY_CLASSES_ROOT\.hs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\.hsx]
@="haskellExProg"
"Content Type"="Executable Haskell Program"
[HKEY_CLASSES_ROOT\.lhs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\haskellExProg]
@="Executable Haskell Program"
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\haskellExProg\DefaultIcon]
@="<<dir>>\\icons\\hsxicon.ico;0"
[HKEY_CLASSES_ROOT\haskellExProg\shell]
@=""
[HKEY_CLASSES_ROOT\haskellExProg\shell\open]
[HKEY_CLASSES_ROOT\haskellExProg\shell\open\command]
@="<<dir>>\\runhugs.exe \"%1\""
[HKEY_CLASSES_ROOT\haskellProg]
@="Haskell Program"
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\haskellProg\DefaultIcon]
@="<<dir>>\\icons\\hsicon.ico;0"
[HKEY_CLASSES_ROOT\haskellProg\shell]
@=""
[HKEY_CLASSES_ROOT\haskellProg\shell\open]
[HKEY_CLASSES_ROOT\haskellProg\shell\open\command]
@="<<dir>>\\hugs.exe \"%1\""
---- Cut here: End of hugsopts.reg ----
File associations
To associate .hs and .lhs files with an icon and a program to open
them, the following registry keys are used.
These define a file type for .hs, .lhs, and .hsx files. These assume that
Hugs is installed in C:\hugs.
[HKEY_CLASSES_ROOT\.hs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\.lhs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\.hsx]
@="haskellExProg"
"Content Type"="Executable Haskell Program"
These define the icon and opener for a Haskell program:
[HKEY_CLASSES_ROOT\haskellProg]
@="Haskell Program"
[HKEY_CLASSES_ROOT\haskellProg\DefaultIcon]
@="C:\\Hugs\\icons\\hsicon.ico"
[HKEY_CLASSES_ROOT\haskellProg\shell]
[HKEY_CLASSES_ROOT\haskellProg\shell\open]
[HKEY_CLASSES_ROOT\haskellProg\shell\open\command]
@="C:\\Hugs\\hugs.exe \"%1\""
[HKEY_CLASSES_ROOT\haskellExProg\DefaultIcon]
@="C:\\Hugs\\icons\\hsicon.ico"
[HKEY_CLASSES_ROOT\haskellExProg\shell]
[HKEY_CLASSES_ROOT\haskellExProg\shell\open]
[HKEY_CLASSES_ROOT\haskellExProg\shell\open\command]
@="C:\\Hugs\\runhugs.exe \"%1\""
Of course, the location of Hugs may vary. See below for a .reg file
to set up all of these registry keys.
You may wish to use the Hugs icon but open with an different program,
such as an editor. Change
[HKEY_CLASSES_ROOT\haskellProg\shell\open\command]
if you want to open Haskell in a different way.
Hugs Directory
The key
HKEY_LOCAL_MACHINE\Software\Yale and Nottingham Haskell Developers\Hugs\HugsVersion
contains the version of the most recent Hugs installation. This is
used to install other software packages into the Hugs area.
*** Installing Hugs without InstallShield ***
The InstallShield program that installs Hugs doesn't do that much.
You can install all of the Hugs-related registry options with the following
*** Installing Hugs on a server ***
Running Hugs off a server under NT is relatively easy. The registry
entries set during server installation will probably not be available
to clients of the server but the built-in defaults that come with Hugs
should prove adaquate. It is probably easier to recompile hugs with
different defaults (heap size, search path) than it is to distribute the
proper registry values to each client. You can also simply supply a .reg
file to the users to get the registry set up before running hugs.
The main problem with the registry is that the file association for .hs
files is in a part of the registry which is local to the client. If you
really want to start up hugs programs by double clicking them (as well
as have the icons and such) you need to distribute the registry entries
associated with the file association to all clients or make a .reg file
available so that clients can quickly update machines without the proper
registry entries.
According to Microsoft, these registry problems will go away on NT 5.0.
Here is a .reg file to set up the Hugs file associations:
---- cut here --- File: hugs.reg
REGEDIT4
[HKEY_CLASSES_ROOT\.hs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\.lhs]
@="haskellProg"
"Content Type"="Haskell Program"
[HKEY_CLASSES_ROOT\haskellProg]
@="Haskell Program"
[HKEY_CLASSES_ROOT\haskellProg\DefaultIcon]
@="C:\\Hugs\\icons\\hsicon.ico"
[HKEY_CLASSES_ROOT\haskellProg\shell]
[HKEY_CLASSES_ROOT\haskellProg\shell\open]
[HKEY_CLASSES_ROOT\haskellProg\shell\open\command]
@="C:\\Hugs\\hugs.exe \"%1\""
--- cut here ---
|