Browse files

Add the Windows installer files.

  • Loading branch information...
1 parent c216c77 commit 52c826d5c781768a74572a7e6132c9503f18b0bd @23Skidoo 23Skidoo committed Nov 2, 2012
View
26 src/win32/ANNOUNCEMENT
@@ -0,0 +1,26 @@
+This is the announcement template for the message I send to haskell-platform@
+--
+Subject: Windows installer $VERSION $RCNUM
+
+Hi all,
+
+I've uploaded the $RCNUMTH $VERSION release candidate installer to
+
+http://code.haskell.org/~refold/HaskellPlatform-$VERSION-$RCNUM-setup.exe
+
+MD5: ???
+SHA1:
+
+What's new in $VERSION-$RCNUM:
+
+ * ???
+ * ???
+ * ???
+
+Known issues:
+
+ See http://trac.haskell.org/haskell-platform/wiki/Windows
+
+Unless someone finds serious bugs in this RC, it can be released unchanged.
+
+Enjoy!
View
5 src/win32/CreateInternetShortcut.nsh
@@ -0,0 +1,5 @@
+!macro CreateInternetShortcut FILENAME URL ICONFILE ICONINDEX
+WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
+WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconFile" "${ICONFILE}"
+WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconIndex" "${ICONINDEX}"
+!macroend
View
327 src/win32/EnvVarUpdate.nsh
@@ -0,0 +1,327 @@
+/**
+ * EnvVarUpdate.nsh
+ * : Environmental Variables: append, prepend, and remove entries
+ *
+ * WARNING: If you use StrFunc.nsh header then include it before this file
+ * with all required definitions. This is to avoid conflicts
+ *
+ * Usage:
+ * ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString"
+ *
+ * Credits:
+ * Version 1.0
+ * * Cal Turney (turnec2)
+ * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this
+ * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar,
+ * WriteEnvStr, and un.DeleteEnvStr
+ * * Diego Pedroso (deguix) for StrTok
+ * * Kevin English (kenglish_hi) for StrContains
+ * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry
+ * (dandaman32) for StrReplace
+ *
+ * Version 1.1 (compatibility with StrFunc.nsh)
+ * * techtonik
+ *
+ * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
+ *
+ */
+
+
+!ifndef ENVVARUPDATE_FUNCTION
+!define ENVVARUPDATE_FUNCTION
+!verbose push
+!verbose 3
+!include "LogicLib.nsh"
+!include "WinMessages.NSH"
+!include "StrFunc.nsh"
+
+; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
+!macro _IncludeStrFunction StrFuncName
+ !ifndef ${StrFuncName}_INCLUDED
+ ${${StrFuncName}}
+ !endif
+ !ifndef Un${StrFuncName}_INCLUDED
+ ${Un${StrFuncName}}
+ !endif
+ !define un.${StrFuncName} "${Un${StrFuncName}}"
+!macroend
+
+!insertmacro _IncludeStrFunction StrTok
+!insertmacro _IncludeStrFunction StrStr
+!insertmacro _IncludeStrFunction StrRep
+
+; ---------------------------------- Macro Definitions ----------------------------------------
+!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
+
+!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call un.EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
+; ---------------------------------- Macro Definitions end-------------------------------------
+
+;----------------------------------- EnvVarUpdate start----------------------------------------
+!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
+!define hkcu_current_user 'HKCU "Environment"'
+
+!macro EnvVarUpdate UN
+
+Function ${UN}EnvVarUpdate
+
+ Push $0
+ Exch 4
+ Exch $1
+ Exch 3
+ Exch $2
+ Exch 2
+ Exch $3
+ Exch
+ Exch $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R0
+
+ /* After this point:
+ -------------------------
+ $0 = ResultVar (returned)
+ $1 = EnvVarName (input)
+ $2 = Action (input)
+ $3 = RegLoc (input)
+ $4 = PathString (input)
+ $5 = Orig EnvVar (read from registry)
+ $6 = Len of $0 (temp)
+ $7 = tempstr1 (temp)
+ $8 = Entry counter (temp)
+ $9 = tempstr2 (temp)
+ $R0 = tempChar (temp) */
+
+ ; Step 1: Read contents of EnvVarName from RegLoc
+ ;
+ ; Check for empty EnvVarName
+ ${If} $1 == ""
+ SetErrors
+ DetailPrint "ERROR: EnvVarName is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for valid Action
+ ${If} $2 != "A"
+ ${AndIf} $2 != "P"
+ ${AndIf} $2 != "R"
+ SetErrors
+ DetailPrint "ERROR: Invalid Action - must be A, P, or R"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ${If} $3 == HKLM
+ ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5
+ ${ElseIf} $3 == HKCU
+ ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5
+ ${Else}
+ SetErrors
+ DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"'
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for empty PathString
+ ${If} $4 == ""
+ SetErrors
+ DetailPrint "ERROR: PathString is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Make sure we've got some work to do
+ ${If} $5 == ""
+ ${AndIf} $2 == "R"
+ SetErrors
+ DetailPrint "$1 is empty - Nothing to remove"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Step 2: Scrub EnvVar
+ ;
+ StrCpy $0 $5 ; Copy the contents to $0
+ ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or
+ ; after the last one are not removed here but instead in Step 3)
+ ${If} $0 != "" ; If EnvVar is not empty ...
+ ${Do}
+ ${${UN}StrStr} $7 $0 " ;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 " ;" ";" ; Remove '<space>;'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 "; "
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 "; " ";" ; Remove ';<space>'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 ";;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 ";;" ";"
+ ${Loop}
+
+ ; Remove a leading or trailing semicolon from EnvVar
+ StrCpy $7 $0 1 0
+ ${If} $7 == ";"
+ StrCpy $0 $0 "" 1 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ StrLen $6 $0
+ IntOp $6 $6 - 1
+ StrCpy $7 $0 1 $6
+ ${If} $7 == ";"
+ StrCpy $0 $0 $6 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ ; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug
+ ${EndIf}
+
+ /* Step 3. Remove all instances of the target path/string (even if "A" or "P")
+ $6 = bool flag (1 = found and removed PathString)
+ $7 = a string (e.g. path) delimited by semicolon(s)
+ $8 = entry counter starting at 0
+ $9 = copy of $0
+ $R0 = tempChar */
+
+ ${If} $5 != "" ; If EnvVar is not empty ...
+ StrCpy $9 $0
+ StrCpy $0 ""
+ StrCpy $8 0
+ StrCpy $6 0
+
+ ${Do}
+ ${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter
+
+ ${If} $7 == "" ; If we've run out of entries,
+ ${ExitDo} ; were done
+ ${EndIf} ;
+
+ ; Remove leading and trailing spaces from this entry (critical step for Action=Remove)
+ ${Do}
+ StrCpy $R0 $7 1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 "" 1 ; Remove leading space
+ ${Loop}
+ ${Do}
+ StrCpy $R0 $7 1 -1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 -1 ; Remove trailing space
+ ${Loop}
+ ${If} $7 == $4 ; If string matches, remove it by not appending it
+ StrCpy $6 1 ; Set 'found' flag
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 == "" ; and the 1st string being added to $0,
+ StrCpy $0 $7 ; copy it to $0 without a prepended semicolon
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0,
+ StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon
+ ${EndIf} ;
+
+ IntOp $8 $8 + 1 ; Bump counter
+ ${Loop} ; Check for duplicates until we run out of paths
+ ${EndIf}
+
+ ; Step 4: Perform the requested Action
+ ;
+ ${If} $2 != "R" ; If Append or Prepend
+ ${If} $6 == 1 ; And if we found the target
+ DetailPrint "Target is already present in $1. It will be removed and"
+ ${EndIf}
+ ${If} $0 == "" ; If EnvVar is (now) empty
+ StrCpy $0 $4 ; just copy PathString to EnvVar
+ ${If} $6 == 0 ; If found flag is either 0
+ ${OrIf} $6 == "" ; or blank (if EnvVarName is empty)
+ DetailPrint "$1 was empty and has been updated with the target"
+ ${EndIf}
+ ${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty),
+ StrCpy $0 $0;$4 ; append PathString
+ ${If} $6 == 1
+ DetailPrint "appended to $1"
+ ${Else}
+ DetailPrint "Target was appended to $1"
+ ${EndIf}
+ ${Else} ; If Prepend (and EnvVar is not empty),
+ StrCpy $0 $4;$0 ; prepend PathString
+ ${If} $6 == 1
+ DetailPrint "prepended to $1"
+ ${Else}
+ DetailPrint "Target was prepended to $1"
+ ${EndIf}
+ ${EndIf}
+ ${Else} ; If Action = Remove
+ ${If} $6 == 1 ; and we found the target
+ DetailPrint "Target was found and removed from $1"
+ ${Else}
+ DetailPrint "Target was NOT found in $1 (nothing to remove)"
+ ${EndIf}
+ ${If} $0 == ""
+ DetailPrint "$1 is now empty"
+ ${EndIf}
+ ${EndIf}
+
+ ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change
+ ;
+ ClearErrors
+ ${If} $3 == HKLM
+ WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section
+ ${ElseIf} $3 == HKCU
+ WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
+ ${EndIf}
+
+ IfErrors 0 +4
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3"
+ DetailPrint "Could not write updated $1 to $3"
+ Goto EnvVarUpdate_Restore_Vars
+
+ ; "Export" our change
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
+ EnvVarUpdate_Restore_Vars:
+ ;
+ ; Restore the user's variables and return ResultVar
+ Pop $R0
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Push $0 ; Push my $0 (ResultVar)
+ Exch
+ Pop $0 ; Restore his $0
+
+FunctionEnd
+
+!macroend ; EnvVarUpdate UN
+!insertmacro EnvVarUpdate ""
+!insertmacro EnvVarUpdate "un."
+;----------------------------------- EnvVarUpdate end----------------------------------------
+
+!verbose pop
+!endif
View
703 src/win32/LICENSE
@@ -0,0 +1,703 @@
+
+Components of this bundle are distributed under various licences,
+including the following:
+
+------------------------------------------------------------------------
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the names of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+------------------------------------------------------------------------
+
+The authors intend this Report to belong to the entire Haskell
+community, and so we grant permission to copy and distribute it for
+any purpose, provided that it is reproduced in its entirety,
+including this Notice. Modified versions of this Report may also be
+copied and distributed for any purpose, provided that the modified
+version is clearly presented as such, and that it does not claim to
+be a definition of the Haskell 98 Language or the Haskell 98 Foreign
+Function Interface.
+
+------------------------------------------------------------------------
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+------------------------------------------------------------------------
+
+ The "Artistic License"
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing
+ this Package.
+
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people involved,
+ and so on. (You will not be required to justify it to the
+ Copyright Holder, but only to the computing community at large
+ as a market that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item.
+ It also means that recipients of the item may redistribute it
+ under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
+ your modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own. You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution. Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
+
+------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
+------------------------------------------------------------------------
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
View
124 src/win32/NEWS
@@ -0,0 +1,124 @@
+What's new in 2010.2.0.0-rc2:
+
+ * msvcr100.dll is now included (Needed for WinGHCi).
+
+ * New installer icon (based on the "batteries included" image).
+
+Known issues:
+
+ See http://trac.haskell.org/haskell-platform/wiki/Windows
+
+--
+
+What's new in 2010.2.0.0-rc1:
+
+ * Fixed the path issue that prevented some libraries from compiling (relevant
+ e.g. for the digest library) (#124).
+
+ * Haddock now works (#119).
+
+ * g++ is back! (#123).
+
+Known issues:
+
+ See http://trac.haskell.org/haskell-platform/wiki/Windows
+
+--
+
+What's new in 2010.1.0.0-rc3:
+
+ * Fixed a PATH issue that prevented alex and happy from working (reported by
+ Krasimir Angelov)
+
+ * $APPDATA/cabal/bin is now added to PATH (reported by Han Joosten)
+
+--
+
+What's new in 2010.1.0.0-rc2:
+
+ * $INSTDIR/mingw/bin is now added to PATH (#114)
+
+ * cabal-install version updated to 0.8.1
+
+ * regex-posix now works (thanks to Simon Marlow!)
+
+ * WinGHCi version updated to 1.0.5
+
+ * Profiling versions of all libraries are now included (#87)
+
+--
+
+What's new in 2010.1.0.0-rc1:
+
+ * We now prepend to PATH instead of appending (#82)
+
+ * WinGHCi is bundled with the installer (#80)
+
+--
+
+What's new in 2009.2.0.2-rc1:
+
+ * The Start Menu directory is now 'Haskell Platform' instead of 'GHC' (#29).
+
+ * Added a link to Hackage to the HP Start Menu entry (#70).
+
+--
+
+What's new in 2009.2.0.1-rc2:
+
+ * Version number is now 2009.2.0.1.
+
+ * The default install directory change was reverted.
+
+--
+
+What's new in 2009.2.1-rc1:
+
+ * The platform installer is now relocatable (all libraries are installed
+ into a single directory, and referred to via '$topdir' in package.conf).
+
+ * The default install directory no longer contains spaces (it was changed to
+ $SYSTEMDRIVE\HaskellPlatform\$PLATFORM_VERSION).
+
+Known issues:
+
+ * The network and time libraries shipped with GHC 6.10.3 were replaced with
+ versions specified in the 'haskell-platform.cabal' file (2.2.1.1 and
+ 1.1.2.4 instead of 2.2.1 and 1.1.3, respectively).
+
+ * The issue of upgrading wasn't given much thought, so you're advised to
+ delete the previous Haskell Platform installation before using this
+ installer. OTOH, our behaviour is no worse than that of the existing GHC
+ installer.
+
+ * The installer may work with restricted user accounts, but it has not been
+ tested and is not officially supported. The "just unpack" option should
+ work, however, since it doesn't do anything fancy.
+
+ * glut32.dll is not included, though it probably should be.
+
+--
+
+What's new in 2009.2.0-rc1:
+
+ * We now use a single root directory for both GHC and extralibs
+ ($PROGRAMFILES\Haskell Platform\$HP_VERSION).
+
+ * Installed files are tracked precisely (no unsafe `rm -rf` business).
+
+ * A new installation mode which doesn't touch the system settings or
+ registry was introduced. Suggested by Claus Reinke.
+
+ * Installer size was cut down by 50% by turning on 7z compression (thanks to
+ Bulat Ziganshin for the heads-up).
+
+ * The welcome screen is now slightly less dull.
+
+Known issues:
+
+ * The installer may work with restricted user accounts, but it has not been
+ tested and is not officially supported. The "minimal install" option (just
+ unpack the files) will most probably work, however, since it doesn't do
+ anything fancy.
+
+ * glut32.dll is not included, though it probably should be.
View
315 src/win32/Nsisfile.nsi
@@ -0,0 +1,315 @@
+; Haskell Platform Installer
+
+;--------------------------------
+;Includes
+
+ !Include "EnvVarUpdate.nsh"
+ !Include "FileFunc.nsh"
+ !Include "LogicLib.nsh"
+ !Include "MUI2.nsh"
+ !Include "WordFunc.nsh"
+ !Include "CreateInternetShortcut.nsh"
+
+;--------------------------------
+;Defines
+
+ !Define GHC_VERSION "7.4.2"
+ !Define PLATFORM_VERSION "2012.4.0.0"
+ !Define PRODUCT_DIR_REG_KEY "Software\Haskell\Haskell Platform\${PLATFORM_VERSION}"
+ !Define HACKAGE_SHORTCUT_TEXT "HackageDB - Haskell Software Repository"
+ !Define FILES_SOURCE_PATH "files"
+ !Define INST_DAT "inst.dat"
+ !Define UNINST_DAT "uninst.dat"
+
+;--------------------------------
+;Variables
+
+ Var START_MENU_FOLDER
+
+;--------------------------------
+;General settings
+
+ ;Name and file
+ Name "Haskell Platform ${PLATFORM_VERSION}"
+ OutFile "HaskellPlatform-${PLATFORM_VERSION}-setup.exe"
+
+ ;Default install dir
+ InstallDir "$PROGRAMFILES\Haskell Platform\${PLATFORM_VERSION}"
+ InstallDirRegKey HKLM "${PRODUCT_DIR_REG_KEY}" ""
+
+ ;Icon
+ !Define MUI_ICON "icons/installer.ico"
+ !Define MUI_UNICON "icons/installer.ico"
+
+ ;Request application privileges for Windows Vista
+ RequestExecutionLevel highest
+
+ ;Best available compression
+ SetCompressor /SOLID lzma
+
+ ;Install types
+ InstType "Standard"
+ InstType "Portable (just unpack the files)"
+
+;--------------------------------
+;Macros
+
+!macro CheckAdmin thing
+UserInfo::GetAccountType
+pop $0
+${If} $0 != "admin" ;Require admin rights on NT4+
+ MessageBox MB_YESNO "It is recommended to run this ${thing} as administrator. Do you want to quit and restart the ${thing} manually with elevated privileges?" IDNO CheckAdminDone
+ SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
+ Quit
+${EndIf}
+CheckAdminDone:
+!macroend
+
+;--------------------------------
+;Callbacks
+
+Function .onInit
+ !insertmacro CheckAdmin "installer"
+ SetShellVarContext all
+FunctionEnd
+
+Function un.onInit
+ !insertmacro CheckAdmin "uninstaller"
+ SetShellVarContext all
+FunctionEnd
+
+Function .onInstSuccess
+ IfFileExists $SYSDIR\glut32.dll Done
+ MessageBox MB_YESNO "It looks like glut32.dll is not installed. You will not be able to use the GLUT library. Do you want to copy glut32.dll to the system directory?" IDNO Done
+ SetOutPath "$SYSDIR\."
+ File "${FILES_SOURCE_PATH}\etc\glut32.dll"
+ Done:
+FunctionEnd
+
+;--------------------------------
+;Interface Settings
+
+ !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+ !Define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
+ !insertmacro MUI_PAGE_WELCOME
+ !insertmacro MUI_PAGE_LICENSE "LICENSE"
+ !insertmacro MUI_PAGE_DIRECTORY
+
+ !Define MUI_COMPONENTSPAGE_NODESC
+ !insertmacro MUI_PAGE_COMPONENTS
+
+ ;Start Menu Folder Page Configuration
+ !Define MUI_PAGE_HEADER_SUBTEXT \
+ "Choose a Start Menu folder for the Haskell Platform ${PLATFORM_VERSION} shortcuts."
+ !Define MUI_STARTMENUPAGE_TEXT_TOP \
+ "Select the Start Menu folder in which you would like to create Haskell Platform shortcuts. You can also enter a name to create a new folder."
+ !Define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
+ !Define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_DIR_REG_KEY}"
+ !Define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+ !Define MUI_STARTMENUPAGE_DEFAULTFOLDER "Haskell Platform ${PLATFORM_VERSION}"
+ !insertmacro MUI_PAGE_STARTMENU StartMenuPage $START_MENU_FOLDER
+ !insertmacro MUI_PAGE_INSTFILES
+ !insertmacro MUI_PAGE_FINISH
+
+ !insertmacro MUI_UNPAGE_WELCOME
+ !insertmacro MUI_UNPAGE_CONFIRM
+ !insertmacro MUI_UNPAGE_INSTFILES
+ !insertmacro MUI_UNPAGE_FINISH
+
+;--------------------------------
+;Languages
+
+ !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Base components" SecMain
+
+ SectionIn 1 2
+ ; Make this section mandatory
+ SectionIn RO
+
+ !Include ${INST_DAT}
+
+SectionEnd
+
+SectionGroup "Update system settings" SecGr
+
+Section "Associate with .hs/.lhs files" SecAssoc
+
+ SectionIn 1
+
+ ; File associations
+ WriteRegStr HKCR ".hs" "" "ghc_haskell"
+ WriteRegStr HKCR ".lhs" "" "ghc_haskell"
+ WriteRegStr HKCR "ghc_haskell" "" "Haskell Source File"
+ WriteRegStr HKCR "ghc_haskell\DefaultIcon" "" "$INSTDIR\icons\hsicon.ico"
+ WriteRegStr HKCR "ghc_haskell\shell\open\command" "" '"$INSTDIR\bin\ghci.exe" "%1"'
+
+ ;Remember that we registered associations
+ WriteRegDWORD HKLM "${PRODUCT_DIR_REG_KEY}" Assocs 0x1
+
+SectionEnd
+
+Section "Add versioned GHCi to right-click menu" SecGHCiVersioned
+
+ SectionIn 1
+
+ WriteRegStr HKCR "ghc_haskell\shell\Open with GHCi ${GHC_VERSION}" "" ""
+ WriteRegStr HKCR "ghc_haskell\shell\Open with GHCi ${GHC_VERSION}\command" "" '"$INSTDIR\bin\ghci.exe" "%1"'
+
+ ;Remember that we added versioned GHCi
+ WriteRegDWORD HKLM "${PRODUCT_DIR_REG_KEY}" VersionedGHCi 0x1
+SectionEnd
+
+Section "Update the PATH environment variable" SecPath
+
+ SectionIn 1
+
+ ; Update PATH
+ ${EnvVarUpdate} $0 "PATH" "P" "HKLM" "$INSTDIR\bin"
+ ${EnvVarUpdate} $0 "PATH" "P" "HKLM" "$INSTDIR\lib\extralibs\bin"
+ ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\mingw\bin"
+ ${EnvVarUpdate} $0 "PATH" "P" "HKLM" "$PROGRAMFILES\Haskell\bin"
+ SetShellVarContext current
+ ${EnvVarUpdate} $0 "PATH" "P" "HKCU" "$APPDATA\cabal\bin"
+ SetShellVarContext all
+
+SectionEnd
+
+Section "Store GHC's location in registry" SecGHCLoc
+
+ SectionIn 1
+
+ ; (copied from the GHC installer).
+ WriteRegStr HKCU "Software\Haskell\GHC\ghc-${GHC_VERSION}" "InstallDir" "$INSTDIR"
+ WriteRegStr HKCU "Software\Haskell\GHC" "InstallDir" "$INSTDIR"
+
+SectionEnd
+
+Section "Create uninstaller" SecAddRem
+
+ SectionIn 1
+ SectionIn RO
+
+ ; Add uninstall information to Add/Remove Programs
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}" \
+ "DisplayName" "Haskell Platform ${PLATFORM_VERSION}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}" \
+ "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}" \
+ "DisplayIcon" "$INSTDIR\icons\installer.ico"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}" \
+ "Publisher" "Haskell.org"
+
+ ;Create uninstaller
+ WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+ ; This is needed for uninstaller to work
+ WriteRegStr HKLM "${PRODUCT_DIR_REG_KEY}" "" "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "${PRODUCT_DIR_REG_KEY}" "InstallDir" "$INSTDIR"
+
+SectionEnd
+
+SectionGroupEnd
+
+Section "-StartMenu" StartMenu
+ SectionIn 1 2
+
+ ; Add start menu shortcuts
+
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN StartMenuPage
+
+ ;Create shortcuts
+ CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER"
+ !insertmacro CreateInternetShortcut \
+ "$SMPROGRAMS\$START_MENU_FOLDER\${HACKAGE_SHORTCUT_TEXT}" \
+ "http://hackage.haskell.org" \
+ "$INSTDIR\icons\hackage.ico" "0"
+ CreateShortCut \
+ "$SMPROGRAMS\$START_MENU_FOLDER\GHC Documentation.lnk" \
+ "$INSTDIR\doc\html\index.html"
+ CreateShortCut \
+ "$SMPROGRAMS\$START_MENU_FOLDER\GHC Flag Reference.lnk" \
+ "$INSTDIR\doc\html\users_guide\flag-reference.html"
+ CreateShortCut \
+ "$SMPROGRAMS\$START_MENU_FOLDER\GHC Library Documentation.lnk" \
+ "$INSTDIR\doc\html\libraries\index.html"
+ CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\GHCi.lnk" \
+ "$INSTDIR\bin\ghci.exe"
+ CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\WinGHCi.lnk" \
+ "$INSTDIR\winghci\winghci.exe"
+
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+ !Include ${UNINST_DAT}
+
+ Delete "$INSTDIR\Uninstall.exe"
+ RMDir $INSTDIR
+
+ ;Since we install to '$PF\Haskell Platform\$PLATFORM_VERSION', we
+ ;should also try to delete '$PF\Haskell Platform' if it is empty.
+ ${GetParent} $INSTDIR $R0
+ RMDir $R0
+
+ ; Delete start menu shortcuts
+ !insertmacro MUI_STARTMENU_GETFOLDER StartMenuPage $START_MENU_FOLDER
+
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\GHC Documentation.lnk"
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\GHC Flag Reference.lnk"
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\GHC Library Documentation.lnk"
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\GHCi.lnk"
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\WinGHCi.lnk"
+ Delete "$SMPROGRAMS\$START_MENU_FOLDER\${HACKAGE_SHORTCUT_TEXT}.url"
+ RMDir "$SMPROGRAMS\$START_MENU_FOLDER\"
+
+ ; Delete registry keys
+ ReadRegDWORD $0 HKLM "${PRODUCT_DIR_REG_KEY}" VersionedGHCi
+
+ ${If} $0 = 0x1
+ DeleteRegKey HKCR "ghc_haskell\shell\Open with GHCi ${GHC_VERSION}\command"
+ DeleteRegKey HKCR "ghc_haskell\shell\Open with GHCi ${GHC_VERSION}"
+ ${EndIf}
+
+ ReadRegDWORD $0 HKLM "${PRODUCT_DIR_REG_KEY}" Assocs
+
+ ${If} $0 = 0x1
+ DeleteRegValue HKCR ".hs" ""
+ DeleteRegValue HKCR ".lhs" ""
+ DeleteRegValue HKCR "ghc_haskell\shell\open\command" ""
+ DeleteRegKey HKCR "ghc_haskell\DefaultIcon"
+ DeleteRegKey /IfEmpty HKCR "ghc_haskell\shell\open\command"
+ DeleteRegKey /IfEmpty HKCR "ghc_haskell\shell\open"
+ DeleteRegKey /IfEmpty HKCR "ghc_haskell\shell"
+ DeleteRegKey /IfEmpty HKCR "ghc_haskell"
+ ${EndIf}
+
+ DeleteRegKey HKCU "Software\Haskell\GHC\ghc-${GHC_VERSION}"
+ DeleteRegKey HKCU "Software\Haskell\GHC"
+ DeleteRegKey HKLM "${PRODUCT_DIR_REG_KEY}"
+ DeleteRegKey /IfEmpty HKCU Software\Haskell
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}"
+
+ ; Update PATH
+ ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
+ ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\lib\extralibs\bin"
+ ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\mingw\bin"
+ ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$PROGRAMFILES\Haskell\bin"
+ SetShellVarContext current
+ ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$APPDATA\cabal\bin"
+ SetShellVarContext all
+
+
+SectionEnd
View
BIN src/win32/Platform.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
80 src/win32/README
@@ -0,0 +1,80 @@
+Windows installer for the Haskell Platform.
+
+How to make an installer
+------------------------
+
+0. Install the prerequisites: Python, MSYS and NSIS.
+ Install GHC.
+ Make sure that you have the special build of NSIS with large strings support.
+ Add $GHCDIR/mingw/bin to PATH.
+ Add $GHCDIR/perl to PATH.
+
+1. Manually install cabal-install's dependencies: zlib, transformers,
+ mtl, text, parsec, network, HTTP, random (in this order). Make sure
+ to use appropriate versions (see haskell-platform.cabal).
+
+ To install libraries manually:
+ $ wget http://...$PACKAGE.tar.gz
+ $ tar xzf $PACKAGE.tar.gz
+ $ cd $PACKAGE
+ $ ghc-install.sh
+
+2. Manually install cabal-install:
+ $ wget http://...cabal-install-$VERSION.tar.gz
+ $ tar xzf cabal-install-$VERSION.tar.gz
+ $ cd cabal-install-$VERSION
+ $ runghc Setup.hs configure
+ $ runghc Setup.hs build
+ $ runghc Setup.hs install
+
+3. $ cabal update
+
+4. $ git clone https://github.com/haskell/haskell-platform.git
+ $ cd haskell-platform
+ $ git checkout pre-release
+
+5. Make sure that you have 'library-profiling' set to True, 'shared' set to
+ True, 'split-objs' set to True, 'user-install' set to False, and
+ 'documentation' set to True in $APPDATA/cabal/config.
+
+ Make sure that you have glut.h and libglut32.a in
+ $GHCDIR/mingw/{include/GL,lib} (can be copied from the previous Platform
+ files).
+
+ In the haskell-platform directory:
+ $ cabal install
+ $ cabal install alex-$ALEX_VERSION happy-$HAPPY_VERSION
+
+6. Move all stuff from $PROGRAMFILES/Haskell/{bin,lib} to
+$GHCDIR/{lib/extralibs/bin,lib/extralibs}.
+
+7. Run recache.py (editing it beforehand to fix the paths).
+ Run ghc-pkg recache.
+ Run 'ghc-pkg check' to check that recaching caused no problems.
+
+8. Go to $GHCDIR/doc/html/libraries and run $THISDIR/haddock-gen-index.py
+(editing it beforehand)
+
+9. Copy the contents of $GHCDIR to $THISDIR/files & uninstall GHC.
+
+ Don't forget to remove unins000.dat and unins000.exe from $THISDIR/files.
+
+10. Build winghci (or just copy from the previous HP files) & put it into
+$THISDIR/files/winghci.
+
+ Don't forget the runtime library (depends on the Visual Studio version:
+ e.g. for MSVC 9 it's msvcr900.dll, can be checked with dependency walker).
+
+11. Update GHC_VERSION and PLATFORM_VERSION variables in Nsisfile.nsi.
+
+12. Copy $THISDIR/icons/*.ico to $THISDIR/files/icons
+
+13. $ gen_list_files_for_nsis.py files inst.dat uninst.dat
+
+14. Build the installer (right-click Nsisfile.nsi -> Compile NSIS Script).
+
+15. Test the installer (see the 'test' dir).
+
+ I usually check that regex-posix and glut work.
+
+16. Don't forget to publish the MD5 sig when doing the release announcement.
View
31 src/win32/TODO
@@ -0,0 +1,31 @@
+* Generate haddock docs for all libraries in the platform - look at Mark's
+ message ( http://article.gmane.org/gmane.comp.lang.haskell.platform/1421 ).
+
+* Run ghc-pkg recache after installation.
+
+* Write a script that automates things like downloading GHC/installing packages,
+ so that the installer can be built by someone who isn't me.
+
+* Add an Express install type
+
+* Add "Install only for the current user"
+
+* WinGHCi should work even if GHC's location is not in the registry
+
+* Add a way of choosing between WinGHCi and GHCi for .hs associations
+
+* Should we really use HKCR for file associations?
+
+* Ensure that several versions of the Haskell Platform can coexist.
+
+* Ensure that we play nice with WinHugs's installer and the like. Use an "Open
+ with GHCi" context menu instead of associating .hs/.lhs with GHCi. Write a
+ clear specification that describes what we do to system settings, place it on
+ the wiki, and link to it from the download page/release notes.
+
+* Look through Claus's message/links again and write down things that I forgot;
+ maybe file some tickets.
+
+* Branding: it would be nice to have different icons for .hs and .lhs files.
+
+* Look at Sigbjorn's BAMSE work.
View
32 src/win32/bootstrap.py
@@ -0,0 +1,32 @@
+#! /usr/bin/env python
+
+# Bootstrap script for the Haskell Platform Windows installer. Written in
+# Python cause I can't depend on necessary Haskell libs being installed.
+
+# TODO
+# * Move the lib dir to $GHC_DIR/extralibs
+# * Modify $GHC_DIR/package.conf
+# * Copy $GHC_DIR to $PWD/files
+# * Add icons
+
+
+bootstraplibs = [("mtl", "1.1.0.2"),
+ ("parsec", "2.1.0.1"),
+ ("network", "2.2.1.7"),
+ ("HTTP", "4000.0.9"),
+ ("zlib", "0.5.2.0")]
+
+extratools = [("alex", "2.3.3"),
+ ("happy", "1.18.5"),
+ ("haddock", "2.7.2"),
+ ("cabal-install", "0.8.2")]
+
+def install(lib):
+ name, version = lib
+
+def main():
+ for lib in (extralibs + extratools):
+ install(lib)
+
+if __name__ == "__main__":
+ main()
View
110 src/win32/gen_list_files_for_nsis.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+"""
+This script generates 2 lists of NSIS commands (install&uninstall)
+for all files in a given directory
+
+Usage:
+ gen_list_files_for_nsis.py <dir src> <inst list> <uninst list>
+Where
+ <dir src> : dir with sources; must exist
+ <inst list> : list of files to install (NSIS syntax)
+ <uninst list> : list of files to uninstall (NSIS syntax)
+ (both these will be overwriten each time)
+"""
+import sys, os, glob
+
+# global settings
+just_print_flag = 0 # turn to 1 for debugging
+
+# templates for the output
+inst_dir_tpl = ' SetOutPath "$INSTDIR%s"'
+inst_file_tpl = ' File "${FILES_SOURCE_PATH}%s"'
+uninst_file_tpl = ' Delete "$INSTDIR%s"'
+uninst_dir_tpl = ' RMDir "$INSTDIR%s"'
+
+# check args
+if len(sys.argv) != 4:
+ print __doc__
+ sys.exit(1)
+source_dir = sys.argv[1]
+if not os.path.isdir(source_dir):
+ print __doc__
+ sys.exit(1)
+
+def open_file_for_writting(filename):
+ "return a handle to the file to write to"
+ try:
+ h = file(filename, "w")
+ except:
+ print "Problem opening file %s for writting"%filename
+ print __doc__
+ sys.exit(1)
+ return h
+
+inst_list = sys.argv[2]
+uninst_list = sys.argv[3]
+if not just_print_flag:
+ ih= open_file_for_writting(inst_list)
+ uh= open_file_for_writting(uninst_list)
+
+stack_of_visited = []
+counter_files = 0
+counter_dirs = 0
+print "Generating the install & uninstall list of files"
+print " for directory", source_dir
+print >> ih, " ; Files to install\n"
+print >> uh, " ; Files and dirs to remove\n"
+
+# man page of walk() in Python 2.2 (the new one in 2.4 is easier to use)
+
+# os.path.walk(path, visit, arg)
+ #~ Calls the function visit with arguments (arg, dirname, names) for each directory
+ #~ in the directory tree rooted at path (including path itself, if it is a directory).
+ #~ The argument dirname specifies the visited directory, the argument names lists
+ #~ the files in the directory (gotten from os.listdir(dirname)). The visit function
+ #~ may modify names to influence the set of directories visited below dirname,
+ #~ e.g., to avoid visiting certain parts of the tree. (The object referred to by names
+ #~ must be modified in place, using del or slice assignment.)
+
+def my_visitor(my_stack, cur_dir, files_and_dirs):
+ "add files to the install list and accumulate files for the uninstall list"
+ global counter_dirs, counter_files, stack_of_visited
+ counter_dirs += 1
+
+ if just_print_flag:
+ print "here", my_dir
+ return
+
+ # first separate files
+ my_files = [x for x in files_and_dirs if os.path.isfile(cur_dir+os.sep+x)]
+ # and truncate dir name
+ my_dir = cur_dir[len(source_dir):]
+ if my_dir=="": my_dir = "\\."
+
+ # save it for uninstall
+ stack_of_visited.append( (my_files, my_dir) )
+
+ # build install list
+ if len(my_files):
+ print >> ih, inst_dir_tpl % my_dir
+ for f in my_files:
+ print >> ih, inst_file_tpl % (my_dir+os.sep+f)
+ counter_files += 1
+ print >> ih, " "
+
+os.path.walk( source_dir, my_visitor, stack_of_visited)
+ih.close()
+print "Install list done"
+print " ", counter_files, "files in", counter_dirs, "dirs"
+
+stack_of_visited.reverse()
+# Now build the uninstall list
+for (my_files, my_dir) in stack_of_visited:
+ for f in my_files:
+ print >> uh, uninst_file_tpl % (my_dir+os.sep+f)
+ print >> uh, uninst_dir_tpl % my_dir
+ print >> uh, " "
+
+# now close everything
+uh.close()
+print "Uninstall list done. Got to end.\n"
View
22 src/win32/ghc-install.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+SETUP_HS=
+if [ -e Setup.lhs ]
+then
+ SETUP_HS="Setup.lhs"
+fi
+if [ -e Setup.hs ]
+then
+ SETUP_HS="Setup.hs"
+fi
+
+if [ -z $SETUP_HS ]
+then
+ echo "Couldn't find the Setup.[l]hs file!"
+ exit 1;
+fi
+
+runghc $SETUP_HS configure --enable-library-profiling --enable-shared --enable-split-objs --global
+runghc $SETUP_HS build
+runghc $SETUP_HS haddock
+runghc $SETUP_HS install
View
38 src/win32/haddock-gen-index.py
@@ -0,0 +1,38 @@
+#! /usr/bin/env python
+
+import os.path
+import subprocess
+
+# Change this to the appropriate version.
+GHC_DIR = "C:\\ghc\\ghc-7.4.2"
+LIB_DIR = GHC_DIR + "\\lib"
+LIB_DOC_DIR = GHC_DIR + "\\doc\\html\\libraries"
+
+def get_field(pkg, fld):
+ ret = subprocess.check_output(["ghc-pkg", "field", pkg, fld])
+ return ret.strip()[len(fld)+2:]
+
+read_intf=""
+pkgs = subprocess.check_output(["ghc-pkg", "list", "--simple-output"]).split()
+for pkg in pkgs:
+ html = os.path.abspath(get_field(pkg, "haddock-html"))
+ html = html.replace(LIB_DIR, "..\\..\\..\\lib")
+ html = html.replace(LIB_DOC_DIR, ".")
+ intf = os.path.abspath(get_field(pkg, "haddock-interfaces"))
+
+ valid = True
+
+ if any(pkg.startswith(prefix) for prefix in ["ghc-", "rts-", "hoopl-"]):
+ valid = False
+ if pkg.startswith("ghc-prim-"):
+ valid = True
+ if not os.path.isfile(intf):
+ valid = False
+ print "Invalid interface: " + intf
+
+ if valid:
+ read_intf += (" --read-interface=" + html + ","+ intf)
+
+cmd_line = ["haddock", "--gen-index",
+ "--gen-contents", "--title=Haskell Platform"] + read_intf.split()
+subprocess.check_output(cmd_line)
View
BIN src/win32/icons/hackage.ico
Binary file not shown.
View
BIN src/win32/icons/hsicon.ico
Binary file not shown.
View
BIN src/win32/icons/installer.ico
Binary file not shown.
View
54 src/win32/parse-cabal.py
@@ -0,0 +1,54 @@
+#! /usr/bin/env python
+
+import re
+import urllib
+import sys
+
+SPEC_URL = 'http://code.galois.com/darcs/haskell-platform/' \
+ 'haskell-platform.cabal'
+CABAL_INSTALL_DEPS = ['zlib', 'mtl', 'parsec', 'HTTP', 'network']
+
+def get_cabal_install_version(f):
+ """File -> String"""
+ r = re.compile(r'cabal-install\s*==\s*([0-9\.]+)\s*,')
+
+ for l in f:
+ if l.find('cabal-install') != -1:
+ m = re.search(r, l)
+ if m is not None:
+ return m.group(1)
+ return None
+
+def get_package_versions(f):
+ """File -> { String : String }"""
+ d = {}
+ r = re.compile(r'\s*([\w-]+)\s*==\s*([0-9.]+)\s*\,?\s*')
+
+ for l in f:
+ if l.find('library') == 0:
+ break
+ for l in f:
+ m = re.match(r,l)
+ if m:
+ d[m.group(1)] = m.group(2)
+
+ return d
+
+def main(url):
+ print("Fetching the haskell-platform.cabal file from '" + url + "'...\n")
+ filename, headers = urllib.urlretrieve(url)
+
+ with open(filename) as f:
+ v = get_cabal_install_version(f)
+ f.seek(0)
+ d = get_package_versions(f)
+ d['cabal-install'] = v
+
+ for k,v in d.iteritems():
+ print(k + " version is " + v)
+
+if __name__ == '__main__':
+ if len(sys.argv) > 1:
+ main(sys.argv[1])
+ else:
+ main(SPEC_URL)
View
17 src/win32/recache.py
@@ -0,0 +1,17 @@
+#! /usr/bin/env python
+
+import os
+import os.path
+import fileinput
+
+# Change this to the appropriate version.
+DIR = "C:\\ghc\\ghc-7.4.2\\lib\\package.conf.d"
+
+FILES = [os.path.join(DIR, f) for f in os.listdir(DIR) if f.endswith("conf")]
+
+for line in fileinput.FileInput(FILES, inplace=1):
+ print line.replace("C:\\\\Program Files (x86)\\\\Haskell",
+ "$topdir\\\\extralibs").replace(
+ "C:\\\\Documents and Settings\\\\hatemachine\\\\Application Data" \
+ "\\\\cabal",
+ "$topdir\\\\extralibs"),
View
16 src/win32/test/glut.hs
@@ -0,0 +1,16 @@
+import Graphics.Rendering.OpenGL
+import Graphics.UI.GLUT
+
+myPoints :: [(GLfloat,GLfloat,GLfloat)]
+myPoints = map (\k -> (sin(2*pi*k/12),cos(2*pi*k/12),0.0)) [1..12]
+
+main = do
+ (progname, _) <- getArgsAndInitialize
+ createWindow "Hello World"
+ displayCallback $= display
+ mainLoop
+
+display = do
+ clear [ColorBuffer]
+ renderPrimitive Points $ mapM_ (\(x, y, z)->vertex$Vertex3 x y z) myPoints
+ flush
View
3 src/win32/test/regex.hs
@@ -0,0 +1,3 @@
+import Text.Regex.Posix
+
+main = print $ ("bar" =~ "(foo|bar)" :: Bool)
View
BIN src/win32/welcome.bmp
Binary file not shown.

0 comments on commit 52c826d

Please sign in to comment.