4 ; Script to create Installer for Windows platforms using
5 ; "nullsoft scriptable install system" (NSIS)
6 ; (available from http://nsis.sourceforge.net)
8 ; Copyright (C) 2009 K. Waschk
10 ; This program is free software; you can redistribute it and/or
11 ; modify it under the terms of the GNU General Public License
12 ; as published by the Free Software Foundation; either version 2
13 ; of the License, or (at your option) any later version.
15 ; This program is distributed in the hope that it will be useful,
16 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ; GNU General Public License for more details.
20 ; You should have received a copy of the GNU General Public License
21 ; along with this program; if not, write to the Free Software
22 ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 ; Written by K. Waschk, 2009
26 ; Based on "Modern UI Basic Example Script" by Joost Verburg
28 ; Last tested with NSIS version 2.42
30 ; Run makensis.exe in the root of an UrJTAG source directory
31 ; extracted from a distributed archive of UrJTAG (make dist)
32 ; after configuring and compiling. Usually you want to compile
33 ; with --with-ftd2xx, --with-inpout32, --enable-relocatable and
34 ; the CFLAGS=-mno-cygwin setting. To make UrJTAG search for
35 ; its data files and BSDL declarations in the correct path,
36 ; add JTAG_BIN_DIR and JTAG_DATA_DIR as follows to the CFLAGS
37 ; on the same line together with ./configure and its options
38 ; (this is used for building the UrJTAG.exe distributable):
40 ; CFLAGS="-mno-cygwin -O2 -DJTAG_BIN_DIR=\\\"/\\\" -DJTAG_DATA_DIR=\\\"/data\\\""
41 ; ./configure --enable-relocatable \
42 ; --with-ftd2xx=/tmp/FTDI_CDM_204 \
43 ; --with-libusb=/tmp/LibUSB-Win32_112 \
46 ; This script now expects InpOut32.dll in the current directory
47 ; as well. You can get an InpOut32.dll that works on 32 bit AND
48 ; 64 bit Windows, including Vista, from
49 ; http://www.highrez.co.uk/Downloads/InpOut32/
51 ; No drivers for FTDI cables are installed. FTD2XX.DLL must be
52 ; in your PATH somewhere. It usually is installed with the cable
55 ;--------------------------------
60 ;--------------------------------
67 ;Default installation folder
68 InstallDir "$PROGRAMFILES\UrJTAG"
70 ;Get installation folder from registry if available
71 InstallDirRegKey HKCU "Software\UrJTAG" ""
73 ;Request application privileges for Windows Vista
74 RequestExecutionLevel user
76 ;--------------------------------
79 !define MUI_ABORTWARNING
81 ;--------------------------------
86 ;--------------------------------
89 !insertmacro MUI_PAGE_LICENSE
"COPYING"
90 !insertmacro MUI_PAGE_COMPONENTS
91 !insertmacro MUI_PAGE_DIRECTORY
93 ;Start Menu Folder Page Configuration
94 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
"HKCU"
95 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"Software\UrJTAG"
96 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"Start Menu Folder"
97 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
99 !insertmacro MUI_PAGE_INSTFILES
101 !insertmacro MUI_UNPAGE_CONFIRM
102 !insertmacro MUI_UNPAGE_INSTFILES
104 ;--------------------------------
107 !insertmacro MUI_LANGUAGE
"English"
109 ;--------------------------------
112 Section "UrJTAG executable" SecExe
114 SetOutPath "$INSTDIR"
117 WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
118 WriteUninstaller "$INSTDIR\uninst.exe"
122 Section "Documentation" SecDoc
124 SetOutPath "$INSTDIR\doc"
126 WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
127 WriteUninstaller "$INSTDIR\uninst.exe"
131 Section "Data files" SecData
133 SetOutPath "$INSTDIR\data"
134 File /r
/x Makefile
/x Makefile
.am
/x Makefile
.in data\
*
135 WriteRegStr HKCU "Software\UrJTAG" "" $INSTDIR
136 WriteUninstaller "$INSTDIR\uninst.exe"
140 Section "Start Menu Entries" SecStartMenu
142 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
144 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
145 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\JTAG Shell.lnk" "$INSTDIR\jtag.exe"
146 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Documentation.lnk" "$INSTDIR\doc\UrJTAG.txt"
147 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
148 !insertmacro MUI_STARTMENU_WRITE_END
154 ;--------------------------------
157 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
159 !insertmacro MUI_DESCRIPTION_TEXT
${SecExe} \
162 !insertmacro MUI_DESCRIPTION_TEXT
${SecDoc} \
163 "Documentation for UrJTAG"
165 !insertmacro MUI_DESCRIPTION_TEXT
${SecData} \
166 "BSDL include files and part descriptions for autodetection"
168 !insertmacro MUI_DESCRIPTION_TEXT
${SecStartMenu} \
169 "Links to UrJTAG in Start Menu"
171 !insertmacro MUI_FUNCTION_DESCRIPTION_END
173 ;--------------------------------
178 RMDir /r
"$INSTDIR\doc"
179 RMDir /r
"$INSTDIR\data"
180 Delete "$INSTDIR\jtag.exe"
181 Delete "$INSTDIR\uninst.exe"
184 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
185 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
186 RMDir "$SMPROGRAMS\$StartMenuFolder"
188 DeleteRegKey /ifempty
HKCU "Software\UrJTAG"