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
8 ; Copyright (C) 2009 K. Waschk
\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
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
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
25 ; Written by K. Waschk, 2009
\r
26 ; Based on "Modern UI Basic Example Script" by Joost Verburg
\r
28 ; Last tested with NSIS version 2.42
\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
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
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
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
55 ;--------------------------------
\r
60 ;--------------------------------
\r
65 OutFile "UrJTAG.exe"
\r
67 ;Default installation folder
\r
68 InstallDir "$PROGRAMFILES\UrJTAG"
\r
70 ;Get installation folder from registry if available
\r
71 InstallDirRegKey HKCU "Software\UrJTAG" ""
\r
73 ;Request application privileges for Windows Vista
\r
74 RequestExecutionLevel user
\r
76 ;--------------------------------
\r
79 !define MUI_ABORTWARNING
\r
81 ;--------------------------------
\r
86 ;--------------------------------
\r
89 !insertmacro MUI_PAGE_LICENSE "COPYING"
\r
90 !insertmacro MUI_PAGE_COMPONENTS
\r
91 !insertmacro MUI_PAGE_DIRECTORY
\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
99 !insertmacro MUI_PAGE_INSTFILES
\r
101 !insertmacro MUI_UNPAGE_CONFIRM
\r
102 !insertmacro MUI_UNPAGE_INSTFILES
\r
104 ;--------------------------------
\r
107 !insertmacro MUI_LANGUAGE "English"
\r
109 ;--------------------------------
\r
110 ;Installer Sections
\r
112 Section "UrJTAG executable" SecExe
\r
114 SetOutPath "$INSTDIR"
\r
117 WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
\r
118 WriteUninstaller "$INSTDIR\uninst.exe"
\r
122 Section "Documentation" SecDoc
\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
131 Section "Data files" SecData
\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
140 Section "Start Menu Entries" SecStartMenu
\r
142 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
\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
154 ;--------------------------------
\r
157 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
\r
159 !insertmacro MUI_DESCRIPTION_TEXT ${SecExe} \
\r
160 "UrJTAG executable"
\r
162 !insertmacro MUI_DESCRIPTION_TEXT ${SecDoc} \
\r
163 "Documentation for UrJTAG"
\r
165 !insertmacro MUI_DESCRIPTION_TEXT ${SecData} \
\r
166 "BSDL include files and part descriptions for autodetection"
\r
168 !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} \
\r
169 "Links to UrJTAG in Start Menu"
\r
171 !insertmacro MUI_FUNCTION_DESCRIPTION_END
\r
173 ;--------------------------------
\r
174 ;Uninstaller Section
\r
176 Section "Uninstall"
\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
184 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
\r
185 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
\r
186 RMDir "$SMPROGRAMS\$StartMenuFolder"
\r
188 DeleteRegKey /ifempty HKCU "Software\UrJTAG"
\r