summaryrefslogtreecommitdiffstats
path: root/wininstaller.nsis
blob: 0ffba5c38b5cb0b17b29480fd3ec4a14c88a8ce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!Nsis Installer Command Script

# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones

#

# This library is free software; you can redistribute it and/or

# modify it under the terms of the GNU Lesser General Public

# License as published by the Free Software Foundation; either

# version 2 of the License, or (at your option) any later version.

#

# This library 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

# Lesser General Public License for more details.

#

# You should have received a copy of the GNU Lesser General Public

# License along with this library; if not, write to the Free Software

# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA


# To build the installer:

#

# ./configure --with-nsis=/c/Progra~1/NSIS

# make all opt

# make wininstaller


# Installer name.

Name "OCaml Libvirt ${VERSION}"

# This is where we will write the installer to, set by Makefile.

OutFile "${OUTFILE}"

# Target directory, or use value from the registry.

InstallDir "c:\${PACKAGE}"
InstallDirRegKey HKLM SOFTWARE\OCAML-LIBVIRT "Install_Dir"

# Hide details.

ShowInstDetails hide
ShowUninstDetails hide

# BZip2-compressed files are smaller but use more memory at runtime.

SetCompressor bzip2

# Include an XP manifest.

XPStyle on

# Pages in the installer wizard.

Page license
Page components
Page directory
Page instfiles

# Title, data for license page.

LicenseText "Continue"
LicenseData "winlicense.rtf"

# Title for components page.

ComponentText "This will install OCaml libvirt bindings, dependent libraries and programs on your computer. Select which optional components you want installed."

# Title for the install directory page.

DirText "Please select the installation folder."

# Installer sections.

Section "Libvirt and its libraries (required)"
	# Make this required.

	SectionIn RO

	SetOutPath $INSTDIR
	# XXX Get these paths automatically.

	File "c:\msys\1.0\local\bin\libvirt-?.dll"
	File "c:\msys\1.0\local\bin\libxdr.dll"
	File "c:\msys\1.0\local\bin\libxml2-?.dll"
	File "c:\gnutls\bin\libgcrypt-??.dll"
	File "c:\gnutls\bin\libgnutls-??.dll"
	File "c:\gnutls\bin\libgpg-error-?.dll"
	File "c:\gnutls\bin\libtasn1-?.dll"
SectionEnd

Section "Programs (recommended)"
	SetOutPath $INSTDIR
	File "/oname=mlvirsh.exe" "mlvirsh\mlvirsh.opt"
SectionEnd

Section "OCaml Libvirt bindings (for developers only)"
	# XXX Need to find out where Objective CAML is installed.

SectionEnd

Section "Start Menu Shortcuts"
	CreateDirectory "$SMPROGRAMS\${PACKAGE}"
	CreateShortCut "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk" "$INSTDIR\Uninstall ${PACKAGE}.exe" "" "$INSTDIR\Uninstall ${PACKAGE}.exe" 0
	CreateShortCut "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0
SectionEnd

Section "Desktop Icons"
	CreateShortCut "$DESKTOP\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0
SectionEnd

Section "Uninstall"
	# Desktop icons

	Delete /rebootok "$DESKTOP\Virt Shell.lnk"

	# Menu shortcuts

	Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk"
	Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk"
	RMDir "$SMPROGRAMS\${PACKAGE}"

	# Files in installation directory.

	Delete /rebootok "$INSTDIR\*.exe"
	Delete /rebootok "$INSTDIR\*.dll"

	RMDir "$INSTDIR"
SectionEnd

# Write an uninstaller into the installation directory.

Section -post
	WriteUninstaller "$INSTDIR\Uninstall ${PACKAGE}.exe"
SectionEnd