<commit_before># SWI-Prolog install-script

!define TEMP1 $R0 ; Temp variable
!define EXT    $3 ; Filename extension for Prolog sources
!define CWD    $4 ; Working directory for startmenu shortcut
!define GRP    $5 ; Startmenu group
!define DEFCWD $6 ; Default working directory
!define SHCTX  $7 ; Shell context (current/all)

!system "pl\bin\plcon.exe -f mkinstaller.pl"
!include "version.nsi"

SetCompressor bzip2
MiscButtonText "<back" "next>" "abort" "finished"

# Preload files that are needed by the installer itself
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "options.ini"

InstallDir $PROGRAMFILES\pl
InstallDirRegKey HKLM SOFTWARE\SWI\Prolog "home"
ComponentText "This will install the SWI-Prolog on your computer. \
               Select which optional components you want installed."
DirText "This program will install SWI-Prolog on your computer.\
         Choose a directory"

LicenseData pl\COPYING.TXT
LicenseText "SWI-Prolog is governed by the LGPL"

Page license
Page components
Page directory
Page custom SetCustom ": Installation options"
Page instfiles

Section "Base system (required)"
  SectionIn RO			# do not allow to delete this

  SetOutPath $INSTDIR\bin
  File pl\bin\plcon.exe
  File pl\bin\plwin.exe
  File pl\bin\libpl.dll
  File pl\bin\plterm.dll
  File pl\bin\plregtry.dll

  File pl\bin\pthreadVC.dll
  SetOutPath $INSTDIR
  File /r pl\library
  File /r pl\custom
  File pl\boot32.prc
  File pl\COPYING.TXT
  File pl\README.TXT
  File pl\READWIN.TXT
  File pl\VERSION
  File pl\swipl

  SetOutPath $INSTDIR\library
; SYSTEM STUFF
  File pl\library\listing.pl
  File pl\library\qsave.pl
  File pl\library\statistics.pl
  File pl\library\shlib.pl
  File pl\library\system.pl
  File pl\library\threadutil.pl
  File pl\library\tty.pl

; COMPATIBILITY
  File pl\library\backcomp.pl
  File pl\library\bim.pl
  File pl\library\edinburgh.pl
  File pl\library\qpforeign.pl
  File pl\library\quintus.pl
  File pl\library\files.pl

; `STANDARD LIBRAIES'
  File pl\library\ctypes.pl
  File pl\library\gensym.pl
  File pl\library\lists.pl
  File pl\library\occurs.pl
  File pl\library\ordsets.pl
  File pl\library\oset.pl

; WINDOWS
  File pl\library\dde.pl
  File pl\library\progman.pl
  File pl\library\registry.pl
  File pl\library\win_menu.pl
  File pl\library\wise.pl

; DEVELOPMENT
  File pl\library\edit.pl
  File pl\library\make.pl
  File pl\library\emacs_interface.pl
  File pl\library\explain.pl
  File pl\library\debug.pl
  File pl\library\check.pl
  File pl\library\checklast.pl
  File pl\library\checkselect.pl
  File pl\library\shell.pl

; WEB STUFF
  File pl\library\netscape.pl
  File pl\library\url.pl

; MISC
  File pl\library\am_match.pl
  File pl\library\readln.pl
  File pl\library\readutil.pl
  File pl\library\streampool.pl

  SetOutPath $INSTDIR\doc
  File pl\doc\windows.html
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\index.html

  WriteRegStr HKLM SOFTWARE\SWI\Prolog "home" "$INSTDIR"

  ; Write uninstaller
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SWI-Prolog" "DisplayName" "SWI-Prolog (remove only)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SWI-Prolog" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteUninstaller "uninstall.exe"
SectionEnd

Section "Documentation and Help-system"
  SetOutPath $INSTDIR\library
  File pl\library\MANUAL
  File pl\library\helpidx.pl
  File pl\library\help.pl
SectionEnd

Section "Demo files"
  SetOutPath $INSTDIR
  File /r pl\demo
SectionEnd

Section "C/C++ Interface"
  SetOutPath $INSTDIR
  File /r pl\lib
  File /r pl\include
  SetOutPath $INSTDIR\bin
  File pl\bin\plld.exe
  File pl\bin\plrc.exe
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\pl2cpp.html
SectionEnd

Section "XPCE graphics library"
  SetOutPath $INSTDIR
  File /r pl\xpce
  File pl\plwin.rc
  SetOutPath $INSTDIR\bin
  File pl\bin\pl2xpce.dll
SectionEnd

Section "Package CLIB"
  SetOutPath $INSTDIR\bin
  File pl\bin\cgi.dll
  File pl\bin\memfile.dll
  File pl\bin\mime.dll
  File pl\bin\socket.dll
  File pl\bin\time.dll
  SetOutPath $INSTDIR\library
  File pl\library\cgi.pl
  File pl\library\memfile.pl
  File pl\library\mime.pl
  File pl\library\socket.pl
  File pl\library\time.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\clib.html
SectionEnd

Section "ODBC Interface"
  SetOutPath $INSTDIR\bin
  File pl\bin\odbc4pl.dll
  SetOutPath $INSTDIR\library
  File pl\library\odbc.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\odbc.html
SectionEnd

Section "SGML/XML/HTML parser"
  SetOutPath $INSTDIR\bin
  File pl\bin\sgml2pl.dll
  SetOutPath $INSTDIR\library
  File /r pl\library\DTD
  File pl\library\sgml.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\sgml2pl.html
SectionEnd

Section "RDF and Semantic Web Library"
  SetOutPath $INSTDIR\bin
  File pl\bin\rdf_db.dll

  SetOutPath $INSTDIR\library
  File pl\library\rdf.pl
  File pl\library\rdf_parser.pl
  File pl\library\rdf_triple.pl
  File pl\library\rewrite.pl
  File /r pl\library\semweb

  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\rdf2pl.html
  File pl\doc\packages\semweb.html
SectionEnd

Section "HTTP Client/Server package"
  SetOutPath $INSTDIR\library
  File /r pl\library\http
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\http.html
  File pl\doc\packages\httpserver.gif
SectionEnd

Section "Table package"
  SetOutPath $INSTDIR\bin
  File pl\bin\table.dll
  SetOutPath $INSTDIR\library
  File pl\library\table.pl
  File pl\library\table_util.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\table.html
SectionEnd

Section "Sources for system predicates"
  SetOutPath $INSTDIR
  File /r pl\boot
  SetOutPath $INSTDIR\bin
  File pl\bin\mkboot.bat
SectionEnd

Section "Shell Extensions" SecShell
; SectionIn 1 2 3
  ; back up old value of .pl
  ReadRegStr $1 HKCR ${EXT} ""
  StrCmp $1 "" Label1
    StrCmp $1 "PrologFile" Label1
    WriteRegStr HKCR ${EXT} "backup_val" $1
  Label1:
  WriteRegStr HKCR ${EXT} "" "PrologFile"

  ReadRegStr $0 HKCR "NSISFile" ""
  StrCmp $0 "" 0 skipNSIAssoc
	WriteRegStr HKCR "PrologFile" "" "Prolog Source"
	WriteRegStr HKCR "PrologFile\shell" "" "open"
	WriteRegStr HKCR "PrologFile\DefaultIcon" "" $INSTDIR\makensisw.exe,1<commit_msg>* Fixed some typos<commit_after># SWI-Prolog install-script

!define TEMP1 $R0 ; Temp variable
!define EXT    $3 ; Filename extension for Prolog sources
!define CWD    $4 ; Working directory for startmenu shortcut
!define GRP    $5 ; Startmenu group
!define DEFCWD $6 ; Default working directory
!define SHCTX  $7 ; Shell context (current/all)

!system "pl\bin\plcon.exe -f mkinstaller.pl"
!include "version.nsi"

SetCompressor bzip2
MiscButtonText "<back" "next>" "abort" "finished"

# Preload files that are needed by the installer itself
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "options.ini"

InstallDir $PROGRAMFILES\pl
InstallDirRegKey HKLM SOFTWARE\SWI\Prolog "home"
ComponentText "This will install the SWI-Prolog on your computer. \
               Select which optional components you want installed."
DirText "This program will install SWI-Prolog on your computer.\
         Choose a directory"

LicenseData pl\COPYING.TXT
LicenseText "SWI-Prolog is governed by the LGPL"

Page license
Page components
Page directory
Page custom SetCustom ": Installation options"
Page instfiles

Section "Base system (required)"
  SectionIn RO			# do not allow to delete this

  SetOutPath $INSTDIR\bin
  File pl\bin\plcon.exe
  File pl\bin\plwin.exe
  File pl\bin\libpl.dll
  File pl\bin\plterm.dll
  File pl\bin\plregtry.dll

  File pl\bin\pthreadVC.dll
  SetOutPath $INSTDIR
  File /r pl\library
  File /r pl\custom
  File pl\boot32.prc
  File pl\COPYING.TXT
  File pl\README.TXT
  File pl\READWIN.TXT
  File pl\VERSION
  File pl\swipl

  SetOutPath $INSTDIR\library
; SYSTEM STUFF
  File pl\library\listing.pl
  File pl\library\qsave.pl
  File pl\library\statistics.pl
  File pl\library\shlib.pl
  File pl\library\system.pl
  File pl\library\threadutil.pl
  File pl\library\tty.pl

; COMPATIBILITY
  File pl\library\backcomp.pl
  File pl\library\bim.pl
  File pl\library\edinburgh.pl
  File pl\library\qpforeign.pl
  File pl\library\quintus.pl
  File pl\library\files.pl

; `STANDARD LIBRAIES'
  File pl\library\ctypes.pl
  File pl\library\gensym.pl
  File pl\library\lists.pl
  File pl\library\occurs.pl
  File pl\library\ordsets.pl
  File pl\library\oset.pl

; WINDOWS
  File pl\library\dde.pl
  File pl\library\progman.pl
  File pl\library\registry.pl
  File pl\library\win_menu.pl
  File pl\library\wise.pl

; DEVELOPMENT
  File pl\library\edit.pl
  File pl\library\make.pl
  File pl\library\emacs_interface.pl
  File pl\library\explain.pl
  File pl\library\debug.pl
  File pl\library\check.pl
  File pl\library\checklast.pl
  File pl\library\checkselect.pl
  File pl\library\shell.pl

; WEB STUFF
  File pl\library\netscape.pl
  File pl\library\url.pl

; MISC
  File pl\library\am_match.pl
  File pl\library\readln.pl
  File pl\library\readutil.pl
  File pl\library\streampool.pl

  SetOutPath $INSTDIR\doc
  File pl\doc\windows.html
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\index.html

  WriteRegStr HKLM SOFTWARE\SWI\Prolog "home" "$INSTDIR"

  ; Write uninstaller
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SWI-Prolog" "DisplayName" "SWI-Prolog (remove only)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SWI-Prolog" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteUninstaller "uninstall.exe"
SectionEnd

Section "Documentation and Help-system"
  SetOutPath $INSTDIR\library
  File pl\library\MANUAL
  File pl\library\helpidx.pl
  File pl\library\help.pl
SectionEnd

Section "Demo files"
  SetOutPath $INSTDIR
  File /r pl\demo
SectionEnd

Section "C/C++ Interface"
  SetOutPath $INSTDIR
  File /r pl\lib
  File /r pl\include
  SetOutPath $INSTDIR\bin
  File pl\bin\plld.exe
  File pl\bin\plrc.exe
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\pl2cpp.html
SectionEnd

Section "XPCE graphics library"
  SetOutPath $INSTDIR
  File /r pl\xpce
  File pl\plwin.rc
  SetOutPath $INSTDIR\bin
  File pl\bin\pl2xpce.dll
SectionEnd

Section "Package CLIB"
  SetOutPath $INSTDIR\bin
  File pl\bin\cgi.dll
  File pl\bin\memfile.dll
  File pl\bin\mime.dll
  File pl\bin\socket.dll
  File pl\bin\time.dll
  SetOutPath $INSTDIR\library
  File pl\library\cgi.pl
  File pl\library\memfile.pl
  File pl\library\mime.pl
  File pl\library\socket.pl
  File pl\library\time.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\clib.html
SectionEnd

Section "ODBC Interface"
  SetOutPath $INSTDIR\bin
  File pl\bin\odbc4pl.dll
  SetOutPath $INSTDIR\library
  File pl\library\odbc.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\odbc.html
SectionEnd

Section "SGML/XML/HTML parser"
  SetOutPath $INSTDIR\bin
  File pl\bin\sgml2pl.dll
  SetOutPath $INSTDIR\library
  File /r pl\library\DTD
  File pl\library\sgml.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\sgml2pl.html
SectionEnd

Section "RDF and Semantic Web Library"
  SetOutPath $INSTDIR\bin
  File pl\bin\rdf_db.dll

  SetOutPath $INSTDIR\library
  File pl\library\rdf.pl
  File pl\library\rdf_parser.pl
  File pl\library\rdf_triple.pl
  File pl\library\rewrite.pl
  File /r pl\library\semweb

  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\rdf2pl.html
  File pl\doc\packages\semweb.html
SectionEnd

Section "HTTP Client/Server package"
  SetOutPath $INSTDIR\library
  File /r pl\library\http
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\http.html
  File pl\doc\packages\httpserver.gif
SectionEnd

Section "Table package"
  SetOutPath $INSTDIR\bin
  File pl\bin\table.dll
  SetOutPath $INSTDIR\library
  File pl\library\table.pl
  File pl\library\table_util.pl
  SetOutPath $INSTDIR\doc\packages
  File pl\doc\packages\table.html
SectionEnd

Section "Sources for system predicates"
  SetOutPath $INSTDIR
  File /r pl\boot
  SetOutPath $INSTDIR\bin
  File pl\bin\mkboot.bat
SectionEnd

Section "Shell Extensions" SecShell
; SectionIn 1 2 3
  ; back up old value of .pl
  ReadRegStr $1 HKCR ${EXT} ""
  StrCmp $1 "" Label1
    StrCmp $1 "PrologFile" Label1
    WriteRegStr HKCR ${EXT} "backup_val" $1
  Label1:
  WriteRegStr HKCR ${EXT} "" "PrologFile"

  ReadRegStr $0 HKCR "PrologFile" ""
  StrCmp $0 "" 0 skipNSIAssoc
	WriteRegStr HKCR "PrologFile" "" "Prolog Source"
	WriteRegStr HKCR "PrologFile\shell" "" "open"
	WriteRegStr HKCR "PrologFile\DefaultIcon" "" $INSTDIR\bin\plwin.exe,1
{'fraction_non_alphanumeric': 0.09559113494755107, 'fraction_numerical': 0.0047322344033441125, 'mean_word_length': 3.708503527664315, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '487670', 'n_tokens_mistral': 4736, 'n_tokens_neox': 4585, 'n_words': 1108}