Basic framework for NSIS.
[virt-top.git] / wininstaller.nsis
1 #!Nsis Installer Command Script\r
2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones\r
3 #\r
4 # This library is free software; you can redistribute it and/or\r
5 # modify it under the terms of the GNU Lesser General Public\r
6 # License as published by the Free Software Foundation; either\r
7 # version 2 of the License, or (at your option) any later version.\r
8 #\r
9 # This library is distributed in the hope that it will be useful,\r
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
12 # Lesser General Public License for more details.\r
13 #\r
14 # You should have received a copy of the GNU Lesser General Public\r
15 # License along with this library; if not, write to the Free Software\r
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA\r
17 \r
18 # To build the installer:\r
19 #\r
20 # ./configure --with-nsis=/c/Progra~1/NSIS\r
21 # make all opt\r
22 # make wininstaller\r
23 \r
24 # Installer name.\r
25 Name "OCaml Libvirt ${VERSION}"\r
26 \r
27 # This is where we will write the installer to, set by Makefile.\r
28 OutFile "${OUTFILE}"\r
29 \r
30 # Target directory, or use value from the registry.\r
31 InstallDir "c:\${PACKAGE}"\r
32 InstallDirRegKey HKLM SOFTWARE\OCAML-LIBVIRT "Install_Dir"\r
33 \r
34 # Hide details.\r
35 ShowInstDetails hide\r
36 ShowUninstDetails hide\r
37 \r
38 # BZip2-compressed files are smaller but use more memory at runtime.\r
39 SetCompressor bzip2\r
40 \r
41 # Include an XP manifest.\r
42 XPStyle on\r
43 \r
44 # Pages in the installer wizard.\r
45 Page license\r
46 Page components\r
47 Page directory\r
48 Page instfiles\r
49 \r
50 # Title, data for license page.\r
51 LicenseText "Continue"\r
52 LicenseData "winlicense.rtf"\r
53 \r
54 # Title for components page.\r
55 ComponentText "This will install OCaml libvirt bindings, dependent libraries and programs on your computer. Select which optional components you want installed."\r
56 \r
57 # Title for the install directory page.\r
58 DirText "Please select the installation folder."\r
59 \r
60 # Installer section.\r
61 Section "OCaml Libvirt bindings (required)"\r
62         SectionIn RO\r
63 SectionEnd\r
64 \r
65 Section "Libraries (required)"\r
66         SectionIn RO\r
67 SectionEnd\r
68 \r
69 Section "Programs (recommended)"\r
70         SetOutPath $INSTDIR\r
71         File "/oname=mlvirsh.exe" "mlvirsh\mlvirsh.opt"\r
72 SectionEnd\r
73 \r
74 Section "Start Menu Shortcuts"\r
75         CreateDirectory "$SMPROGRAMS\${PACKAGE}"\r
76         CreateShortCut "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk" "$INSTDIR\Uninstall ${PACKAGE}.exe" "" "$INSTDIR\Uninstall ${PACKAGE}.exe" 0\r
77         CreateShortCut "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0\r
78 SectionEnd\r
79 \r
80 Section "Desktop Icons"\r
81         CreateShortCut "$DESKTOP\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0\r
82 SectionEnd\r
83 \r
84 Section "Uninstall"\r
85         # Desktop icons\r
86         Delete /rebootok "$DESKTOP\Virt Shell.lnk"\r
87 \r
88         # Menu shortcuts\r
89         Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk"\r
90         Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk"\r
91         RMDir "$SMPROGRAMS\${PACKAGE}"\r
92 \r
93         # Files in installation directory.\r
94         Delete /rebootok "$INSTDIR\mlvirsh.exe"\r
95         Delete /rebootok "$INSTDIR\Uninstall ${PACKAGE}.exe"\r
96 \r
97         RMDir "$INSTDIR"\r
98 SectionEnd\r
99 \r
100 # Write an uninstaller into the installation directory.\r
101 Section -post\r
102         WriteUninstaller "$INSTDIR\Uninstall ${PACKAGE}.exe"\r
103 SectionEnd\r