1 #!Nsis Installer Command Script
3 # Copyright (c) 2009, Shao Miller (shao.miller@yrdsb.edu.on.ca)
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 # ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
16 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR
18 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 !include "version.nsh"
26 !define PRODUCT_NAME "Netwide Assembler"
27 !define PRODUCT_SHORT_NAME "nasm"
28 !define PACKAGE_NAME "${PRODUCT_NAME} ${VERSION}"
29 !define PACKAGE_SHORT_NAME "${PRODUCT_SHORT_NAME}-${VERSION}"
31 Name "${PACKAGE_NAME}"
32 OutFile "${PACKAGE_SHORT_NAME}-installer.exe"
33 InstallDir "$PROGRAMFILES\NASM"
34 InstallDirRegKey HKLM "SOFTWARE\${PACKAGE_SHORT_NAME}" "InstallDir"
39 DirText "Please select the installation folder."
42 ComponentText "Select which optional components you want to install."
46 ShowUninstDetails hide
49 Section "${PACKAGE_NAME}"
52 SetOutPath "$INSTDIR\."
55 File "doc/nasmdoc.pdf"
56 File "rdoff/ldrdf.exe"
57 File "rdoff/rdf2bin.exe"
58 File "rdoff/rdf2com.exe"
59 File "rdoff/rdf2ihx.exe"
60 File "rdoff/rdfdump.exe"
61 File "rdoff/rdflib.exe"
63 FileOpen $0 "nasmpath.bat" w
65 FileWrite $0 "@set path=%path%;$INSTDIR$\r$\n"
66 FileWrite $0 "@%comspec%"
71 Section "Start Menu Shortcuts"
72 CreateDirectory "$SMPROGRAMS\${PACKAGE_NAME}"
73 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\Uninstall ${PACKAGE_NAME}.lnk" "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe" "" "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe" 0
74 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\NASM Shell.lnk" "$INSTDIR\nasmpath.bat" "" "$INSTDIR\nasmpath.bat" 0
75 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\NASM Manual.lnk" "$INSTDIR\nasmdoc.pdf" "" "$INSTDIR\nasmdoc.pdf" 0
78 Section "Desktop Icons"
79 CreateShortCut "$DESKTOP\NASM.lnk" "$INSTDIR\nasmpath.bat" "" "$INSTDIR\nasmpath.bat" 0
83 Delete /rebootok "$DESKTOP\NASM.lnk"
84 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\NASM Shell.lnk"
85 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\NASM Manual.lnk"
86 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\Uninstall ${PACKAGE_NAME}.lnk"
87 RMDir "$SMPROGRAMS\${PACKAGE_NAME}"
89 Delete /rebootok "$INSTDIR\nasmpath.bat"
90 Delete /rebootok "$INSTDIR\rdx.exe"
91 Delete /rebootok "$INSTDIR\rdflib.exe"
92 Delete /rebootok "$INSTDIR\rdfdump.exe"
93 Delete /rebootok "$INSTDIR\rdf2ihx.exe"
94 Delete /rebootok "$INSTDIR\rdf2com.exe"
95 Delete /rebootok "$INSTDIR\rdf2bin.exe"
96 Delete /rebootok "$INSTDIR\ndisasm.exe"
97 Delete /rebootok "$INSTDIR\nasmdoc.pdf"
98 Delete /rebootok "$INSTDIR\nasm.exe"
99 Delete /rebootok "$INSTDIR\ldrdf.exe"
104 WriteUninstaller "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe"