OSDN Git Service

Updated install script. Also updated web-update tool.
[lamexp/LameXP.git] / etc / NSIS / setup.nsi
1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // LameXP - Audio Encoder Front-End
3 ; // Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
4 ; //
5 ; // This program is free software; you can redistribute it and/or modify
6 ; // it under the terms of the GNU General Public License as published by
7 ; // the Free Software Foundation; either version 2 of the License, or
8 ; // (at your option) any later version.
9 ; //
10 ; // This program is distributed in the hope that it will be useful,
11 ; // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ; // GNU General Public License for more details.
14 ; //
15 ; // You should have received a copy of the GNU General Public License along
16 ; // with this program; if not, write to the Free Software Foundation, Inc.,
17 ; // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 ; //
19 ; // http://www.gnu.org/licenses/gpl-2.0.txt
20 ; ///////////////////////////////////////////////////////////////////////////////
21
22 ;--------------------------------
23 ;Basic Defines
24 ;--------------------------------
25
26 !ifndef LAMEXP_VERSION
27   !error "LAMEXP_VERSION is not defined !!!"
28 !endif
29 !ifndef LAMEXP_BUILD
30   !error "LAMEXP_BUILD is not defined !!!"
31 !endif
32 !ifndef LAMEXP_SUFFIX
33   !error "LAMEXP_SUFFIX is not defined !!!"
34 !endif
35 !ifndef LAMEXP_DATE
36   !error "LAMEXP_DATE is not defined !!!"
37 !endif
38 !ifndef LAMEXP_OUTPUT_FILE
39   !error "LAMEXP_OUTPUT_FILE is not defined !!!"
40 !endif
41 !ifndef LAMEXP_SOURCE_PATH
42   !error "LAMEXP_SOURCE_PATH is not defined !!!"
43 !endif
44 !ifndef LAMEXP_UPX_PATH
45   !error "LAMEXP_UPX_PATH is not defined !!!"
46 !endif
47
48 ;UUID
49 !define MyRegPath "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD7A67D-D700-4043-B54F-DD106D00F308}"
50
51
52 ;--------------------------------
53 ;Includes
54 ;--------------------------------
55
56 !include `MUI2.nsh`
57 !include `WinVer.nsh`
58 !include `UAC.nsh`
59 !include `parameters.nsh`
60
61
62 ;--------------------------------
63 ;Installer Attributes
64 ;--------------------------------
65
66 RequestExecutionLevel user
67 ShowInstDetails show
68 ShowUninstDetails show
69 Name "LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX} [Build #${LAMEXP_BUILD}]"
70 OutFile "${LAMEXP_OUTPUT_FILE}"
71 BrandingText "Date created: ${LAMEXP_DATE}"
72 InstallDir "$PROGRAMFILES\MuldeR\LameXP v${LAMEXP_VERSION}"
73 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
74
75
76 ;--------------------------------
77 ;Compressor
78 ;--------------------------------
79
80 SetCompressor /SOLID LZMA
81 SetCompressorDictSize 64
82
83 !packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
84
85
86 ;--------------------------------
87 ;Reserved Files
88 ;--------------------------------
89
90 ReserveFile "${NSISDIR}\Plugins\UAC.dll"
91 ReserveFile "${NSISDIR}\Plugins\System.dll"
92 ReserveFile "${NSISDIR}\Plugins\nsDialogs.dll"
93 ReserveFile "${NSISDIR}\Plugins\StartMenu.dll"
94 ReserveFile "${NSISDIR}\Plugins\LockedList.dll"
95
96
97 ;--------------------------------
98 ;Variables
99 ;--------------------------------
100
101 Var StartMenuFolder
102
103
104 ;--------------------------------
105 ;Version Info
106 ;--------------------------------
107
108 !searchreplace PRODUCT_VERSION_DATE "${LAMEXP_DATE}" "-" "."
109 VIProductVersion "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
110
111 VIAddVersionKey "Author" "LoRd_MuldeR <mulder2@gmx.de>"
112 VIAddVersionKey "Comments" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."
113 VIAddVersionKey "CompanyName" "Free Software Foundation"
114 VIAddVersionKey "FileDescription" "LameXP v${LAMEXP_VERSION} ${LAMEXP_SUFFIX} [Build #${LAMEXP_BUILD}]"
115 VIAddVersionKey "FileVersion" "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD} (${LAMEXP_VERSION})"
116 VIAddVersionKey "LegalCopyright" "Copyright 2004-2010 LoRd_MuldeR"
117 VIAddVersionKey "LegalTrademarks" "GNU"
118 VIAddVersionKey "OriginalFilename" "LameXP.${LAMEXP_DATE}.exe"
119 VIAddVersionKey "ProductName" "LameXP - Audio Encoder Frontend"
120 VIAddVersionKey "ProductVersion" "${LAMEXP_VERSION}, Build #${LAMEXP_BUILD} (${LAMEXP_DATE})"
121 VIAddVersionKey "Website" "http://mulder.at.gg/"
122
123
124 ;--------------------------------
125 ;MUI2 Interface Settings
126 ;--------------------------------
127
128 !define MUI_ABORTWARNING
129 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
130 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${MyRegPath}"
131 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartmenuFolder"
132 !define MUI_LANGDLL_REGISTRY_ROOT HKLM
133 !define MUI_LANGDLL_REGISTRY_KEY "${MyRegPath}"
134 !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage"
135 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "LameXP v${LAMEXP_VERSION}"
136 !define MUI_FINISHPAGE_NOAUTOCLOSE
137 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
138 !define MUI_FINISHPAGE_RUN
139 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
140 !define MUI_FINISHPAGE_SHOWREADME
141 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
142 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
143 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
144 !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
145 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
146 !define MUI_HEADERIMAGE
147 !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
148 !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
149 !define MUI_LANGDLL_ALLLANGUAGES
150 !define MUI_CUSTOMFUNCTION_GUIINIT MyUacInit
151 !define MUI_CUSTOMFUNCTION_UNGUIINIT un.MyUacInit
152 !define MUI_LANGDLL_ALWAYSSHOW
153
154
155 ;--------------------------------
156 ;MUI2 Pages
157 ;--------------------------------
158
159 ;Installer
160 !define MUI_WELCOMEPAGE_TITLE_3LINES
161 !define MUI_FINISHPAGE_TITLE_3LINES
162 !insertmacro MUI_PAGE_WELCOME
163 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
164 !insertmacro MUI_PAGE_DIRECTORY
165 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
166 Page Custom LockedListShow
167 !insertmacro MUI_PAGE_INSTFILES
168 !insertmacro MUI_PAGE_FINISH
169
170 ;Uninstaller
171 !define MUI_WELCOMEPAGE_TITLE_3LINES
172 !define MUI_FINISHPAGE_TITLE_3LINES
173 !insertmacro MUI_UNPAGE_WELCOME
174 !insertmacro MUI_UNPAGE_CONFIRM
175 UninstPage Custom un.LockedListShow
176 !insertmacro MUI_UNPAGE_INSTFILES
177 !insertmacro MUI_UNPAGE_FINISH
178
179
180 ;--------------------------------
181 ;Languages
182 ;--------------------------------
183  
184 !insertmacro MUI_LANGUAGE "English" ;first language is the default language
185 !insertmacro MUI_LANGUAGE "German"
186 !insertmacro MUI_LANGUAGE "Spanish"
187
188 ; !insertmacro MUI_LANGUAGE "French"
189 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
190 ; !insertmacro MUI_LANGUAGE "SimpChinese"
191 ; !insertmacro MUI_LANGUAGE "TradChinese"
192 ; !insertmacro MUI_LANGUAGE "Japanese"
193 ; !insertmacro MUI_LANGUAGE "Italian"
194 ; !insertmacro MUI_LANGUAGE "Dutch"
195 ; !insertmacro MUI_LANGUAGE "Greek"
196 ; !insertmacro MUI_LANGUAGE "Russian"
197 ; !insertmacro MUI_LANGUAGE "Polish"
198 ; !insertmacro MUI_LANGUAGE "Ukrainian"
199 ; !insertmacro MUI_LANGUAGE "Hungarian"
200 ; !insertmacro MUI_LANGUAGE "Romanian"
201 ; !insertmacro MUI_LANGUAGE "Serbian"
202 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
203 ; !insertmacro MUI_LANGUAGE "Arabic"
204 ; !insertmacro MUI_LANGUAGE "Portuguese"
205 ; !insertmacro MUI_LANGUAGE "Afrikaans"
206 ; !insertmacro MUI_LANGUAGE "Malay"
207 ; !insertmacro MUI_LANGUAGE "Indonesian"
208
209
210 ;--------------------------------
211 ;Translation
212 ;--------------------------------
213
214 ;English
215 !include "..\Translation\Blank.nsh"
216
217 ;German
218 !include "..\Translation\LameXP_DE.nsh"
219
220 ;Spanish
221 !include "..\Translation\LameXP_ES.nsh"
222
223
224 ;--------------------------------
225 ;Installer initialization
226 ;--------------------------------
227
228 Function .onInit
229         ${If} ${UAC_IsInnerInstance}
230                 !insertmacro MUI_LANGDLL_DISPLAY
231         ${Else}
232                 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
233                 Pop $0
234                 StrCmp $0 0 +3
235                 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the installer is already running!"
236                 Quit
237         ${EndIf}  
238
239         ${If} ${IsNT}
240                 Goto OS_Windows_NT
241         ${Else}
242                 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, the Windows 9x series (including ME) is not supported by this application!"
243                 Quit
244         ${EndIf}
245   
246         OS_Windows_NT:
247         ${If} ${AtMostWinNT4}
248                 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, Windows NT 4.0 (and older) is not supported by this application!"
249                 Quit
250         ${EndIf}
251 FunctionEnd
252
253 Function un.onInit
254         ${If} ${UAC_IsInnerInstance}
255                 !insertmacro MUI_LANGDLL_DISPLAY
256         ${Else}
257                 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
258                 Pop $0
259                 StrCmp $0 0 +3
260                 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the un-installer is already running!"
261                 Quit
262         ${EndIf}  
263 FunctionEnd
264
265
266 ;--------------------------------
267 ;UAC initialization
268 ;--------------------------------
269
270 Function MyUacInit
271         UAC_TryAgain:
272         !insertmacro UAC_RunElevated
273         ${Switch} $0
274         ${Case} 0
275                 ${IfThen} $1 = 1 ${|} Quit ${|}
276                 ${IfThen} $3 <> 0 ${|} ${Break} ${|}
277                 ${If} $1 = 3
278                         MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This installer requires admin access, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
279                 ${EndIf}
280         ${Case} 1223
281                 MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This installer requires admin privileges, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
282                 Quit
283         ${Case} 1062
284                 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Logon service not running, aborting!"
285                 Quit
286         ${Default}
287                 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to elevate installer! (Error code: $0)"
288                 Quit
289         ${EndSwitch}
290 FunctionEnd
291
292 Function un.MyUacInit
293         UAC_TryAgain:
294         !insertmacro UAC_RunElevated
295         ${Switch} $0
296         ${Case} 0
297                 ${IfThen} $1 = 1 ${|} Quit ${|}
298                 ${IfThen} $3 <> 0 ${|} ${Break} ${|}
299                 ${If} $1 = 3
300                         MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This un-installer requires admin access, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
301                 ${EndIf}
302         ${Case} 1223
303                 MessageBox MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND|MB_OKCANCEL "This un-installer requires admin privileges, please try again!" /SD IDCANCEL IDOK UAC_TryAgain
304                 Quit
305         ${Case} 1062
306                 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Logon service not running, aborting!"
307                 Quit
308         ${Default}
309                 MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to elevate installer! (Error code: $0)"
310                 Quit
311         ${EndSwitch}
312 FunctionEnd
313
314
315 ;--------------------------------
316 ;Macros & Auxiliary Functions
317 ;--------------------------------
318
319 !macro PrintProgress Text
320         SetDetailsPrint textonly
321         DetailPrint '${Text}'
322         SetDetailsPrint listonly
323         Sleep 1000
324 !macroend
325
326 !macro CreateWebLink ShortcutFile TargetURL
327         Push $0
328         Push $1
329         StrCpy $0 "${ShortcutFile}"
330         StrCpy $1 "${TargetURL}"
331         Call _CreateWebLink
332         Pop $1
333         Pop $0
334 !macroend
335
336 Function _CreateWebLink
337         FlushINI "$0"
338         SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
339         DeleteINISec "$0" "DEFAULT"
340         DeleteINISec "$0" "InternetShortcut"
341         WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
342         WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
343         WriteINIStr "$0" "InternetShortcut" "URL" "$1"
344         WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
345         WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
346         FlushINI "$0"
347         SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
348 FunctionEnd
349
350 !macro TrimStr VarName
351         Push ${VarName}
352         Call _TrimStr
353         Pop ${VarName}
354 !macroend
355
356 Function _TrimStr
357         Exch $R1
358         Push $R2
359  
360         TrimLoop1:
361         StrCpy $R2 "$R1" 1
362         StrCmp "$R2" " " TrimLeft
363         StrCmp "$R2" "$\r" TrimLeft
364         StrCmp "$R2" "$\n" TrimLeft
365         StrCmp "$R2" "$\t" TrimLeft
366         Goto TrimLoop2
367         TrimLeft:       
368         StrCpy $R1 "$R1" "" 1
369         Goto TrimLoop1
370  
371         TrimLoop2:
372         StrCpy $R2 "$R1" 1 -1
373         StrCmp "$R2" " " TrimRight
374         StrCmp "$R2" "$\r" TrimRight
375         StrCmp "$R2" "$\n" TrimRight
376         StrCmp "$R2" "$\t" TrimRight
377         Goto TrimDone
378         TrimRight:      
379         StrCpy $R1 "$R1" -1
380         Goto TrimLoop2
381  
382         TrimDone:
383         Pop $R2
384         Exch $R1
385 FunctionEnd
386
387 !macro GetExecutableName OutVar
388         !insertmacro GetCommandlineParameter "Update" "LameXP.exe" ${OutVar}
389         !insertmacro TrimStr ${OutVar}
390         StrCmp ${OutVar} "" 0 +2
391         StrCpy ${OutVar} "LameXP.exe"
392 !macroend
393
394
395 ;--------------------------------
396 ;Install Files
397 ;--------------------------------
398
399 Section "-Prepare"
400         SetOutPath "$INSTDIR"
401 SectionEnd
402
403 Section "!Install Files"
404         !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_INSTFILES)"
405         !insertmacro GetExecutableName $R0
406         File `/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
407         File `${LAMEXP_SOURCE_PATH}\*.txt`
408         File `${LAMEXP_SOURCE_PATH}\*.html`
409 SectionEnd
410
411 Section "-Write Uinstaller"
412         !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_MAKEUNINST)"
413         WriteUninstaller "$INSTDIR\Uninstall.exe"
414 SectionEnd
415
416 Section "-Create Shortcuts"
417         !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
418                 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_SHORTCUTS)"
419                 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
420                 
421                 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
422                 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
423                 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
424                 
425                 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\LameXP.exe" "" "$INSTDIR\LameXP.exe" 0
426                 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\License.lnk" "$INSTDIR\License.txt"
427                 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
428                 
429                 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "http://mulder.dummwiedeutsch.de/"
430                 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
431                 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
432         !insertmacro MUI_STARTMENU_WRITE_END
433 SectionEnd
434
435 Section "-Update Registry"
436         !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_REGISTRY)"
437         WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
438         WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
439         WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP"
440 SectionEnd
441
442 Section "-Finished"
443         !insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
444 SectionEnd
445
446
447 ;--------------------------------
448 ;Uninstaller
449 ;--------------------------------
450
451 Section "Uninstall"
452         SetOutPath "$INSTDIR"
453         !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_UNINSTALL)"
454
455         Delete /REBOOTOK "$INSTDIR\*.exe"
456         Delete /REBOOTOK "$INSTDIR\*.txt"
457         RMDir "$INSTDIR"
458
459         !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
460         StrCmp "$StartMenuFolder" "" NoStartmenuFolder
461         IfFileExists "$SMPROGRAMS\$StartMenuFolder\*.*" 0 NoStartmenuFolder
462         Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
463         Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
464         RMDir "$SMPROGRAMS\$StartMenuFolder"
465
466         NoStartmenuFolder:
467
468         DeleteRegValue HKLM "${MyRegPath}" "InstallLocation"
469         DeleteRegValue HKLM "${MyRegPath}" "UninstallString"
470         DeleteRegValue HKLM "${MyRegPath}" "DisplayName"
471         DeleteRegValue HKLM "${MyRegPath}" "StartmenuFolder"
472         DeleteRegValue HKLM "${MyRegPath}" "SetupLanguage"
473         
474         MessageBox MB_YESNO|MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +2
475         Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
476
477         !insertmacro PrintProgress "$(MUI_UNTEXT_FINISH_TITLE)."
478 SectionEnd
479
480
481 ;--------------------------------
482 ;Check For Update Mode
483 ;--------------------------------
484
485 Function CheckForUpdate
486         !insertmacro GetCommandlineParameter "Update" "?" $R0
487         StrCmp $R0 "?" 0 EnableUpdateMode
488
489         StrCmp "$INSTDIR" "" 0 +2
490         Return
491         IfFileExists "$INSTDIR\*.*" +2
492         Return
493         StrCmp "$EXEDIR" "$INSTDIR" 0 +2
494         Return
495         IfFileExists "$INSTDIR\LameXP.exe" +2
496         Return
497
498         EnableUpdateMode:
499
500         FindWindow $R0 "#32770" "" $HWNDPARENT
501         GetDlgItem $R1 $R0 1019
502         EnableWindow $R1 0
503
504         FindWindow $R0 "#32770" "" $HWNDPARENT
505         GetDlgItem $R1 $R0 1001
506         EnableWindow $R1 0
507 FunctionEnd
508
509
510 ;--------------------------------
511 ;Locked List
512 ;--------------------------------
513
514 Function LockedListShow
515         !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
516         ${If} ${AtLeastWinXP}
517                 !insertmacro GetExecutableName $R0
518                 LockedList::AddModule "\$R0"
519                 LockedList::AddModule "\Uninstall.exe"
520                 LockedList::AddModule "\Au_.exe"
521         ${EndIf}
522         LockedList::Dialog /autonext /heading "$(LAMEXP_LANG_LOCKEDLIST_HEADING)" /noprograms "$(LAMEXP_LANG_LOCKEDLIST_NOPROG)" /searching  "$(LAMEXP_LANG_LOCKEDLIST_SEARCH)" /colheadings "$(LAMEXP_LANG_LOCKEDLIST_COLHDR1)" "$(LAMEXP_LANG_LOCKEDLIST_COLHDR2)"
523         Pop $R0
524 FunctionEnd
525
526 Function un.LockedListShow
527         !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
528         ${If} ${AtLeastWinXP}
529                 LockedList::AddModule "\LameXP.exe"
530                 LockedList::AddModule "\Uninstall.exe"
531         ${EndIf}
532         LockedList::Dialog /autonext /heading "$(LAMEXP_LANG_LOCKEDLIST_HEADING)" /noprograms "$(LAMEXP_LANG_LOCKEDLIST_NOPROG)" /searching  "$(LAMEXP_LANG_LOCKEDLIST_SEARCH)" /colheadings "$(LAMEXP_LANG_LOCKEDLIST_COLHDR1)" "$(LAMEXP_LANG_LOCKEDLIST_COLHDR2)"
533         Pop $R0
534 FunctionEnd
535
536
537 ;--------------------------------
538 ;Install Success
539 ;--------------------------------
540
541 Function RunAppFunction
542         !insertmacro GetExecutableName $R0
543         !insertmacro UAC_AsUser_ExecShell "explore" "$INSTDIR" "" "" SW_SHOWNORMAL
544         !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\$R0" "" "$INSTDIR" SW_SHOWNORMAL
545 FunctionEnd
546
547 Function ShowReadmeFunction
548         !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\License.txt" "" "" SW_SHOWNORMAL
549 FunctionEnd
550