Skip to content

Commit

Permalink
New MSI-based installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
arbv committed Apr 23, 2018
1 parent 9f3fa71 commit eea61c2
Show file tree
Hide file tree
Showing 19 changed files with 782 additions and 68 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,19 @@ HyperSpec/*
HyperSpec-Legalese.text
HyperSpec-README.text
.vs/*
# installer staff
*.msi
*.wixobj
*.wixpdb
*.tar
installer/Standard/
# automatically generated installer components
installer/Libraries.wxs
installer/Modules.wxs
installer/Sys.wxs
installer/Documentation.wxs
installer/Examples.wxs
installer/Headers.wxs
installer/HyperSpec.wxs
installer/LICENSE.rtf

Binary file removed Corman Lisp 3.0.ise
Binary file not shown.
Binary file removed Corman Lisp 3.02.ism
Binary file not shown.
39 changes: 15 additions & 24 deletions Utilities/install-hyperspec.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,20 @@ typedef struct _header
(ccl:unmap-file address)))

(defun install-hyperspec ()
(if (eq (win:message-box-yes-no "Do you want to install the Common Lisp HyperSpec (from Xanalys)?"
"Install Common Lisp HyperSpec") 'win:idyes)
(let ((gzpath (namestring (truename (merge-pathnames "HyperSpec-6-0.tar.gz"))))
(tarpath (namestring (truename (merge-pathnames "HyperSpec-6-0.tar"))))
(hyperspec-path (namestring (truename (merge-pathnames "hyperspec/")))))

;; unless the Hyperspec is already installed at this location, extract
;; it to that location
(unless (probe-file (merge-pathnames "Front\\Contents.htm" hyperspec-path))
(format t "Unzipping ~A...~%" gzpath)
(force-output)
(ccl:uncompress-file gzpath tarpath)
(format t "Extracting files from ~A...~%" tarpath)
(tar-extract tarpath))

(with-open-file (init-file (merge-pathnames "init.lisp") :direction :output :if-exists :append)
(format init-file "~%;;; Set the Hyperspec path~%(setf *hyperspec-local-path* ~S)~%"
hyperspec-path))
(setf *hyperspec-local-path* hyperspec-path))
(let ()
(with-open-file (init-file (merge-pathnames "init.lisp") :direction :output :if-exists :append)
(format init-file "~%;;; Set the Hyperspec path~%(setf *hyperspec-local-path* nil)~%"))
(setf *hyperspec-local-path* nil))))
(let ((gzpath (namestring (truename (merge-pathnames "HyperSpec-6-0.tar.gz"))))
(tarpath (namestring (truename (merge-pathnames "HyperSpec-6-0.tar"))))
(hyperspec-path (namestring (truename (merge-pathnames "hyperspec/")))))

;; unless the Hyperspec is already installed at this location, extract
;; it to that location
(unless (probe-file (merge-pathnames "Front\\Contents.htm" hyperspec-path))
(format t "Unzipping ~A...~%" gzpath)
(force-output)
(ccl:uncompress-file gzpath tarpath)
(format t "Extracting files from ~A...~%" tarpath)
(tar-extract tarpath)
(delete-file tarpath))
(setf *hyperspec-local-path* hyperspec-path)))

(install-hyperspec)

Expand All @@ -103,4 +94,4 @@ typedef struct _header





59 changes: 59 additions & 0 deletions Utilities/license-to-rtf.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
;;;;; Stolen from https://github.com/sbcl/sbcl/blob/master/tools-for-build/rtf.lisp

;;;; Generate RTF out of a regular text file, splitting
;;;; paragraphs on empty lines.
;;;;
;;;; Used to generate License.rtf out of COPYING for the
;;;; Windows installer.

;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
;;;;
;;;; This software is derived from the CMU CL system, which was
;;;; written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no warranty. See the COPYING and CREDITS
;;;; files for more information.

(defun read-text (pathname)
(let ((pars (list nil)))
(with-open-file (f pathname :external-format :ascii)
(loop for line = (read-line f nil)
for text = (string-trim '(#\Space #\Tab) line)
while line
when (plusp (length text))
do (setf (car pars)
(if (car pars)
(concatenate 'string (car pars) " " text)
text))
else
do (push nil pars)))
(nreverse pars)))

(defun write-rtf (pars pathname)
(with-open-file (f pathname :direction :output :external-format :ascii
:if-exists :supersede)
;; \rtf0 = RTF 1.0
;; \ansi = character set
;; \deffn = default font
;; \fonttbl = font table
;; \fs = font size in half-points
(format f "{\\rtf1\\ansi~
\\deffn0~
{\\fonttbl\\f0\\fswiss Helvetica;}~
\\fs20~
~{~A\\par\\par ~}}" ; each par used to end with
; ~%, but resulting Rtf looks
; strange (WinXP, WiX 3.0.x,
; ?)
pars)))

;; generate RTF file from TXT file
(defun generate-license-rtf (from to)
(write-rtf (read-text from) to))

(generate-license-rtf
(concatenate 'string *cormanlisp-directory* "LICENSE.txt")
(concatenate 'string *cormanlisp-directory* ".\\installer\\LICENSE.rtf"))


12 changes: 10 additions & 2 deletions init.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@

;;; set your own local path for the Hyperspec
;; eg. (setq *hyperspec-local-path* "c:/roger/lisp/HyperSpec/")
(setq *hyperspec-local-path* (concatenate 'string *cormanlisp-directory* "HyperSpec/"))

;; unless the Hyperspec is already installed at this location
;; it to that location

;; Automatically set HyperSpec path to the one installed with Corman Lisp.
(let ((hyperspec-install-path (merge-pathnames "HyperSpec\\"
(namestring *cormanlisp-directory*))))
(when (probe-file (merge-pathnames "Front\\Contents.htm" hyperspec-install-path))
(setq *hyperspec-local-path* (namestring hyperspec-install-path))))

;;; set your own declaration symbols list
;; eg. (setf ide:*declaration-symbols* '("defun" "define-symbol-macro")) or
;; (setf ide:*declaration-symbols* (append ide:*declaration-symbols* '("defwinconstant" "defwinapi")))
Expand All @@ -91,3 +98,4 @@
"CormanLisp.img")))
;; export from CL package
(export (find-symbol "LOAD-DEFAULT-IMAGE" 'cl) 'cl)

19 changes: 19 additions & 0 deletions installer/AddToPath.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<!-- add product to path -->
<Component Id="AddProductToPath"
Guid="{F39576AD-698B-48F5-9E74-8C1C2EDC375B}"
KeyPath="yes">
<Environment Id="Env_PATH"
Name="PATH"
Value="[INSTALLDIR]"
Separator=";"
Action="set"
Part="last"
System="yes" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
59 changes: 59 additions & 0 deletions installer/Config.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<!--
Manufacturer and product name
-->
<?define ProductName="Corman Lisp" ?>
<?define ManufacturerName="Sharp Lispers" ?>
<!--
Versioning. These have to be changed for upgrades.
It's not enough to just include newer files.
-->
<?define MajorVersion="3" ?>
<?define MinorVersion="1" ?>
<?define BuildVersion="0" ?>
<!-- Revision is NOT used by WiX in the upgrade procedure -->
<?define Revision="0" ?>
<!-- Full version number to display -->
<?define VersionNumber="$(var.MajorVersion).$(var.MinorVersion).$(var.BuildVersion)" ?>
<?define VersionNumberWithRevision="$(var.MajorVersion).$(var.MinorVersion).$(var.BuildVersion).$(var.Revision)" ?>
<!--
Visual C++ Runtime Version.
Comment it out to not include VC++ redistributable.
-->
<?define VCRedist="140" ?>
<!--
Set the following variables to to "yes" to include
corresponding parts of Visual C++ Runtime.
-->
<?define VCRedist_MFC="yes" ?>
<?define VCRedist_OpenMP="no" ?>
<?define VCRedist_CXXAMP="no" ?>
<!--
Supported architecture
-->
<?define Platform="x86" ?>
<!--
Upgrade code HAS to be the same for all updates.
Once you've chosen it don't change it.
-->
<?define UpgradeCode="{E0D4586E-BDA4-49EF-8325-A971EFC40405}" ?>
<!--
The name of your application *.exe files. These will be used to kill the process when updating
and creating the desktop shortcut
-->
<?define GuiProcessName="CormanLisp.exe" ?>
<?define ConsoleProcessName="clconsole.exe" ?>

<!-- Paths to directories -->
<?define SysDirectoryPath=".\Sys" ?>
<?define LibrariesDirectoryPath=".\Libraries" ?>
<?define ModulesDirectoryPath=".\Modules" ?>
<?define DocumentationDirectoryPath=".\documentation" ?>

<?define HeadersDirectoryPath=".\include" ?>
<?define ExamplesDirectoryPath=".\examples" ?>
<?define HyperSpecDirectoryPath=".\HyperSpec" ?>

</Include>

88 changes: 88 additions & 0 deletions installer/Core.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include Config.wxi?>
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<!-- Write Installation Path to registry -->
<Component Id="RegValueProductInstallPath" Guid="{CE589DBA-5C00-419F-AF9E-4E9365260957}">
<RegistryValue Id="RegValueInstallPath"
Root="HKLM"
Key="Software\$(var.ManufacturerName)\$(var.ProductName)"
Name="Path"
Value="[INSTALLDIR]"
Type="string"
KeyPath="yes"/>
</Component>
<!-- Core product files -->
<Component Id="CormanLispCore" Guid="{EAED0349-C9F0-454F-91CB-73B80DBBB517}">
<File Id="CormanLisp_IDE_Executable"
Name="CormanLisp.exe"
DiskId="1"
Source=".\CormanLisp.exe" />
<File Id="CormanLisp_Console_Executable"
Name="clconsole.exe"
DiskId="1"
Source=".\clconsole.exe" />
<File Id="CormanLisp_Image"
Name="CormanLisp.img"
DiskId="1"
Source=".\CormanLisp.img" />
<File Id="CormanLispServer"
Name="CormanLispServer.dll"
DiskId="1"
Source=".\CormanLispServer.dll" />
<File Id="CormanLispConsoleTemplate"
Name="clconsoleapp.exe"
DiskId="1"
Source=".\clconsoleapp.exe" />
<File Id="CormanLispGUITemplate"
Name="clboot.exe"
DiskId="1"
Source=".\clboot.exe" />
<File Id="CormanLispGUITemplateStatic"
Name="clbootapp.exe"
DiskId="1"
Source=".\clbootapp.exe" />
<File Id="CormanLispDLLTemplateStatic"
Name="dlltemplate.dll"
DiskId="1"
Source=".\dlltemplate.dll" />
<File Id="CormanLispCoreInit"
Name="init.lisp"
DiskId="1"
Source=".\init.lisp" />
<File Id="MakeImgBat"
Name="makeimg.bat"
DiskId="1"
Source=".\makeimg.bat" />
<File Id="CormanLispLicense"
Name="LICENSE.txt"
DiskId="1"
Source=".\LICENSE.txt" />
</Component>
<!-- RDNZL Dynamic Library -->
<Component Id="RDNZL_DLL"
Guid="{6D17A89E-C877-4DEC-970C-CAC6D41C9261}">
<File Id="RDNZL.dll"
Name="RDNZL.dll"
DiskId="1"
Source=".\RDNZL.dll" />
</Component>
<!-- set environmental variable -->
<Component Id="SetEnv_CORMANLISP_HOME"
Guid="{307EA98D-C472-4D90-9FD7-A27018E87263}"
KeyPath="yes">
<Environment Id="Env_CORMANLISP_HOME"
Name="CORMANLISP_HOME"
Value="[INSTALLDIR]" Action="set" System="yes" />
</Component>
</DirectoryRef>
<!-- Product Base description -->
<ComponentGroup Id="ProductBase">
<ComponentRef Id="RegValueProductInstallPath" />
<ComponentRef Id="CormanLispCore" />
<ComponentRef Id="RDNZL_DLL" />
</ComponentGroup>
</Fragment>
</Wix>

38 changes: 38 additions & 0 deletions installer/DebugData.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<!-- debug data files -->
<Component Id="DebugDataFiles" Guid="{59A45CAD-80F1-4C15-8F9B-BE9D6735359E}">
<File Id="clboot.pdb"
Name="clboot.pdb"
DiskId="1"
Source=".\clboot.pdb" />
<File Id="clbootapp.pdb"
Name="clbootapp.pdb"
DiskId="1"
Source=".\clbootapp.pdb" />
<File Id="clconsole.pdb"
Name="clconsole.pdb"
DiskId="1"
Source=".\clconsole.pdb" />
<File Id="clconsoleapp.pdb"
Name="clconsoleapp.pdb"
DiskId="1"
Source=".\clconsoleapp.pdb" />
<File Id="CormanLisp.pdb"
Name="CormanLisp.pdb"
DiskId="1"
Source=".\CormanLisp.pdb" />
<File Id="CormanLispServer.pdb"
Name="CormanLispServer.pdb"
DiskId="1"
Source=".\CormanLispServer.pdb" />
<File Id="dlltemplate.pdb"
Name="dlltemplate.pdb"
DiskId="1"
Source=".\dlltemplate.pdb" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Loading

0 comments on commit eea61c2

Please sign in to comment.