comparison scripts/mamba.nsi @ 468:2079f6f576e1

Add vcredist.
author Simon Cross <hodgestar@gmail.com>
date Sat, 17 Sep 2011 21:43:37 +0200
parents 59a29ec5da5d
children
comparison
equal deleted inserted replaced
467:165fcc747951 468:2079f6f576e1
28 28
29 !define COMBINED_LICENSE "../LICENSE.txt" 29 !define COMBINED_LICENSE "../LICENSE.txt"
30 !define MM_ICON "../data/icons/program/icon.ico" 30 !define MM_ICON "../data/icons/program/icon.ico"
31 !define MM_WINDOWS_ICON "data\icons\program\icon.ico" 31 !define MM_WINDOWS_ICON "data\icons\program\icon.ico"
32 !define MM_PY2EXE_ZIP "mutable-mamba-${MM_VERSION}.zip" 32 !define MM_PY2EXE_ZIP "mutable-mamba-${MM_VERSION}.zip"
33 !define VCREDIST "vcredist_x86.exe"
34 !define VCREDIST_KEY "{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}"
33 !define UNINSTALLER "Uninstaller.exe" 35 !define UNINSTALLER "Uninstaller.exe"
34 36
35 ; Pages 37 ; Pages
36 38
37 !insertmacro MUI_PAGE_LICENSE "${COMBINED_LICENSE}" 39 !insertmacro MUI_PAGE_LICENSE "${COMBINED_LICENSE}"
49 51
50 Icon "${MM_ICON}" 52 Icon "${MM_ICON}"
51 SetCompress off ; all the big stuff is already compressed 53 SetCompress off ; all the big stuff is already compressed
52 54
53 ; Installer Sections 55 ; Installer Sections
56
57 Section "vcredist"
58
59 SetOutPath "$INSTDIR"
60 File "${DIST_FOLDER}\${VCREDIST}"
61 ; Check if it's already installed by checking for the uninstall key
62 ; Idea and key value to check taken post and comments at:
63 ; http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx
64
65 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${VCREDIST_KEY}" UninstallString
66 ; NSIS docs say if the key doesn't exist, we get an error and an empty string
67 IfErrors install done
68
69 install:
70 ; Runs install with progress bar and no cancel button
71 ; Details taken from
72 ; http://blogs.msdn.com/b/astebner/archive/2010/10/18/9513328.aspx
73
74 DetailPrint "Installing required MS runtime libraries"
75 ExecWait "$INSTDIR/${VCREDIST} /qb!"
76
77 done:
78
79 DetailPrint "MS runtime libraries already installed, skipping"
80
81 SectionEnd
54 82
55 Section "Mutable Mamba" 83 Section "Mutable Mamba"
56 SetOutPath "$INSTDIR" 84 SetOutPath "$INSTDIR"
57 85
58 WriteUninstaller "$INSTDIR\${UNINSTALLER}" 86 WriteUninstaller "$INSTDIR\${UNINSTALLER}"
105 IfRebootFlag 0 noreboot 133 IfRebootFlag 0 noreboot
106 MessageBox MB_YESNO "A reboot is required to finish the uninstallation. Do you wish to reboot now?" IDNO noreboot 134 MessageBox MB_YESNO "A reboot is required to finish the uninstallation. Do you wish to reboot now?" IDNO noreboot
107 Reboot 135 Reboot
108 noreboot: 136 noreboot:
109 137
138 ; TODO: We don't touch the vcredist stuff, since we can't tell a) if we were
139 ; the ones who installed it and b) if anything else needs it. This may cause
140 ; cruft on the users system, so should we tell the user?
141
110 SectionEnd 142 SectionEnd