Added some code to the installer that cleans up obsolete files form the LameXP direct...
[LameXP.git] / etc / NSIS / setup.nsi
blob75777e2d97aca2fa42eb0004a5aa61d9a225b8f2
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 ; ///////////////////////////////////////////////////////////////////////////////
22 ;--------------------------------
23 ;Basic Defines
24 ;--------------------------------
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
48 ;UUID
49 !define MyRegPath "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD7A67D-D700-4043-B54F-DD106D00F308}"
52 ;--------------------------------
53 ;Includes
54 ;--------------------------------
56 !include `MUI2.nsh`
57 !include `WinVer.nsh`
58 !include `UAC.nsh`
59 !include `parameters.nsh`
62 ;--------------------------------
63 ;Installer Attributes
64 ;--------------------------------
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"
76 ;--------------------------------
77 ;Compressor
78 ;--------------------------------
80 SetCompressor /SOLID LZMA
81 SetCompressorDictSize 64
83 !packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
86 ;--------------------------------
87 ;Reserved Files
88 ;--------------------------------
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"
97 ;--------------------------------
98 ;Variables
99 ;--------------------------------
101 Var StartMenuFolder
104 ;--------------------------------
105 ;Version Info
106 ;--------------------------------
108 !searchreplace PRODUCT_VERSION_DATE "${LAMEXP_DATE}" "-" "."
109 VIProductVersion "${PRODUCT_VERSION_DATE}.${LAMEXP_BUILD}"
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/"
124 ;--------------------------------
125 ;MUI2 Interface Settings
126 ;--------------------------------
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
155 ;--------------------------------
156 ;MUI2 Pages
157 ;--------------------------------
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
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
180 ;--------------------------------
181 ;Languages
182 ;--------------------------------
184 !insertmacro MUI_LANGUAGE "English" ;first language is the default language
185 !insertmacro MUI_LANGUAGE "German"
186 !insertmacro MUI_LANGUAGE "Spanish"
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"
210 ;--------------------------------
211 ;Translation
212 ;--------------------------------
214 ;English
215 !include "..\Translation\Blank.nsh"
217 ;German
218 !include "..\Translation\LameXP_DE.nsh"
220 ;Spanish
221 !include "..\Translation\LameXP_ES.nsh"
224 ;--------------------------------
225 ;Installer initialization
226 ;--------------------------------
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}
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}
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
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
266 ;--------------------------------
267 ;UAC initialization
268 ;--------------------------------
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
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
315 ;--------------------------------
316 ;Macros & Auxiliary Functions
317 ;--------------------------------
319 !macro PrintProgress Text
320 SetDetailsPrint textonly
321 DetailPrint '${Text}'
322 SetDetailsPrint listonly
323 Sleep 1000
324 !macroend
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
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
350 !macro TrimStr VarName
351 Push ${VarName}
352 Call _TrimStr
353 Pop ${VarName}
354 !macroend
356 Function _TrimStr
357 Exch $R1
358 Push $R2
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
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
382 TrimDone:
383 Pop $R2
384 Exch $R1
385 FunctionEnd
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
395 ;--------------------------------
396 ;Install Files
397 ;--------------------------------
399 Section "!Install Files"
400 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_INSTFILES)"
402 SetOutPath "$INSTDIR"
403 Delete "$INSTDIR\Changelog.htm"
404 Delete "$INSTDIR\Changelog.html"
405 Delete "$INSTDIR\Contributors.txt"
406 Delete "$INSTDIR\FAQ.html"
407 Delete "$INSTDIR\Howto.html"
408 Delete "$INSTDIR\LameXP.exe"
409 Delete "$INSTDIR\LameXP.exe.sig"
410 Delete "$INSTDIR\License.txt"
411 Delete "$INSTDIR\ReadMe.txt"
412 Delete "$INSTDIR\Translate.html"
413 Delete "$INSTDIR\Uninstall.exe"
415 !insertmacro GetExecutableName $R0
416 File `/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe`
417 File `${LAMEXP_SOURCE_PATH}\*.txt`
418 File `${LAMEXP_SOURCE_PATH}\*.html`
419 SectionEnd
421 Section "-Write Uinstaller"
422 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_MAKEUNINST)"
423 WriteUninstaller "$INSTDIR\Uninstall.exe"
424 SectionEnd
426 Section "-Create Shortcuts"
427 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
428 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_SHORTCUTS)"
429 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
431 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
432 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
433 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
435 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LameXP.lnk" "$INSTDIR\LameXP.exe" "" "$INSTDIR\LameXP.exe" 0
436 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_LICENSE).lnk" "$INSTDIR\License.txt"
437 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\Changelog.html"
438 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_TRANSLATE).lnk" "$INSTDIR\Translate.html"
439 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_FAQ).lnk" "$INSTDIR\FAQ.html"
440 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LAMEXP_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
442 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Official LameXP Homepage.url" "http://mulder.dummwiedeutsch.de/"
443 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
444 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\RareWares.org.url" "http://rarewares.org/"
445 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Hydrogenaudio Forums.url" "http://www.hydrogenaudio.org/"
446 !insertmacro MUI_STARTMENU_WRITE_END
447 SectionEnd
449 Section "-Update Registry"
450 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_REGISTRY)"
451 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
452 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
453 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP"
454 SectionEnd
456 Section "-Finished"
457 !insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
459 ; ---- POLL ----
460 !insertmacro UAC_AsUser_ExecShell "" "http://mulder.brhack.net/temp/style_poll/" "" "" SW_SHOWNORMAL
461 ; ---- POLL ----
462 SectionEnd
465 ;--------------------------------
466 ;Uninstaller
467 ;--------------------------------
469 Section "Uninstall"
470 SetOutPath "$INSTDIR"
471 !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_UNINSTALL)"
473 Delete /REBOOTOK "$INSTDIR\*.exe"
474 Delete /REBOOTOK "$INSTDIR\*.txt"
475 RMDir "$INSTDIR"
477 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
478 StrCmp "$StartMenuFolder" "" NoStartmenuFolder
479 IfFileExists "$SMPROGRAMS\$StartMenuFolder\*.*" 0 NoStartmenuFolder
480 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
481 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
482 RMDir "$SMPROGRAMS\$StartMenuFolder"
484 NoStartmenuFolder:
486 DeleteRegValue HKLM "${MyRegPath}" "InstallLocation"
487 DeleteRegValue HKLM "${MyRegPath}" "UninstallString"
488 DeleteRegValue HKLM "${MyRegPath}" "DisplayName"
489 DeleteRegValue HKLM "${MyRegPath}" "StartmenuFolder"
490 DeleteRegValue HKLM "${MyRegPath}" "SetupLanguage"
492 MessageBox MB_YESNO|MB_TOPMOST "$(LAMEXP_LANG_UNINST_PERSONAL)" IDNO +3
493 Delete "$LOCALAPPDATA\LoRd_MuldeR\LameXP - Audio Encoder Front-End\config.ini"
494 Delete "$INSTDIR\*.ini"
496 !insertmacro PrintProgress "$(MUI_UNTEXT_FINISH_TITLE)."
497 SectionEnd
500 ;--------------------------------
501 ;Check For Update Mode
502 ;--------------------------------
504 Function CheckForUpdate
505 !insertmacro GetCommandlineParameter "Update" "?" $R0
506 StrCmp $R0 "?" 0 EnableUpdateMode
508 StrCmp "$INSTDIR" "" 0 +2
509 Return
510 IfFileExists "$INSTDIR\*.*" +2
511 Return
512 StrCmp "$EXEDIR" "$INSTDIR" 0 +2
513 Return
514 IfFileExists "$INSTDIR\LameXP.exe" +2
515 Return
517 EnableUpdateMode:
519 FindWindow $R0 "#32770" "" $HWNDPARENT
520 GetDlgItem $R1 $R0 1019
521 EnableWindow $R1 0
523 FindWindow $R0 "#32770" "" $HWNDPARENT
524 GetDlgItem $R1 $R0 1001
525 EnableWindow $R1 0
526 FunctionEnd
529 ;--------------------------------
530 ;Locked List
531 ;--------------------------------
533 Function LockedListShow
534 !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
535 !insertmacro GetExecutableName $R0
536 LockedList::AddModule "\$R0"
537 LockedList::AddModule "\Uninstall.exe"
538 LockedList::AddModule "\Au_.exe"
539 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)"
540 Pop $R0
541 FunctionEnd
543 Function un.LockedListShow
544 !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)"
545 LockedList::AddModule "\LameXP.exe"
546 LockedList::AddModule "\Uninstall.exe"
547 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)"
548 Pop $R0
549 FunctionEnd
552 ;--------------------------------
553 ;Install Success
554 ;--------------------------------
556 Function RunAppFunction
557 !insertmacro GetExecutableName $R0
558 !insertmacro UAC_AsUser_ExecShell "explore" "$INSTDIR" "" "" SW_SHOWNORMAL
559 !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\$R0" "" "$INSTDIR" SW_SHOWNORMAL
560 FunctionEnd
562 Function ShowReadmeFunction
563 !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\License.txt" "" "" SW_SHOWNORMAL
564 FunctionEnd