+#!Nsis Installer Command Script\r
+# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2 of the License, or (at your option) any later version.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+\r
+# To build the installer:\r
+#\r
+# ./configure --with-nsis=/c/Progra~1/NSIS\r
+# make all opt\r
+# make wininstaller\r
+\r
+# Installer name.\r
+Name "OCaml Libvirt ${VERSION}"\r
+\r
+# This is where we will write the installer to, set by Makefile.\r
+OutFile "${OUTFILE}"\r
+\r
+# Target directory, or use value from the registry.\r
+InstallDir "c:\${PACKAGE}"\r
+InstallDirRegKey HKLM SOFTWARE\OCAML-LIBVIRT "Install_Dir"\r
+\r
+# Hide details.\r
+ShowInstDetails hide\r
+ShowUninstDetails hide\r
+\r
+# BZip2-compressed files are smaller but use more memory at runtime.\r
+SetCompressor bzip2\r
+\r
+# Include an XP manifest.\r
+XPStyle on\r
+\r
+# Pages in the installer wizard.\r
+Page license\r
+Page components\r
+Page directory\r
+Page instfiles\r
+\r
+# Title, data for license page.\r
+LicenseText "Continue"\r
+LicenseData "winlicense.rtf"\r
+\r
+# Title for components page.\r
+ComponentText "This will install OCaml libvirt bindings, dependent libraries and programs on your computer. Select which optional components you want installed."\r
+\r
+# Title for the install directory page.\r
+DirText "Please select the installation folder."\r
+\r
+# Installer section.\r
+Section "OCaml Libvirt bindings (required)"\r
+ SectionIn RO\r
+SectionEnd\r
+\r
+Section "Libraries (required)"\r
+ SectionIn RO\r
+SectionEnd\r
+\r
+Section "Programs (recommended)"\r
+ SetOutPath $INSTDIR\r
+ File "/oname=mlvirsh.exe" "mlvirsh\mlvirsh.opt"\r
+SectionEnd\r
+\r
+Section "Start Menu Shortcuts"\r
+ CreateDirectory "$SMPROGRAMS\${PACKAGE}"\r
+ CreateShortCut "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk" "$INSTDIR\Uninstall ${PACKAGE}.exe" "" "$INSTDIR\Uninstall ${PACKAGE}.exe" 0\r
+ CreateShortCut "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0\r
+SectionEnd\r
+\r
+Section "Desktop Icons"\r
+ CreateShortCut "$DESKTOP\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0\r
+SectionEnd\r
+\r
+Section "Uninstall"\r
+ # Desktop icons\r
+ Delete /rebootok "$DESKTOP\Virt Shell.lnk"\r
+\r
+ # Menu shortcuts\r
+ Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk"\r
+ Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Uninstall.lnk"\r
+ RMDir "$SMPROGRAMS\${PACKAGE}"\r
+\r
+ # Files in installation directory.\r
+ Delete /rebootok "$INSTDIR\mlvirsh.exe"\r
+ Delete /rebootok "$INSTDIR\Uninstall ${PACKAGE}.exe"\r
+\r
+ RMDir "$INSTDIR"\r
+SectionEnd\r
+\r
+# Write an uninstaller into the installation directory.\r
+Section -post\r
+ WriteUninstaller "$INSTDIR\Uninstall ${PACKAGE}.exe"\r
+SectionEnd\r