; Generated NSIS script file (generated by makensitemplate.phtml 0.21)
; by 209.244.239.94 on Sep 20 02 @ 17:37

; NOTE: this .NSI script is designed for NSIS v1.8+

Name "milkbone"
OutFile "milkbone-inst.exe"
BrandingText " "
CRCCheck on
ShowInstDetails hide
DirShow show
SetOverwrite on

; Some default compiler settings (uncomment and change at will):
; SetCompress auto ; (can be off or force)
; SetDatablockOptimize on ; (can be off)
; CRCCheck on ; (can be off)
; AutoCloseWindow false ; (can be true for the window go away automatically at end)
; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)

InstallDir "$PROGRAMFILES\milkbone"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\batkins\milkbone" ""
DirShow show ; (make this hide to not let the user change it)
DirText "Select the directory to install milkbone in:"

Section "" ; (default section)
SetOutPath "$INSTDIR"
; add files / whatever that need to be installed here.
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\batkins\milkbone" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\milkbone" "DisplayName" "milkbone (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\milkbone" "UninstallString" '"$INSTDIR\uninst.exe"'

CreateDirectory "$INSTDIR\images"
CreateDirectory "$INSTDIR\plugins"
CreateDirectory "$INSTDIR\profiles"
CreateDirectory "$INSTDIR\sounds"
File milkbone.exe
File mb.conf
File perl58.dll

SetOutPath $INSTDIR\images
File images\*
SetOutPath $INSTDIR\sounds
File sounds\*
SetOutPath $INSTDIR\plugins
File /r plugins\*
SetOutPath $INSTDIR

SetShellVarContext all
CreateDirectory "$SMPROGRAMS\milkbone"
CreateShortCut "$SMPROGRAMS\milkbone\milkbone.lnk" "$INSTDIR\milkbone.exe"
CreateShortCut "$DESKTOP\milkbone.lnk" "$INSTDIR\milkbone.exe"

; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
SectionEnd ; end of default section

; begin uninstall settings/section
UninstallText "This will uninstall milkbone from your system"

Section Uninstall
; add delete commands to delete whatever files/registry keys/etc you installed here.
SetShellVarContext all

Delete "$INSTDIR\milkbone.exe"
Delete "$INSTDIR\images\*.*"
RMDir "$INSTDIR\images"
Delete "$INSTDIR\milkbone.exe"
Delete "$INSTDIR\perl58.dll"
Delete "$INSTDIR\uninst.exe"
RMDir "$INSTDIR";

Delete "$SMPROGRAMS\milkbone\milkbone.lnk"
Delete "$DESKTOP\milkbone.lnk"
RMDir "$SMPROGRAMS\milkbone"

DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\myCompany\milkbone"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\milkbone"
RMDir "$INSTDIR"
SectionEnd ; end of uninstall section

; eof