OSDN Git Service

switch to pkg-config by default for libusb/libftdi
[pf3gnuchains/urjtag.git] / urjtag / UrJTAG.nsi
1 ;\r
2 ; $Id$\r
3 ;\r
4 ; Script to create Installer for Windows platforms using \r
5 ;   "nullsoft scriptable install system" (NSIS)\r
6 ;   (available from http://nsis.sourceforge.net)\r
7 ;\r
8 ; Copyright (C) 2009 K. Waschk\r
9 ;\r
10 ; This program is free software; you can redistribute it and/or\r
11 ; modify it under the terms of the GNU General Public License\r
12 ; as published by the Free Software Foundation; either version 2\r
13 ; of the License, or (at your option) any later version.\r
14 ;\r
15 ; This program is distributed in the hope that it will be useful,\r
16 ; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
17 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
18 ; GNU General Public License for more details.\r
19 ;\r
20 ; You should have received a copy of the GNU General Public License\r
21 ; along with this program; if not, write to the Free Software\r
22 ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\r
23 ; 02111-1307, USA.\r
24 ;\r
25 ; Written by K. Waschk, 2009\r
26 ; Based on "Modern UI Basic Example Script" by Joost Verburg\r
27 ;\r
28 ; Last tested with NSIS version 2.42\r
29 ;\r
30 ; Run makensis.exe in the root of an UrJTAG source directory\r
31 ; extracted from a distributed archive of UrJTAG (make dist)\r
32 ; after configuring and compiling. Usually you want to compile\r
33 ; with --with-ftd2xx, --with-inpout32, --enable-relocatable and\r
34 ; the CFLAGS=-mno-cygwin setting. To make UrJTAG search for\r
35 ; its data files and BSDL declarations in the correct path,\r
36 ; add JTAG_BIN_DIR and JTAG_DATA_DIR as follows to the CFLAGS\r
37 ; on the same line together with ./configure and its options\r
38 ; (this is used for building the UrJTAG.exe distributable):\r
39 ;\r
40 ;  CFLAGS="-mno-cygwin -O2 -DJTAG_BIN_DIR=\\\"/\\\" -DJTAG_DATA_DIR=\\\"/data\\\""\r
41 ;  ./configure --enable-relocatable \\r
42 ;       --with-ftd2xx=/tmp/FTDI_CDM_204 \\r
43 ;       --with-libusb=/tmp/LibUSB-Win32_112 \\r
44 ;       --with-inpout32\r
45 ;\r
46 ; This script now expects InpOut32.dll in the current directory\r
47 ; as well. You can get an InpOut32.dll that works on 32 bit AND\r
48 ; 64 bit Windows, including Vista, from \r
49 ;     http://www.highrez.co.uk/Downloads/InpOut32/\r
50 ;\r
51 ; No drivers for FTDI cables are installed. FTD2XX.DLL must be\r
52 ; in your PATH somewhere. It usually is installed with the cable\r
53 ; drivers.\r
54 ;\r
55 ;--------------------------------\r
56 ;Include Modern UI\r
57 \r
58   !include "MUI2.nsh"\r
59 \r
60 ;--------------------------------\r
61 ;General\r
62 \r
63   ;Name and file\r
64   Name "UrJTAG"\r
65   OutFile "UrJTAG.exe"\r
66 \r
67   ;Default installation folder\r
68   InstallDir "$PROGRAMFILES\UrJTAG"\r
69   \r
70   ;Get installation folder from registry if available\r
71   InstallDirRegKey HKCU "Software\UrJTAG" ""\r
72 \r
73   ;Request application privileges for Windows Vista\r
74   RequestExecutionLevel user\r
75 \r
76 ;--------------------------------\r
77 ;Interface Settings\r
78 \r
79   !define MUI_ABORTWARNING\r
80 \r
81 ;--------------------------------\r
82 ;Variables\r
83 \r
84   Var StartMenuFolder\r
85 \r
86 ;--------------------------------\r
87 ;Pages\r
88 \r
89   !insertmacro MUI_PAGE_LICENSE "COPYING"\r
90   !insertmacro MUI_PAGE_COMPONENTS\r
91   !insertmacro MUI_PAGE_DIRECTORY\r
92 \r
93   ;Start Menu Folder Page Configuration\r
94   !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" \r
95   !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\UrJTAG" \r
96   !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"\r
97   !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder\r
98 \r
99   !insertmacro MUI_PAGE_INSTFILES\r
100   \r
101   !insertmacro MUI_UNPAGE_CONFIRM\r
102   !insertmacro MUI_UNPAGE_INSTFILES\r
103 \r
104 ;--------------------------------\r
105 ;Languages\r
106  \r
107   !insertmacro MUI_LANGUAGE "English"\r
108 \r
109 ;--------------------------------\r
110 ;Installer Sections\r
111 \r
112 Section "UrJTAG executable" SecExe\r
113 \r
114   SetOutPath "$INSTDIR"\r
115   File src\jtag.exe\r
116   File inpout32.dll\r
117   WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR\r
118   WriteUninstaller "$INSTDIR\uninst.exe"\r
119 \r
120 SectionEnd\r
121 \r
122 Section "Documentation" SecDoc\r
123 \r
124   SetOutPath "$INSTDIR\doc"\r
125   File doc\UrJTAG.txt\r
126   WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR\r
127   WriteUninstaller "$INSTDIR\uninst.exe"\r
128 \r
129 SectionEnd\r
130 \r
131 Section "Data files" SecData\r
132 \r
133   SetOutPath "$INSTDIR\data"\r
134   File /r /x Makefile /x Makefile.am /x Makefile.in data\*\r
135   WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR\r
136   WriteUninstaller "$INSTDIR\uninst.exe"\r
137 \r
138 SectionEnd\r
139 \r
140 Section "Start Menu Entries" SecStartMenu\r
141 \r
142  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\r
143     ;Create shortcuts\r
144     CreateDirectory "$SMPROGRAMS\$StartMenuFolder"\r
145     CreateShortCut "$SMPROGRAMS\$StartMenuFolder\JTAG Shell.lnk" "$INSTDIR\jtag.exe"\r
146     CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Documentation.lnk" "$INSTDIR\doc\UrJTAG.txt"\r
147     CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"\r
148   !insertmacro MUI_STARTMENU_WRITE_END\r
149 \r
150 SectionEnd\r
151 \r
152 \r
153 \r
154 ;--------------------------------\r
155 ;Descriptions\r
156 \r
157 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
158 \r
159   !insertmacro MUI_DESCRIPTION_TEXT ${SecExe} \\r
160     "UrJTAG executable"\r
161 \r
162   !insertmacro MUI_DESCRIPTION_TEXT ${SecDoc} \\r
163     "Documentation for UrJTAG"\r
164 \r
165   !insertmacro MUI_DESCRIPTION_TEXT ${SecData} \\r
166     "BSDL include files and part descriptions for autodetection"\r
167 \r
168   !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} \\r
169     "Links to UrJTAG in Start Menu"\r
170 \r
171 !insertmacro MUI_FUNCTION_DESCRIPTION_END\r
172 \r
173 ;--------------------------------\r
174 ;Uninstaller Section\r
175 \r
176 Section "Uninstall"\r
177 \r
178   RMDir /r "$INSTDIR\doc"\r
179   RMDir /r "$INSTDIR\data"\r
180   Delete "$INSTDIR\jtag.exe"\r
181   Delete "$INSTDIR\uninst.exe"\r
182   RMDir /r "$INSTDIR"\r
183 \r
184   !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder\r
185   Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"\r
186   RMDir "$SMPROGRAMS\$StartMenuFolder"\r
187 \r
188   DeleteRegKey /ifempty HKCU "Software\UrJTAG"\r
189 \r
190 SectionEnd\r