comparison scripts/mamba.nsi @ 460:d05ea729f0d5

NSIS scripts.
author Simon Cross <hodgestar@gmail.com>
date Sat, 17 Sep 2011 20:56:57 +0200
parents
children 11fe3636f755
comparison
equal deleted inserted replaced
459:7278518bde8d 460:d05ea729f0d5
1 ; Compile with ./scripts/makensis ./scripts/mamba.nsi .
2 ; You'll need to have previously run wine-py2exe
3
4 !include "MUI.nsh"
5
6 ; Application Details
7
8 !define MM_VERSION "0.0.0" ; set by makensis scripts
9 !define MM_UNPACK "mutable-mamba-${MM_VERSION}"
10 !define DIST_FOLDER "../dist"
11
12 Name "Mutable Mamba"
13 OutFile "${DIST_FOLDER}\mutable-mamba-${MM_VERSION}.exe"
14 InstallDir "$PROGRAMFILES\Mutable-Mamba-${MM_VERSION}"
15
16 ; Interface Settings
17
18 !define MUI_ABORTWARNING
19
20 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
21 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
22
23 !define MUI_HEADERIMAGE
24 !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
25 !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
26
27 ; Dependencies
28
29 !define COMBINED_LICENSE "../LICENSE.txt"
30 !define MM_ICON "../data/icons/program/icon.ico"
31 !define MM_PY2EXE_ZIP "mutable-mamba-${MM_VERSION}.zip"
32 !define UNINSTALLER "Uninstaller.exe"
33
34 ; Pages
35
36 !insertmacro MUI_PAGE_LICENSE "${COMBINED_LICENSE}"
37 !insertmacro MUI_PAGE_DIRECTORY
38 !insertmacro MUI_PAGE_INSTFILES
39
40 !insertmacro MUI_UNPAGE_CONFIRM
41 !insertmacro MUI_UNPAGE_INSTFILES
42
43 ; Languages
44
45 !insertmacro MUI_LANGUAGE "English"
46
47 ; Other Stuff
48
49 Icon "${MM_ICON}"
50 SetCompress off ; all the big stuff is already compressed
51
52 ; Installer Sections
53
54 Section "Mutable Mamba"
55 SetOutPath "$INSTDIR"
56
57 WriteUninstaller "$INSTDIR\${UNINSTALLER}"
58
59 File "${DIST_FOLDER}\${MM_PY2EXE_ZIP}"
60 File "${MM_ICON}"
61
62 ZipDLL::extractall "$INSTDIR\${MM_PY2EXE_ZIP}" "$INSTDIR"
63 Delete "$INSTDIR\${MM_PY2EXE_ZIP}"
64
65 CreateDirectory "$SMPROGRAMS\Mutable Mamba"
66
67 # link.lnk target.exe
68 # parameters icon.file icon_index_number start_options
69 # keyboard_shortcut description
70
71 CreateShortCut "$SMPROGRAMS\Mutable Mamba\Mutable Mamba ${MM_VERSION}.lnk" "$INSTDIR\${MM_UNPACK}\mamba.exe" \
72 "" "$INSTDIR\${MM_ICON}" "" SW_SHOWNORMAL \
73 "" "Mutable Mamba"
74
75 CreateShortCut "$SMPROGRAMS\Mutable Mamba\Uninstall Mutable Mamba ${MM_VERSION}.lnk" "$INSTDIR\${UNINSTALLER}" \
76 "" "" "" SW_SHOWNORMAL \
77 "" "Uninstall Mutable Mamba"
78
79 SectionEnd
80
81 UninstallText "This will uninstall Mutable Mamba ${MM_VERSION}."
82 UninstallIcon "${MM_ICON}"
83
84 Section "Uninstall"
85 ; Delete files not deleted during install
86 Delete "$INSTDIR\${MM_ICON}"
87
88 ; Remove py2exe folder
89 RMDir /r /REBOOTOK "$INSTDIR\${MM_UNPACK}"
90
91 ; Remove shortcut links
92 Delete "$SMPROGRAMS\Mutable Mamba\Mutable Mamba ${MM_VERSION}.lnk"
93 Delete "$SMPROGRAMS\Mutable Mamba\Uninstall Mutable Mamba ${MM_VERSION}.lnk"
94
95 ; Remove shortcut folder if no links left
96 IfFileExists "$SMPROGRAMS\Mutable Mamba\*.lnk" shortcuts_exist 0
97 RMDir /REBOOTOK "$SMPROGRAMS\Mutable Mamba"
98 shortcuts_exist:
99
100 ; Final Clean up (no point doing this while the uninstall is incomplete)
101 RMDir /r /REBOOTOK $INSTDIR
102
103 ; Offer to reboot if needed
104 IfRebootFlag 0 noreboot
105 MessageBox MB_YESNO "A reboot is required to finish the uninstallation. Do you wish to reboot now?" IDNO noreboot
106 Reboot
107 noreboot:
108
109 SectionEnd