File: UrJTAG.nsi

package info (click to toggle)
urjtag 0.10%2Br2007-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 14,888 kB
  • sloc: ansic: 54,091; yacc: 2,157; lex: 1,545; vhdl: 1,324; makefile: 1,251; sh: 11
file content (190 lines) | stat: -rw-r--r-- 5,530 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
;
; $Id: UrJTAG.nsi 1729 2010-01-24 11:31:51Z vapier $
;
; Script to create Installer for Windows platforms using 
;   "nullsoft scriptable install system" (NSIS)
;   (available from http://nsis.sourceforge.net)
;
; Copyright (C) 2009 K. Waschk
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; This program 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 General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
; 02111-1307, USA.
;
; Written by K. Waschk, 2009
; Based on "Modern UI Basic Example Script" by Joost Verburg
;
; Last tested with NSIS version 2.42
;
; Run makensis.exe in the root of an UrJTAG source directory
; extracted from a distributed archive of UrJTAG (make dist)
; after configuring and compiling. Usually you want to compile
; with --with-ftd2xx, --with-inpout32, --enable-relocatable and
; the CFLAGS=-mno-cygwin setting. To make UrJTAG search for
; its data files and BSDL declarations in the correct path,
; add JTAG_BIN_DIR and JTAG_DATA_DIR as follows to the CFLAGS
; on the same line together with ./configure and its options
; (this is used for building the UrJTAG.exe distributable):
;
;  CFLAGS="-mno-cygwin -O2 -DJTAG_BIN_DIR=\\\"/\\\" -DJTAG_DATA_DIR=\\\"/data\\\""
;  ./configure --enable-relocatable \
;       --with-ftd2xx=/tmp/FTDI_CDM_204 \
;       --with-libusb=/tmp/LibUSB-Win32_112 \
;       --with-inpout32
;
; This script now expects InpOut32.dll in the current directory
; as well. You can get an InpOut32.dll that works on 32 bit AND
; 64 bit Windows, including Vista, from 
;     http://www.highrez.co.uk/Downloads/InpOut32/
;
; No drivers for FTDI cables are installed. FTD2XX.DLL must be
; in your PATH somewhere. It usually is installed with the cable
; drivers.
;
;--------------------------------
;Include Modern UI

  !include "MUI2.nsh"

;--------------------------------
;General

  ;Name and file
  Name "UrJTAG"
  OutFile "UrJTAG.exe"

  ;Default installation folder
  InstallDir "$PROGRAMFILES\UrJTAG"
  
  ;Get installation folder from registry if available
  InstallDirRegKey HKCU "Software\UrJTAG" ""

  ;Request application privileges for Windows Vista
  RequestExecutionLevel user

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING

;--------------------------------
;Variables

  Var StartMenuFolder

;--------------------------------
;Pages

  !insertmacro MUI_PAGE_LICENSE "COPYING"
  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY

  ;Start Menu Folder Page Configuration
  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" 
  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\UrJTAG" 
  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
  !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder

  !insertmacro MUI_PAGE_INSTFILES
  
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "UrJTAG executable" SecExe

  SetOutPath "$INSTDIR"
  File src\jtag.exe
  File inpout32.dll
  WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
  WriteUninstaller "$INSTDIR\uninst.exe"

SectionEnd

Section "Documentation" SecDoc

  SetOutPath "$INSTDIR\doc"
  File doc\UrJTAG.txt
  WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
  WriteUninstaller "$INSTDIR\uninst.exe"

SectionEnd

Section "Data files" SecData

  SetOutPath "$INSTDIR\data"
  File /r /x Makefile /x Makefile.am /x Makefile.in data\*
  WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
  WriteUninstaller "$INSTDIR\uninst.exe"

SectionEnd

Section "Start Menu Entries" SecStartMenu

 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
    ;Create shortcuts
    CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\JTAG Shell.lnk" "$INSTDIR\jtag.exe"
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Documentation.lnk" "$INSTDIR\doc\UrJTAG.txt"
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  !insertmacro MUI_STARTMENU_WRITE_END

SectionEnd



;--------------------------------
;Descriptions

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN

  !insertmacro MUI_DESCRIPTION_TEXT ${SecExe} \
    "UrJTAG executable"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecDoc} \
    "Documentation for UrJTAG"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecData} \
    "BSDL include files and part descriptions for autodetection"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} \
    "Links to UrJTAG in Start Menu"

!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
;Uninstaller Section

Section "Uninstall"

  RMDir /r "$INSTDIR\doc"
  RMDir /r "$INSTDIR\data"
  Delete "$INSTDIR\jtag.exe"
  Delete "$INSTDIR\uninst.exe"
  RMDir /r "$INSTDIR"

  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
  RMDir "$SMPROGRAMS\$StartMenuFolder"

  DeleteRegKey /ifempty HKCU "Software\UrJTAG"

SectionEnd