Fixed the absence of environment-passing for assignment special macros.
[cslatevm.git] / pkg / win / setup.nsi
blobadac6186a6c728ab6d9ed8dda4da77917f70ad19
1 # Auto-generated by EclipseNSIS Script Wizard
2 # Mar 26, 2009 2:30:42 PM
4 Name Slate
6 # General Symbol Definitions
7 !define REGKEY "SOFTWARE\$(^Name)"
8 !define VERSION 1.0
9 !define COMPANY "Brian T. Rice"
10 !define URL http://www.slatelanguage.org
12 # MultiUser Symbol Definitions
13 !define MULTIUSER_EXECUTIONLEVEL Power
14 !define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
15 !define MULTIUSER_MUI
16 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${REGKEY}"
17 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME MultiUserInstallMode
18 !define MULTIUSER_INSTALLMODE_COMMANDLINE
19 !define MULTIUSER_INSTALLMODE_INSTDIR Slate
20 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
21 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
23 # MUI Symbol Definitions
24 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue-full.ico"
25 !define MUI_FINISHPAGE_NOAUTOCLOSE
26 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
27 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
28 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
29 !define MUI_STARTMENUPAGE_DEFAULTFOLDER Slate
30 !define MUI_FINISHPAGE_RUN $INSTDIR\slate.exe
31 !define MUI_FINISHPAGE_RUN_PARAMETERS "-i $INSTDIR\slate.image"
32 !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README
33 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"
34 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
36 # Included files
37 !include MultiUser.nsh
38 !include Sections.nsh
39 !include MUI2.nsh
40 !include Library.nsh
42 # Variables
43 Var StartMenuGroup
44 Var LibInstall
46 # Installer pages
47 !insertmacro MUI_PAGE_WELCOME
48 !insertmacro MUI_PAGE_LICENSE ..\..\LICENSE
49 !insertmacro MUI_PAGE_COMPONENTS
50 !insertmacro MULTIUSER_PAGE_INSTALLMODE
51 !insertmacro MUI_PAGE_DIRECTORY
52 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
53 !insertmacro MUI_PAGE_INSTFILES
54 !insertmacro MUI_PAGE_FINISH
55 !insertmacro MUI_UNPAGE_CONFIRM
56 !insertmacro MUI_UNPAGE_INSTFILES
58 # Installer languages
59 !insertmacro MUI_LANGUAGE English
61 # Installer attributes
62 OutFile setup.exe
63 InstallDir Slate
64 CRCCheck on
65 XPStyle on
66 ShowInstDetails show
67 VIProductVersion 1.0.0.0
68 VIAddVersionKey ProductName Slate
69 VIAddVersionKey ProductVersion "${VERSION}"
70 VIAddVersionKey CompanyName "${COMPANY}"
71 VIAddVersionKey CompanyWebsite "${URL}"
72 VIAddVersionKey FileVersion "${VERSION}"
73 VIAddVersionKey FileDescription ""
74 VIAddVersionKey LegalCopyright ""
75 InstallDirRegKey HKLM "${REGKEY}" Path
76 ShowUninstDetails show
78 # Installer sections
79 Section -Main SEC0000
80 # Installing library ..\..\..\..\Pre-built.2\lib\pthreadVC2.dll
81 !insertmacro InstallLib DLL $LibInstall REBOOT_PROTECTED ..\..\..\..\Pre-built.2\lib\pthreadVC2.dll $INSTDIR\pthreadVC2.dll $INSTDIR
83 SetOutPath $INSTDIR
84 SetOverwrite on
85 File /r /x *.ncb ..\..\*
86 SetOverwrite on
87 WriteRegStr HKLM "${REGKEY}\Components" Main 1
88 SectionEnd
90 Section "Desktop Shortcut" SEC0001
91 SetOutPath $DESKTOP
92 CreateShortcut "$DESKTOP\Launch Slate.lnk" "$INSTDIR\slate.exe -i $INSTDIR\slate.image"
93 WriteRegStr HKLM "${REGKEY}\Components" "Desktop Shortcut" 1
94 SectionEnd
96 Section -post SEC0002
97 WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
98 SetOutPath $INSTDIR
99 WriteUninstaller $INSTDIR\uninstall.exe
100 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
101 SetOutPath $SMPROGRAMS\$StartMenuGroup
102 CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
103 !insertmacro MUI_STARTMENU_WRITE_END
104 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
105 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
106 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
107 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
108 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
109 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
110 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
111 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
112 SectionEnd
114 # Macro for selecting uninstaller sections
115 !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
116 Push $R0
117 ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
118 StrCmp $R0 1 0 next${UNSECTION_ID}
119 !insertmacro SelectSection "${UNSECTION_ID}"
120 GoTo done${UNSECTION_ID}
121 next${UNSECTION_ID}:
122 !insertmacro UnselectSection "${UNSECTION_ID}"
123 done${UNSECTION_ID}:
124 Pop $R0
125 !macroend
127 # Uninstaller sections
128 Section /o "-un.Desktop Shortcut" UNSEC0001
129 Delete /REBOOTOK "$DESKTOP\Launch Slate.lnk"
130 DeleteRegValue HKLM "${REGKEY}\Components" "Desktop Shortcut"
131 SectionEnd
133 Section /o -un.Main UNSEC0000
134 RmDir /r /REBOOTOK $INSTDIR
135 RmDir /r /REBOOTOK $INSTDIR
136 Delete /REBOOTOK $INSTDIR\LICENSE
137 Delete /REBOOTOK $INSTDIR\README
138 Delete /REBOOTOK $INSTDIR\kernel.new.little.64.1234230732370510.image
139 Delete /REBOOTOK $INSTDIR\kernel.new.little.32.1234233045701141.image
140 Delete /REBOOTOK $INSTDIR\slate.image
141 Delete /REBOOTOK $INSTDIR\slate.exe
142 # Uninstalling library $INSTDIR\pthreadVC2.dll
143 !insertmacro UnInstallLib DLL SHARED REBOOT_PROTECTED $INSTDIR\pthreadVC2.dll
145 DeleteRegValue HKLM "${REGKEY}\Components" Main
146 SectionEnd
148 Section -un.post UNSEC0003
149 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
150 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
151 Delete /REBOOTOK $INSTDIR\uninstall.exe
152 DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
153 DeleteRegValue HKLM "${REGKEY}" Path
154 DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
155 DeleteRegKey /IfEmpty HKLM "${REGKEY}"
156 RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
157 RmDir /REBOOTOK $INSTDIR
158 Push $R0
159 StrCpy $R0 $StartMenuGroup 1
160 StrCmp $R0 ">" no_smgroup
161 no_smgroup:
162 Pop $R0
163 SectionEnd
165 # Installer functions
166 Function .onInit
167 InitPluginsDir
168 !insertmacro MULTIUSER_INIT
169 Push $0
170 ReadRegStr $0 HKLM "${REGKEY}" Path
171 ClearErrors
172 StrCmp $0 "" +2
173 StrCpy $LibInstall 1
174 Pop $0
175 FunctionEnd
177 # Uninstaller functions
178 Function un.onInit
179 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
180 !insertmacro MULTIUSER_UNINIT
181 !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
182 !insertmacro SELECT_UNSECTION "Desktop Shortcut" ${UNSEC0001}
183 FunctionEnd
185 # Section Descriptions
186 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
187 !insertmacro MUI_DESCRIPTION_TEXT ${SEC0001} "A shortcut for running Slate from an icon on the desktop."
188 !insertmacro MUI_FUNCTION_DESCRIPTION_END