summaryrefslogtreecommitdiffstats
path: root/wininstaller.nsis.in
blob: f348540e19c9f7c5573bc9c58332ae2c54f2791a (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
115
116
117
118
119
120
121
122
123
124
125
126
127
#!Nsis Installer Command Script
# @configure_input@
# 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
	File "@LIBVIRT_DLL_PATH@\libvirt-0.dll"
	File "@LIBXDR_DLL_PATH@\libxdr.dll"
	File "@LIBXML2_DLL_PATH@\libxml2-2.dll"
	File "@GNUTLS_DLL_PATH@\libgcrypt-??.dll"
	File "@GNUTLS_DLL_PATH@\libgnutls-??.dll"
	File "@GNUTLS_DLL_PATH@\libgpg-error-?.dll"
	File "@GNUTLS_DLL_PATH@\libtasn1-?.dll"
	File "@GTK_DLL_PATH@\*.dll"

	SetOutPath $INSTDIR\lib
	File /r "@GTK_PATH@\lib\gtk-2.0"
	File /r "@GTK_PATH@\lib\pango"

	SetOutPath $INSTDIR
	File /r "@GTK_PATH@\etc"

	SetOutPath $INSTDIR
SectionEnd

Section "Programs (recommended)"
	SetOutPath $INSTDIR
	File "/oname=mlvirsh.exe" "mlvirsh\mlvirsh.opt"
	#File "/oname=mlvirtmanager.exe" "mlvirsh\mlvirtmanager.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.
	RMDir /r "$INSTDIR\etc"
	RMDir /r "$INSTDIR\lib"
	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