Reworked test files for better error reporting
[nasm/perl-rewrite.git] / nasm.nsi
blob84972aeafd6f83f49e1f1acd49bdee5c74f10ef3
1 #!Nsis Installer Command Script
3 # Copyright (c) 2009, Shao Miller (shao.miller@yrdsb.edu.on.ca)
4 # All rights reserved.
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"
35 SetCompressor bzip2
37 XPStyle on
39 DirText "Please select the installation folder."
40 Page directory
42 ComponentText "Select which optional components you want to install."
43 Page components
45 ShowInstDetails hide
46 ShowUninstDetails hide
47 Page instfiles
49 Section "${PACKAGE_NAME}"
50 SectionIn RO
52 SetOutPath "$INSTDIR\."
53 File "COPYING"
54 File "nasm.exe"
55 File "ndisasm.exe"
56 File "doc/nasmdoc.pdf"
57 File "rdoff/ldrdf.exe"
58 File "rdoff/rdf2bin.exe"
59 File "rdoff/rdf2com.exe"
60 File "rdoff/rdf2ihx.exe"
61 File "rdoff/rdfdump.exe"
62 File "rdoff/rdflib.exe"
63 File "rdoff/rdx.exe"
64 FileOpen $0 "nasmpath.bat" w
65 IfErrors skip
66 FileWrite $0 "@set path=%path%;$INSTDIR$\r$\n"
67 FileWrite $0 "@%comspec%"
68 FileClose $0
69 skip:
70 SectionEnd
72 Section "Start Menu Shortcuts"
73 CreateDirectory "$SMPROGRAMS\${PACKAGE_NAME}"
74 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\Uninstall ${PACKAGE_NAME}.lnk" "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe" "" "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe" 0
75 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\NASM Shell.lnk" "$INSTDIR\nasmpath.bat" "" "$INSTDIR\nasmpath.bat" 0
76 CreateShortCut "$SMPROGRAMS\${PACKAGE_NAME}\NASM Manual.lnk" "$INSTDIR\nasmdoc.pdf" "" "$INSTDIR\nasmdoc.pdf" 0
77 SectionEnd
79 Section "Desktop Icons"
80 CreateShortCut "$DESKTOP\NASM.lnk" "$INSTDIR\nasmpath.bat" "" "$INSTDIR\nasmpath.bat" 0
81 SectionEnd
83 Section "Uninstall"
84 Delete /rebootok "$DESKTOP\NASM.lnk"
85 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\NASM Shell.lnk"
86 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\NASM Manual.lnk"
87 Delete /rebootok "$SMPROGRAMS\${PACKAGE_NAME}\Uninstall ${PACKAGE_NAME}.lnk"
88 RMDir "$SMPROGRAMS\${PACKAGE_NAME}"
90 Delete /rebootok "$INSTDIR\nasmpath.bat"
91 Delete /rebootok "$INSTDIR\rdx.exe"
92 Delete /rebootok "$INSTDIR\rdflib.exe"
93 Delete /rebootok "$INSTDIR\rdfdump.exe"
94 Delete /rebootok "$INSTDIR\rdf2ihx.exe"
95 Delete /rebootok "$INSTDIR\rdf2com.exe"
96 Delete /rebootok "$INSTDIR\rdf2bin.exe"
97 Delete /rebootok "$INSTDIR\ndisasm.exe"
98 Delete /rebootok "$INSTDIR\nasmdoc.pdf"
99 Delete /rebootok "$INSTDIR\nasm.exe"
100 Delete /rebootok "$INSTDIR\ldrdf.exe"
101 Delete /rebootok "$INSTDIR\COPYING"
102 RMDir "$INSTDIR"
103 SectionEnd
105 Section -post
106 WriteUninstaller "$INSTDIR\Uninstall ${PACKAGE_NAME}.exe"
107 SectionEnd