/
build_tools.nsi
61 lines (54 loc) · 2.25 KB
/
build_tools.nsi
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
####################
#
# build_tools.nsi - sub-installer script for the pololu GNU build utils
# designed to be run from within a larger installer
#
# Last modified: 110322 by KK
#
####################
# This installer expects to be passed the variable "STARTDIR" at the command line
# The directory you point the installer at should directly contain the executables
# E.g. "makensis /DSTARTDIR=c:\working\wixel-installer\gnu-build-tools c:\working\wixel-installer\build_tools.nsi"
#Small installer for the GNU build tools
!define TOOLSVER "110415"
!include EnvVarUpdate.nsh
; !define STARTDIR "c:\foo\bar"
SetCompressor /solid lzma
RequestExecutionLevel admin
OutFile "..\..\pololu_gnu_build_tools.exe"
InstallDir "$PROGRAMFILES\Pololu\GNU Build Utilities\"
Name "Pololu GNU Build Utilities"
ShowInstDetails show
ShowUninstDetails show
AllowSkipFiles on
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
Section "Main"
SetOutPath "$INSTDIR"
File ${STARTDIR}\*.*
; File /r "c:\working\kalan\wixel\installer\wixel_tools\pololu_build_utilities_windows\"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pololu_build_utilities" "DisplayName" "Pololu GNU Build Utilities"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pololu_build_utilities" "UninstallString" "$\"$INSTDIR\Uninstall Pololu GNU Build Utilities.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pololu_build_utilities" "Publisher" "Pololu"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pololu_build_utilities" "DisplayVersion" "${TOOLSVER}"
WriteUninstaller "$INSTDIR\Uninstall Pololu GNU Build Utilities.exe"
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\cat.exe"
Delete "$INSTDIR\cp.exe"
Delete "$INSTDIR\echo.exe"
Delete "$INSTDIR\grep.exe"
Delete "$INSTDIR\license.txt"
Delete "$INSTDIR\make.exe"
Delete "$INSTDIR\mv.exe"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\rm.exe"
Delete "$INSTDIR\sed.exe"
Delete "$INSTDIR\Uninstall Pololu GNU Build Utilities.exe"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pololu_build_utilities"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
RMDir "$INSTDIR"
SectionEnd