3 !include "Sections.nsh"
4 !include "FileFunc.nsh"
5 !include "WordFunc.nsh"
7 !insertmacro MUI_LANGUAGE
"English"
9 !define SC_VERSION
"3.5-rc2"
11 Name "SuperCollider ${SC_VERSION}"
12 OutFile ${SC_DST_DIR}\SuperCollider
-${SC_VERSION}-win32
.exe
13 InstallDir $PROGRAMFILES\SuperCollider
-${SC_VERSION}
21 !define MUI_PAGE_HEADER_TEXT
"License"
22 !define MUI_LICENSEPAGE_TEXT_TOP
"Please review the license below."
23 !define MUI_LICENSEPAGE_TEXT_BOTTOM \
24 "By installing this software you implicitely agree with this license."
25 !insertmacro MUI_PAGE_LICENSE SuperCollider\COPYING
27 !define MUI_PAGE_HEADER_TEXT
"Installation components"
28 !insertmacro MUI_PAGE_COMPONENTS
30 !define MUI_PAGE_HEADER_TEXT
"Installation Folder"
31 !insertmacro MUI_PAGE_DIRECTORY
34 !define MUI_DIRECTORYPAGE_TEXT_DESTINATION
"Gedit Folder"
35 !define MUI_DIRECTORYPAGE_VARIABLE
$GEDIT_DIR
36 !define MUI_PAGE_HEADER_TEXT
"Gedit Folder"
37 !define MUI_PAGE_CUSTOMFUNCTION_PRE skipIfNoSced
38 !define MUI_DIRECTORYPAGE_TEXT_TOP \
39 "Setup will install Sced - a plugin for gedit text editor \
40 that allows you to interact with SuperCollider from within the editor, \
41 and adds syntax highlighting for SuperCollider code.$\n$\n\
42 Please select a folder where gedit is installed:"
43 !insertmacro MUI_PAGE_DIRECTORY
46 !insertmacro MUI_PAGE_INSTFILES
48 !insertmacro MUI_UNPAGE_CONFIRM
50 !insertmacro MUI_UNPAGE_INSTFILES
54 Section "Core" core_sect
56 File /r SuperCollider\
*
58 ;Store installation folder
60 ;WriteRegStr HKLM "Software\SuperCollider\${SC_VERSION}" "intall-dir" $INSTDIR
63 WriteUninstaller "$INSTDIR\Uninstall.exe"
67 Section "Sced (gedit integration)" sced_sect
72 FileOpen $0 $APPDATA\sced
.config
.json w
73 IfErrors doneWriteConfig
74 ${WordReplace} $INSTDIR "\" "\\" "+" $1
75 FileWrite $0 "{$\"supercollider
-dir
$\
": $\"$1$\
"}"
79 ;WriteRegStr HKLM "SOFTWARE\SuperCollider\${SC_VERSION}" "gedit-dir" "$GEDIT_DIR"
88 ; ReadRegStr $0 HKLM "Software\SuperCollider\${SC_VERSION}" "gedit-dir"
89 ; IfErrors doneDeleteSced
90 ; RMDir /r $0\lib\gedit-2\plugins\sced
91 ; Delete $0\lib\gedit-2\plugins\sced.gedit-plugin
92 ; Delete $0\share\gtksourceview-2.0\language-specs\supercollider.lang
96 ;DeleteRegKey HKLM "Software\SuperCollider\${SC_VERSION}"
100 ; --- COMPONENT DESCRIPTIONS ---
102 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
103 !insertmacro MUI_DESCRIPTION_TEXT
${core_sect} \
104 "Language interpreter and sound synthesis server. Command-line only."
106 !insertmacro MUI_DESCRIPTION_TEXT
${sced_sect} \
107 "Integration with gedit text editor.$\n$\n\
108 You need to have gedit installed."
110 !insertmacro MUI_FUNCTION_DESCRIPTION_END
115 IntOp $0 ${SF_SELECTED} |
${SF_RO}
116 SectionSetFlags
${core_sect} $0
120 Function skipIfNoSced
121 SectionGetFlags
${sced_sect} $0
122 IntOp $0 $0 & ${SF_SELECTED}
123 IntCmp $0 0 is0 ok ok
127 ${Locate} $PROGRAMFILES32 "/G=0 /L=D /M=gedit*" geditFound
128 StrCmp $GEDIT_DIR "" 0 done
129 ${Locate} $PROGRAMFILES64 "/G=0 /L=D /M=gedit*" geditFound
134 StrCpy $GEDIT_DIR $R9