#!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=virt-ctrl.exe" "virt-ctrl\virt-ctrl.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 CreateShortCut "$SMPROGRAMS\${PACKAGE}\Virt Control.lnk" "$INSTDIR\virt-ctrl.exe" "" "$INSTDIR\virt-ctrl.exe" 0 SectionEnd Section "Desktop Icons" CreateShortCut "$DESKTOP\Virt Shell.lnk" "$INSTDIR\mlvirsh.exe" "" "$INSTDIR\mlvirsh.exe" 0 CreateShortCut "$DESKTOP\Virt Control.lnk" "$INSTDIR\virt-ctrl.exe" "" "$INSTDIR\virt-ctrl.exe" 0 SectionEnd Section "Uninstall" # Desktop icons Delete /rebootok "$DESKTOP\Virt Shell.lnk" Delete /rebootok "$DESKTOP\Virt Control.lnk" # Menu shortcuts Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Virt Shell.lnk" Delete /rebootok "$SMPROGRAMS\${PACKAGE}\Virt Control.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