;------------------------------------------------------------------------------
; EVMPLUGIN TEMPLATE plug-in source code
;
; This application installs the EVMPLUGIN TEMPLATE plug-in source code
;
; Original script: NSIS Installation Script created by NSIS Quick Setup Script Generator v1.09.18
;                  Entirely Edited with NullSoft Scriptable Installation System                
;                    by Vlasis K. Barkas aka Red Wine red_wine@freemail.gr Sep 2006
;
; Edited: Greg Hupp
; File Updated: 12DEC07
;-------------------------------------------------------------------------------

;-----------------------------------------------------------------------------
; Constant declarations

!define APP_NAME "EVMPLUGIN TEMPLATE-SRC"
!define COMP_NAME "Texas Instruments Inc."
#!define WEB_SITE "http://www.ti.com/"
!define VERSION "1.0.0"
!define DEVELOPMENT_VERSION "0"
!define RELEASE_DATE "14DEC07"
!define COPYRIGHT "(c)2007 Texas Instruments Inc."
!define DESCRIPTION "EVMPLUGIN TEMPLATE-PDK plugin source"
!define PLUGIN_TYPE "evm"
!define LICENSE_TXT "C:\work\adcpro\LICENSE.txt"
!define PLUGIN_PATH "$PROGRAMFILES\ADCPro\plugins"
!define MAIN_APP_EXE "adcpro.exe"
!define REG_ROOT "HKCU"
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"

;-----------------------------------------------------------------------
; Variable declarations

Var PLUGIN_PATH

;-----------------------------------------------------------------------
; Installer File Version

VIProductVersion  "${VERSION}.${DEVELOPMENT_VERSION}"
VIAddVersionKey "ProductName"  "${APP_NAME}"
VIAddVersionKey "CompanyName"  "${COMP_NAME}"
VIAddVersionKey "LegalCopyright"  "${COPYRIGHT}"
VIAddVersionKey "FileDescription"  "${DESCRIPTION}"
VIAddVersionKey "FileVersion"  "${VERSION}.${DEVELOPMENT_VERSION}"

;-----------------------------------------------------------------------
; General Installer Information

SetCompressor /SOLID Bzip2
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "EVMPLUGIN TEMPLATE-PDK-src-${VERSION}.exe"
BrandingText "${APP_NAME}"
InstallDir "${PLUGIN_PATH}\${APP_NAME}"

;-----------------------------------------------------------------------
; Include Files

!include "MUI.nsh"
!include "ADCPro.nsh"
!include "driver.nsh"
!include "LogicLib.nsh"

;-----------------------------------------------------------------------
; General configuration

!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING

;------------------------------------------------------------------------
; Installer Page Configuration

!insertmacro MUI_PAGE_WELCOME

!ifdef LICENSE_TXT
  !insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif

!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

;-----------------------------------------------------------------------
; Get Plug-in directory Section
; Get ADCPro directory from system registry; use default if none exists

Section -getdirectory
	ReadRegStr $0 "${REG_ROOT}" "${REG_APP_PATH}" "Plugin Path"
	StrCpy $PLUGIN_PATH $0
SectionEnd

;------------------------------------------------------------------------
; Install plug-in Section
; This is the main setction that installs the plugin components

Section Plugin SectionPlugin
	StrCpy $INSTDIR "${PLUGIN_PATH}\${APP_NAME}"
# Remove directory if present to install over the old information
	RMDir /r "$INSTDIR"
# Install the plugin source files and modify necessary .ini files
	SetOutPath "$INSTDIR\fw"
	File /r ..\fw\*.*
SectionEnd
