;NSIS Modern User Interface version 1.61
;Basic Example Script
;Written by Joost Verburg

!define MUI_PRODUCT "Document Production System" ;Define your own software name here
!define MUI_VERSION "8.0" ;Define your own software version here



  
  ;General
  OutFile "setup.exe"

  ;License page
 ; LicenseData "c:\webwill\cd\License.rtf"

  !define MUI_ICON "C:\webwill\cd\setup.ico"
  !define MUI_UICON "C:\webwill\cd\uninstall.ico" 

  !include "${NSISDIR}\Contrib\Modern UI\System.nsh"

;--------------------------------
;Configuration



  !define MUI_DIRECTORYPAGE
  
  !define MUI_ABORTWARNING
  ;!define MUI_LICENSEPAGE 
  !define MUI_WELCOMEPAGE

  !define MUI_UNCONFIRMPAGE
  !define MUI_FINISHPAGE
  !define MUI_UNINSTALLER

  !define MUI_SPECIALBITMAP c:\webwill\Images\setup.bmp
  !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt

  ;Language
  !insertmacro MUI_LANGUAGE "English"

  ;Descriptions
  LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."

  ;Folder-selection page
  ;Page License
  InstallDir "$PROGRAMFILES\DPS 8.0"

  DirText "$\n$\nChoose an installation folder for DPS 8.0, or use the default by clicking Install."

  AllowRootDirInstall "true"

  WindowIcon "on"

  Caption "DPS 8.0 Setup"

;--------------------------------
;Modern UI System

!insertmacro MUI_SYSTEM

;--------------------------------
;Installer Sections

Section "Update" SecCopyUI

  ;ADD YOUR OWN STUFF HERE!

  SetOutPath "$INSTDIR"
  CreateDirectory "$INSTDIR"
  File /r "C:\webwill\dist\dps\*.*"
  WriteUninstaller "$INSTDIR\Uninstall.exe"



SectionEnd

Section "Start Menu Shortcuts"
  CreateDirectory "$SMPROGRAMS\DPS 8.0"
  ;CreateShortCut "$SMPROGRAMS\DPS 8.0\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\DPS 8.0\DPS 8.0.lnk" "$INSTDIR\DPS 8.0.exe" "" "" 0
  CreateShortCut "$SMPROGRAMS\DPS 8.0\Uninstall DPS 8.0.lnk" "$INSTDIR\Uninstaller.exe" "" "" 0
  CreateShortCut "$SMPROGRAMS\DPS 8.0\Readme.lnk" "$INSTDIR\readme.txt" "" "" 0  
  CreateShortCut "$DESKTOP\DPS 8.0.lnk" "$INSTDIR\DPS 8.0.exe" "" "" 0
SectionEnd


Section "Uninstall"

  ;ADD YOUR OWN STUFF HERE!

  Delete "$INSTDIR\*.ini"
  Delete "$INSTDIR\*.cfg"
  Delete "$INSTDIR\*.exe"  
  Delete "$INSTDIR\build.num"  
  Delete "$INSTDIR\*.dps"    
  Delete "$INSTDIR\*.jar"
  Rmdir /r "$SMPROGRAMS\DPS 8.0"
  Delete "$DESKTOP\DPS 8.0.lnk"
  Rmdir /r "$INSTDIR\dialogs"
  Rmdir /r "$INSTDIR\functions"
  Rmdir /r "$INSTDIR\help"
  Rmdir /r "$INSTDIR\images"
  Rmdir /r "$INSTDIR\jre"  
  Rmdir /r "$INSTDIR\libs"
  Rmdir /r "$INSTDIR\lookup"
  Rmdir /r "$INSTDIR\modules"
  Rmdir /r "$INSTDIR\dialogs"
  Delete "$INSTDIR\Uninstall.exe"

  ;Display the Finish header
  !insertmacro MUI_UNFINISHHEADER

SectionEnd


;Display the Finish header
;Insert this macro after the sections if you are not using a finish page
!insertmacro MUI_SECTIONS_FINISHHEADER

;--------------------------------
;Descriptions

!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
 
;--------------------------------




