3 !include "Sections.nsh"
4 !include "FileFunc.nsh"
5 !include "WordFunc.nsh"
7 !insertmacro MUI_LANGUAGE
"English"
9 Name "SuperCollider ${SC_VERSION}"
10 OutFile ${SC_DST_DIR}\SuperCollider
-${SC_VERSION}-win32
.exe
11 InstallDir $PROGRAMFILES\SuperCollider
-${SC_VERSION}
19 !define MUI_PAGE_HEADER_TEXT
"License"
20 !define MUI_LICENSEPAGE_TEXT_TOP
"Please review the license below."
21 !define MUI_LICENSEPAGE_TEXT_BOTTOM \
22 "By installing this software you implicitely agree with this license."
23 !insertmacro MUI_PAGE_LICENSE SuperCollider\LICENSE
.txt
25 !define MUI_PAGE_HEADER_TEXT
"Instructions"
26 !define MUI_PAGE_HEADER_SUBTEXT \
27 "Useful information regarding installation and usage"
28 !define MUI_LICENSEPAGE_TEXT_BOTTOM \
29 "These instructions will be available after installation \
30 in a README.txt file."
31 !define MUI_LICENSEPAGE_BUTTON
"Next >"
32 ;!define MUI_LICENSEPAGE_TEXT_BOTTOM \
33 ;"By installing this software you implicitely agree with this license."
34 !insertmacro MUI_PAGE_LICENSE SuperCollider\README
.txt
36 !define MUI_PAGE_HEADER_TEXT
"Installation components"
37 !insertmacro MUI_PAGE_COMPONENTS
39 !define MUI_PAGE_HEADER_TEXT
"Installation Folder"
40 !insertmacro MUI_PAGE_DIRECTORY
43 !define MUI_DIRECTORYPAGE_TEXT_DESTINATION
"Gedit Folder"
44 !define MUI_DIRECTORYPAGE_VARIABLE
$GEDIT_DIR
45 !define MUI_PAGE_HEADER_TEXT
"Gedit Folder"
46 !define MUI_PAGE_CUSTOMFUNCTION_PRE skipIfNoSced
47 !define MUI_DIRECTORYPAGE_TEXT_TOP \
48 "Setup will install Sced - a plugin for gedit text editor \
49 that allows you to interact with SuperCollider from within the editor, \
50 and adds syntax highlighting for SuperCollider code.$\n$\n\
51 Please select a folder where gedit is installed:"
52 !insertmacro MUI_PAGE_DIRECTORY
55 !insertmacro MUI_PAGE_INSTFILES
57 !insertmacro MUI_UNPAGE_CONFIRM
59 !insertmacro MUI_UNPAGE_INSTFILES
63 Section "Core" core_sect
65 File /r SuperCollider\
*
67 ;Store installation folder
69 ;WriteRegStr HKLM "Software\SuperCollider\${SC_VERSION}" "intall-dir" $INSTDIR
72 WriteUninstaller "$INSTDIR\Uninstall.exe"
76 Section "Sced (gedit integration)" sced_sect
81 FileOpen $0 $APPDATA\sced
.config
.json w
82 IfErrors doneWriteConfig
83 ${WordReplace} $INSTDIR "\" "\\" "+" $1
84 FileWrite $0 "{$\"supercollider
-dir
$\
": $\"$1$\
"}"
88 ;WriteRegStr HKLM "SOFTWARE\SuperCollider\${SC_VERSION}" "gedit-dir" "$GEDIT_DIR"
97 ; ReadRegStr $0 HKLM "Software\SuperCollider\${SC_VERSION}" "gedit-dir"
98 ; IfErrors doneDeleteSced
99 ; RMDir /r $0\lib\gedit-2\plugins\sced
100 ; Delete $0\lib\gedit-2\plugins\sced.gedit-plugin
101 ; Delete $0\share\gtksourceview-2.0\language-specs\supercollider.lang
105 ;DeleteRegKey HKLM "Software\SuperCollider\${SC_VERSION}"
109 ; --- COMPONENT DESCRIPTIONS ---
111 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
112 !insertmacro MUI_DESCRIPTION_TEXT
${core_sect} \
113 "Language interpreter and sound synthesis server. Command-line only."
115 !insertmacro MUI_DESCRIPTION_TEXT
${sced_sect} \
116 "Integration with gedit text editor.$\n$\n\
117 You need to have gedit installed."
119 !insertmacro MUI_FUNCTION_DESCRIPTION_END
124 IntOp $0 ${SF_SELECTED} |
${SF_RO}
125 SectionSetFlags
${core_sect} $0
129 Function skipIfNoSced
130 SectionGetFlags
${sced_sect} $0
131 IntOp $0 $0 & ${SF_SELECTED}
132 IntCmp $0 0 is0 ok ok
136 ${Locate} $PROGRAMFILES32 "/G=0 /L=D /M=gedit*" geditFound
137 StrCmp $GEDIT_DIR "" 0 done
138 ${Locate} $PROGRAMFILES64 "/G=0 /L=D /M=gedit*" geditFound
143 StrCpy $GEDIT_DIR $R9